[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izMingYgf_ZuGWZMFNb3QGGkqKFjYwWvFpdbLW5yBWvvng@mail.gmail.com>
Date: Fri, 1 Nov 2024 07:35:36 -0700
From: Mina Almasry <almasrymina@...gle.com>
To: Taehee Yoo <ap420073@...il.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, donald.hunter@...il.com, corbet@....net,
michael.chan@...adcom.com, andrew+netdev@...n.ch, hawk@...nel.org,
ilias.apalodimas@...aro.org, ast@...nel.org, daniel@...earbox.net,
john.fastabend@...il.com, dw@...idwei.uk, sdf@...ichev.me,
asml.silence@...il.com, brett.creeley@....com, linux-doc@...r.kernel.org,
netdev@...r.kernel.org, kory.maincent@...tlin.com,
maxime.chevallier@...tlin.com, danieller@...dia.com, hengqi@...ux.alibaba.com,
ecree.xilinx@...il.com, przemyslaw.kitszel@...el.com, hkallweit1@...il.com,
ahmed.zaki@...el.com, rrameshbabu@...dia.com, idosch@...dia.com,
jiri@...nulli.us, bigeasy@...utronix.de, lorenzo@...nel.org,
jdamato@...tly.com, aleksander.lobakin@...el.com, kaiyuanz@...gle.com,
willemb@...gle.com, daniel.zahka@...il.com
Subject: Re: [PATCH net-next v4 6/8] net: ethtool: add ring parameter filtering
On Tue, Oct 22, 2024 at 9:25 AM Taehee Yoo <ap420073@...il.com> wrote:
>
> While the devmem is running, the tcp-data-split and
> header-data-split-thresh configuration should not be changed.
> If user tries to change tcp-data-split and threshold value while the
> devmem is running, it fails and shows extack message.
>
> Tested-by: Stanislav Fomichev <sdf@...ichev.me>
> Signed-off-by: Taehee Yoo <ap420073@...il.com>
> ---
>
> v4:
> - Add netdev_devmem_enabled() helper.
> - Add Test tag from Stanislav.
>
> v3:
> - Patch added
>
> include/net/netdev_rx_queue.h | 14 ++++++++++++++
> net/ethtool/common.h | 1 +
> net/ethtool/rings.c | 13 +++++++++++++
> 3 files changed, 28 insertions(+)
>
> diff --git a/include/net/netdev_rx_queue.h b/include/net/netdev_rx_queue.h
> index 596836abf7bf..7fbb64ce8d89 100644
> --- a/include/net/netdev_rx_queue.h
> +++ b/include/net/netdev_rx_queue.h
> @@ -55,6 +55,20 @@ get_netdev_rx_queue_index(struct netdev_rx_queue *queue)
> return index;
> }
>
> +static inline bool netdev_devmem_enabled(struct net_device *dev)
Mega nit: netdev_memory_provider_enabled().
This is actually not devmem specific, and there is already an io_uring
provider in the works.
But, also, we already have dev_get_min_mp_channel_count() defined in
linux/netdevice.h. Lets re-use that one instead of adding another
helper that does almost the same thing. Sorry, I should have
remembered we already have this helper in the last iteration.
Other than that, looks fine to me.
> +{
> + struct netdev_rx_queue *queue;
> + int i;
> +
> + for (i = 0; i < dev->real_num_rx_queues; i++) {
> + queue = __netif_get_rx_queue(dev, i);
> + if (queue->mp_params.mp_priv)
> + return true;
> + }
> +
> + return false;
> +}
> +
> int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq);
>
> #endif
> diff --git a/net/ethtool/common.h b/net/ethtool/common.h
> index 4a2de3ce7354..5b8e5847ba3c 100644
> --- a/net/ethtool/common.h
> +++ b/net/ethtool/common.h
> @@ -5,6 +5,7 @@
>
> #include <linux/netdevice.h>
> #include <linux/ethtool.h>
> +#include <net/netdev_rx_queue.h>
>
> #define ETHTOOL_DEV_FEATURE_WORDS DIV_ROUND_UP(NETDEV_FEATURE_COUNT, 32)
>
> diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
> index e1fd82a91014..ca313c301081 100644
> --- a/net/ethtool/rings.c
> +++ b/net/ethtool/rings.c
> @@ -258,6 +258,19 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
> return -ERANGE;
> }
>
> + if (netdev_devmem_enabled(dev)) {
> + if (kernel_ringparam.tcp_data_split !=
> + ETHTOOL_TCP_DATA_SPLIT_ENABLED) {
> + NL_SET_ERR_MSG(info->extack,
> + "tcp-data-split should be enabled while devmem is running");
Maybe: "can't disable tcp-data-split while device has memory provider enabled"
> + return -EINVAL;
> + } else if (kernel_ringparam.hds_thresh) {
> + NL_SET_ERR_MSG(info->extack,
> + "header-data-split-thresh should be zero while devmem is running");
Maybe: "can't set non-zero hds_thresh while device is memory provider enabled".
--
Thanks,
Mina
Powered by blists - more mailing lists