Skip to content

Commit

Permalink
tools: ynl: Print xsk-features from the sample
Browse files Browse the repository at this point in the history
In a similar fashion we do for the other bit masks.
Fix mask parsing (>= vs >) while we are it.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20231127190319.1190813-4-sdf@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Stanislav Fomichev authored and Alexei Starovoitov committed Nov 29, 2023
1 parent 48eb03d commit 9276009
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/net/ynl/samples/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,23 @@ static void netdev_print_device(struct netdev_dev_get_rsp *d, unsigned int op)
return;

printf("xdp-features (%llx):", d->xdp_features);
for (int i = 0; d->xdp_features > 1U << i; i++) {
for (int i = 0; d->xdp_features >= 1U << i; i++) {
if (d->xdp_features & (1U << i))
printf(" %s", netdev_xdp_act_str(1 << i));
}

printf(" xdp-rx-metadata-features (%llx):", d->xdp_rx_metadata_features);
for (int i = 0; d->xdp_rx_metadata_features > 1U << i; i++) {
for (int i = 0; d->xdp_rx_metadata_features >= 1U << i; i++) {
if (d->xdp_rx_metadata_features & (1U << i))
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);
Expand Down

0 comments on commit 9276009

Please sign in to comment.