From: Taehee Yoo <ap420073@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, almasrymina@google.com,
donald.hunter@gmail.com, corbet@lwn.net,
michael.chan@broadcom.com, andrew+netdev@lunn.ch,
hawk@kernel.org, ilias.apalodimas@linaro.org, ast@kernel.org,
daniel@iogearbox.net, john.fastabend@gmail.com, dw@davidwei.uk,
sdf@fomichev.me, asml.silence@gmail.com, brett.creeley@amd.com,
linux-doc@vger.kernel.org, netdev@vger.kernel.org
Cc: kory.maincent@bootlin.com, maxime.chevallier@bootlin.com,
danieller@nvidia.com, hengqi@linux.alibaba.com,
ecree.xilinx@gmail.com, przemyslaw.kitszel@intel.com,
hkallweit1@gmail.com, ahmed.zaki@intel.com,
rrameshbabu@nvidia.com, idosch@nvidia.com, jiri@resnulli.us,
bigeasy@linutronix.de, lorenzo@kernel.org, jdamato@fastly.com,
aleksander.lobakin@intel.com, kaiyuanz@google.com,
willemb@google.com, daniel.zahka@gmail.com, ap420073@gmail.com
Subject: [PATCH net-next v5 2/7] net: ethtool: add tcp_data_split_mod member in kernel_ethtool_ringparam
Date: Wed, 13 Nov 2024 17:32:16 +0000 [thread overview]
Message-ID: <20241113173222.372128-3-ap420073@gmail.com> (raw)
In-Reply-To: <20241113173222.372128-1-ap420073@gmail.com>
When tcp-data-split is UNKNOWN mode, drivers arbitrarily handle it.
For example, bnxt_en driver automatically enables if at least one of
LRO/GRO/JUMBO is enabled.
If tcp-data-split is UNKNOWN and LRO is enabled, a driver returns
ENABLES of tcp-data-split, not UNKNOWN.
So, `ethtool -g eth0` shows tcp-data-split is enabled.
The problem is in the setting situation.
In the ethnl_set_rings(), it first calls get_ringparam() to get the
current driver's config.
At that moment, if driver's tcp-data-split config is UNKNOWN, it returns
ENABLE if LRO/GRO/JUMBO is enabled.
Then, it sets values from the user and driver's current config to
kernel_ethtool_ringparam.
Last it calls .set_ringparam().
The driver, especially bnxt_en driver receives
ETHTOOL_TCP_DATA_SPLIT_ENABLED.
But it can't distinguish whether it is set by the user or just the
current config.
The new tcp_data_split_mod member indicates the tcp-data-split value is
explicitly set by the user.
So the driver can handle ETHTOOL_TCP_DATA_SPLIT_ENABLED properly.
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
v5:
- Patch added.
include/linux/ethtool.h | 2 ++
net/ethtool/rings.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 1199e308c8dd..ecd52b99a63a 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -73,6 +73,7 @@ enum {
* struct kernel_ethtool_ringparam - RX/TX ring configuration
* @rx_buf_len: Current length of buffers on the rx ring.
* @tcp_data_split: Scatter packet headers and data to separate buffers
+ * @tcp_data_split_mod: Updated tcp-data-split from user
* @tx_push: The flag of tx push mode
* @rx_push: The flag of rx push mode
* @cqe_size: Size of TX/RX completion queue event
@@ -82,6 +83,7 @@ enum {
struct kernel_ethtool_ringparam {
u32 rx_buf_len;
u8 tcp_data_split;
+ bool tcp_data_split_mod;
u8 tx_push;
u8 rx_push;
u32 cqe_size;
diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
index b7865a14fdf8..c12ebb61394d 100644
--- a/net/ethtool/rings.c
+++ b/net/ethtool/rings.c
@@ -250,6 +250,9 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
return -EINVAL;
}
+ if (tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT])
+ kernel_ringparam.tcp_data_split_mod = true;
+
ret = dev->ethtool_ops->set_ringparam(dev, &ringparam,
&kernel_ringparam, info->extack);
return ret < 0 ? ret : 1;
--
2.34.1
next prev parent reply other threads:[~2024-11-13 17:32 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 17:32 [PATCH net-next v5 0/7] bnxt_en: implement tcp-data-split and thresh option Taehee Yoo
2024-11-13 17:32 ` [PATCH net-next v5 1/7] bnxt_en: add support for rx-copybreak ethtool command Taehee Yoo
2024-11-14 22:54 ` Andy Gospodarek
2024-11-15 0:22 ` Michael Chan
2024-11-13 17:32 ` Taehee Yoo [this message]
2024-11-15 4:22 ` [PATCH net-next v5 2/7] net: ethtool: add tcp_data_split_mod member in kernel_ethtool_ringparam Jakub Kicinski
2024-11-15 17:17 ` Taehee Yoo
2024-11-15 20:07 ` Saeed Mahameed
2024-11-13 17:32 ` [PATCH net-next v5 3/7] bnxt_en: add support for tcp-data-split ethtool command Taehee Yoo
2024-11-14 22:54 ` Andy Gospodarek
2024-11-15 4:15 ` Jakub Kicinski
2024-11-15 17:12 ` Taehee Yoo
2024-11-13 17:32 ` [PATCH net-next v5 4/7] net: ethtool: add support for configuring header-data-split-thresh Taehee Yoo
2024-11-15 4:24 ` Jakub Kicinski
2024-11-15 18:05 ` Taehee Yoo
2024-11-15 19:18 ` Jakub Kicinski
2024-11-17 12:31 ` Taehee Yoo
2024-11-15 20:27 ` Saeed Mahameed
2024-11-17 14:26 ` Taehee Yoo
2024-11-13 17:32 ` [PATCH net-next v5 5/7] bnxt_en: add support for header-data-split-thresh ethtool command Taehee Yoo
2024-11-14 22:54 ` Andy Gospodarek
2024-11-15 0:27 ` Michael Chan
2024-11-15 16:18 ` Taehee Yoo
2024-11-13 17:32 ` [PATCH net-next v5 6/7] net: devmem: add ring parameter filtering Taehee Yoo
2024-11-13 17:32 ` [PATCH net-next v5 7/7] net: ethtool: " Taehee Yoo
2024-11-14 22:55 ` [PATCH net-next v5 0/7] bnxt_en: implement tcp-data-split and thresh option Andy Gospodarek
2024-12-17 16:30 ` Jakub Kicinski
2024-12-18 13:34 ` Taehee Yoo
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=20241113173222.372128-3-ap420073@gmail.com \
--to=ap420073@gmail.com \
--cc=ahmed.zaki@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=asml.silence@gmail.com \
--cc=ast@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=brett.creeley@amd.com \
--cc=corbet@lwn.net \
--cc=daniel.zahka@gmail.com \
--cc=daniel@iogearbox.net \
--cc=danieller@nvidia.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dw@davidwei.uk \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=hengqi@linux.alibaba.com \
--cc=hkallweit1@gmail.com \
--cc=idosch@nvidia.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jdamato@fastly.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=kaiyuanz@google.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rrameshbabu@nvidia.com \
--cc=sdf@fomichev.me \
--cc=willemb@google.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;
as well as URLs for NNTP newsgroup(s).