XDP hardware hints discussion mail archive
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, song@kernel.org, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com,
	haoluo@google.com, jolsa@kernel.org, kuba@kernel.org,
	toke@kernel.org, willemb@google.com, dsahern@kernel.org,
	magnus.karlsson@intel.com, bjorn@kernel.org,
	maciej.fijalkowski@intel.com, hawk@kernel.org,
	yoong.siang.song@intel.com, netdev@vger.kernel.org,
	xdp-hints@xdp-project.net
Subject: [xdp-hints] [PATCH bpf-next v6 03/13] tools: ynl: Print xsk-features from the sample
Date: Mon, 27 Nov 2023 11:03:09 -0800	[thread overview]
Message-ID: <20231127190319.1190813-4-sdf@google.com> (raw)
In-Reply-To: <20231127190319.1190813-1-sdf@google.com>

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>
---
 tools/net/ynl/samples/netdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/net/ynl/samples/netdev.c b/tools/net/ynl/samples/netdev.c
index b828225daad0..591b90e21890 100644
--- a/tools/net/ynl/samples/netdev.c
+++ b/tools/net/ynl/samples/netdev.c
@@ -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);
-- 
2.43.0.rc1.413.gea7ed67945-goog


  parent reply	other threads:[~2023-11-27 19:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 19:03 [xdp-hints] [PATCH bpf-next v6 00/13] xsk: TX metadata Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 01/13] xsk: Support tx_metadata_len Stanislav Fomichev
2023-11-28  3:09   ` [xdp-hints] " Jakub Kicinski
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 02/13] xsk: Add TX timestamp and TX checksum offload support Stanislav Fomichev
2023-11-29 16:49   ` [xdp-hints] " Jakub Kicinski
2023-11-27 19:03 ` Stanislav Fomichev [this message]
2023-11-29 16:47   ` [xdp-hints] Re: [PATCH bpf-next v6 03/13] tools: ynl: Print xsk-features from the sample Jakub Kicinski
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 04/13] net/mlx5e: Implement AF_XDP TX timestamp and checksum offload Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 05/13] net: stmmac: Add Tx HWTS support to XDP ZC Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 06/13] xsk: Document tx_metadata_len layout Stanislav Fomichev
2023-12-02 17:09   ` [xdp-hints] " Simon Horman
2023-12-04 16:48     ` Stanislav Fomichev
2023-12-07 10:47       ` Simon Horman
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 07/13] xsk: Validate xsk_tx_metadata flags Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 08/13] xsk: Add option to calculate TX checksum in SW Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 09/13] selftests/xsk: Support tx_metadata_len Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 10/13] selftests/bpf: Add csum helpers Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 11/13] selftests/bpf: Add TX side to xdp_metadata Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 12/13] selftests/bpf: Convert xdp_hw_metadata to XDP_USE_NEED_WAKEUP Stanislav Fomichev
2023-11-27 19:03 ` [xdp-hints] [PATCH bpf-next v6 13/13] selftests/bpf: Add TX side to xdp_hw_metadata Stanislav Fomichev
2023-11-29 23:10 ` [xdp-hints] Re: [PATCH bpf-next v6 00/13] xsk: TX metadata patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.xdp-project.net/postorius/lists/xdp-hints.xdp-project.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231127190319.1190813-4-sdf@google.com \
    --to=sdf@google.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@kernel.org \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=toke@kernel.org \
    --cc=willemb@google.com \
    --cc=xdp-hints@xdp-project.net \
    --cc=yhs@fb.com \
    --cc=yoong.siang.song@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox