netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: mkubecek@suse.cz
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH ethtool-next] ethtool: rings: report TCP header-data split
Date: Tue, 29 Nov 2022 17:35:57 -0800	[thread overview]
Message-ID: <20221130013557.90739-1-kuba@kernel.org> (raw)

Report if device is in HDS compatible mode or not.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 netlink/rings.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/netlink/rings.c b/netlink/rings.c
index d50bbac47701..628403520f4a 100644
--- a/netlink/rings.c
+++ b/netlink/rings.c
@@ -20,6 +20,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	const struct nlattr *tb[ETHTOOL_A_RINGS_MAX + 1] = {};
 	DECLARE_ATTR_TB_INFO(tb);
 	struct nl_context *nlctx = data;
+	unsigned char tcp_hds;
 	bool silent;
 	int err_ret;
 	int ret;
@@ -50,6 +51,24 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	show_u32(tb[ETHTOOL_A_RINGS_CQE_SIZE], "CQE Size:\t\t");
 	show_bool("tx-push", "TX Push:\t%s\n", tb[ETHTOOL_A_RINGS_TX_PUSH]);
 
+	tcp_hds = tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT] ?
+		mnl_attr_get_u8(tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT]) : 0;
+	printf("TCP data split:\t");
+	switch (tcp_hds) {
+	case ETHTOOL_TCP_DATA_SPLIT_UNKNOWN:
+		printf("n/a\n");
+		break;
+	case ETHTOOL_TCP_DATA_SPLIT_DISABLED:
+		printf("off\n");
+		break;
+	case ETHTOOL_TCP_DATA_SPLIT_ENABLED:
+		printf("on\n");
+		break;
+	default:
+		printf("unknown(%d)\n", tcp_hds);
+		break;
+	}
+
 	return MNL_CB_OK;
 }
 
-- 
2.38.1


             reply	other threads:[~2022-11-30  1:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  1:35 Jakub Kicinski [this message]
2022-12-04 17:10 ` [PATCH ethtool-next] ethtool: rings: report TCP header-data split 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

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

  git send-email \
    --in-reply-to=20221130013557.90739-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).