[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250421222827.283737-6-kuba@kernel.org>
Date: Mon, 21 Apr 2025 15:28:10 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
andrew+netdev@...n.ch,
horms@...nel.org,
donald.hunter@...il.com,
sdf@...ichev.me,
almasrymina@...gle.com,
dw@...idwei.uk,
asml.silence@...il.com,
ap420073@...il.com,
jdamato@...tly.com,
dtatulea@...dia.com,
michael.chan@...adcom.com,
Jakub Kicinski <kuba@...nel.org>
Subject: [RFC net-next 05/22] net: add rx_buf_len to netdev config
Add rx_buf_len to configuration maintained by the core.
Use "three-state" semantics where 0 means "driver default".
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
include/net/netdev_queues.h | 4 ++++
net/ethtool/common.c | 1 +
net/ethtool/rings.c | 2 ++
3 files changed, 7 insertions(+)
diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index f4eab6fc64f4..a9ee147dd914 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -24,6 +24,10 @@ struct netdev_config {
* If "unset" driver is free to decide, and may change its choice
* as other parameters change.
*/
+ /** @rx_buf_len: Size of buffers on the Rx ring
+ * (ETHTOOL_A_RINGS_RX_BUF_LEN).
+ */
+ u32 rx_buf_len;
/** @hds_config: HDS enabled (ETHTOOL_A_RINGS_TCP_DATA_SPLIT).
*/
u8 hds_config;
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 502392395d45..def6cb4270c2 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -832,6 +832,7 @@ void ethtool_ringparam_get_cfg(struct net_device *dev,
/* Driver gives us current state, we want to return current config */
kparam->tcp_data_split = dev->cfg->hds_config;
+ kparam->rx_buf_len = dev->cfg->rx_buf_len;
}
static void ethtool_init_tsinfo(struct kernel_ethtool_ts_info *info)
diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
index 628546a1827b..6a74e7e4064e 100644
--- a/net/ethtool/rings.c
+++ b/net/ethtool/rings.c
@@ -41,6 +41,7 @@ static int rings_prepare_data(const struct ethnl_req_info *req_base,
return ret;
data->kernel_ringparam.tcp_data_split = dev->cfg->hds_config;
+ data->kernel_ringparam.rx_buf_len = dev->cfg->rx_buf_len;
data->kernel_ringparam.hds_thresh = dev->cfg->hds_thresh;
dev->ethtool_ops->get_ringparam(dev, &data->ringparam,
@@ -302,6 +303,7 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
return -EINVAL;
}
+ dev->cfg_pending->rx_buf_len = kernel_ringparam.rx_buf_len;
dev->cfg_pending->hds_config = kernel_ringparam.tcp_data_split;
dev->cfg_pending->hds_thresh = kernel_ringparam.hds_thresh;
--
2.49.0
Powered by blists - more mailing lists