[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd750653950673fb2a4bc1fe496ddb24cca87619.1760364551.git.asml.silence@gmail.com>
Date: Mon, 13 Oct 2025 15:54:09 +0100
From: Pavel Begunkov <asml.silence@...il.com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Jakub Kicinski <kuba@...nel.org>,
davem@...emloft.net,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Donald Hunter <donald.hunter@...il.com>,
Michael Chan <michael.chan@...adcom.com>,
Pavan Chebbi <pavan.chebbi@...adcom.com>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Stanislav Fomichev <sdf@...ichev.me>,
Joshua Washington <joshwash@...gle.com>,
Harshitha Ramamurthy <hramamurthy@...gle.com>,
Jian Shen <shenjian15@...wei.com>,
Salil Mehta <salil.mehta@...wei.com>,
Jijie Shao <shaojijie@...wei.com>,
Sunil Goutham <sgoutham@...vell.com>,
Geetha sowjanya <gakula@...vell.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
hariprasad <hkelam@...vell.com>,
Bharat Bhushan <bbhushan2@...vell.com>,
Saeed Mahameed <saeedm@...dia.com>,
Tariq Toukan <tariqt@...dia.com>,
Mark Bloch <mbloch@...dia.com>,
Leon Romanovsky <leon@...nel.org>,
Alexander Duyck <alexanderduyck@...com>,
kernel-team@...a.com,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Joe Damato <joe@...a.to>,
David Wei <dw@...idwei.uk>,
Willem de Bruijn <willemb@...gle.com>,
Mina Almasry <almasrymina@...gle.com>,
Pavel Begunkov <asml.silence@...il.com>,
Breno Leitao <leitao@...ian.org>,
Dragos Tatulea <dtatulea@...dia.com>,
linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-rdma@...r.kernel.org,
Jonathan Corbet <corbet@....net>
Subject: [PATCH net-next v4 07/24] net: add rx_buf_len to netdev config
From: Jakub Kicinski <kuba@...nel.org>
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>
Reviewed-by: Mina Almasry <almasrymina@...gle.com>
Signed-off-by: Pavel Begunkov <asml.silence@...il.com>
---
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 9d5dde36c2e5..31559f2711de 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -25,6 +25,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 eeb257d9ab48..2f05359d9782 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -909,6 +909,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