Message ID | 20231019174944.3376335-4-sdf@google.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | xsk: TX metadata | expand |
On Thu, 19 Oct 2023 10:49:36 -0700 Stanislav Fomichev wrote: > Regenerate the userspace specs and print xsk-features bitmask. I'm afraid you regenerated in previous patch already :] Perhaps we should add an easy-to-use flag to ynl-regen to skip tools/ ? > diff --git a/tools/net/ynl/samples/netdev.c b/tools/net/ynl/samples/netdev.c > index b828225daad0..da7c2848f773 100644 > --- a/tools/net/ynl/samples/netdev.c > +++ b/tools/net/ynl/samples/netdev.c > @@ -44,6 +44,12 @@ static void netdev_print_device(struct netdev_dev_get_rsp *d, unsigned int op) > printf(" %s", netdev_xdp_rx_metadata_str(1 << i)); > } > > + printf(" xsk-features (%llx):", d->xsk_features); > + for (int i = 0; d->xsk_features > 1U << i; i++) { Shouldn't this be >= ? > + if (d->xsk_features & (1U << i)) > + printf(" %s", netdev_xsk_flags_str(1 << i)); > + }
On 10/20, Jakub Kicinski wrote: > On Thu, 19 Oct 2023 10:49:36 -0700 Stanislav Fomichev wrote: > > Regenerate the userspace specs and print xsk-features bitmask. > > I'm afraid you regenerated in previous patch already :] > Perhaps we should add an easy-to-use flag to ynl-regen to skip tools/ ? Oops, leftover :-( I do find it useful that we now regenerate everything, so not sure the flag is needed (I'm probably missing the intent). I hope we eventually can drop those generated files altogether from the tree and generate everything during the build. > > diff --git a/tools/net/ynl/samples/netdev.c b/tools/net/ynl/samples/netdev.c > > index b828225daad0..da7c2848f773 100644 > > --- a/tools/net/ynl/samples/netdev.c > > +++ b/tools/net/ynl/samples/netdev.c > > @@ -44,6 +44,12 @@ static void netdev_print_device(struct netdev_dev_get_rsp *d, unsigned int op) > > printf(" %s", netdev_xdp_rx_metadata_str(1 << i)); > > } > > > > + printf(" xsk-features (%llx):", d->xsk_features); > > + for (int i = 0; d->xsk_features > 1U << i; i++) { > > Shouldn't this be >= ? Oh, good catch, will fix the other ones as well. But this is subtle and still mostly works during my tests. For bits 1 and 2 we get 3 and 'd->xsk_features > 1U << i' is always true for both 1 and 2.
diff --git a/tools/net/ynl/samples/netdev.c b/tools/net/ynl/samples/netdev.c index b828225daad0..da7c2848f773 100644 --- a/tools/net/ynl/samples/netdev.c +++ b/tools/net/ynl/samples/netdev.c @@ -44,6 +44,12 @@ static void netdev_print_device(struct netdev_dev_get_rsp *d, unsigned int op) printf(" %s", netdev_xdp_rx_metadata_str(1 << i)); } + printf(" xsk-features (%llx):", d->xsk_features); + for (int i = 0; d->xsk_features > 1U << i; i++) { + if (d->xsk_features & (1U << i)) + printf(" %s", netdev_xsk_flags_str(1 << i)); + } + printf(" xdp-zc-max-segs=%u", d->xdp_zc_max_segs); name = netdev_op_str(op);
Regenerate the userspace specs and print xsk-features bitmask. Signed-off-by: Stanislav Fomichev <sdf@google.com> --- tools/net/ynl/samples/netdev.c | 6 ++++++ 1 file changed, 6 insertions(+)