lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izMjxvgMwh5MzwDKDw1wy7b_Eyua=LOrB1Kn6wFhcxE5bg@mail.gmail.com>
Date: Thu, 3 Oct 2024 11:32:53 -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, netdev@...r.kernel.org, linux-doc@...r.kernel.org, 
	donald.hunter@...il.com, corbet@....net, michael.chan@...adcom.com, 
	kory.maincent@...tlin.com, andrew@...n.ch, 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, 
	paul.greenwalt@...el.com, rrameshbabu@...dia.com, idosch@...dia.com, 
	asml.silence@...il.com, kaiyuanz@...gle.com, willemb@...gle.com, 
	aleksander.lobakin@...el.com, dw@...idwei.uk, sridhar.samudrala@...el.com, 
	bcreeley@....com
Subject: Re: [PATCH net-next v3 6/7] net: ethtool: add ring parameter filtering

On Thu, Oct 3, 2024 at 9:07 AM Taehee Yoo <ap420073@...il.com> wrote:
>
> While the devmem is running, the tcp-data-split and
> tcp-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.
>
> Signed-off-by: Taehee Yoo <ap420073@...il.com>
> ---
>
> v3:
>  - Patch added
>
>  net/ethtool/common.h |  1 +
>  net/ethtool/rings.c  | 15 ++++++++++++++-
>  2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/net/ethtool/common.h b/net/ethtool/common.h
> index d55d5201b085..beebd4db3e10 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 c7824515857f..0afc6b29a229 100644
> --- a/net/ethtool/rings.c
> +++ b/net/ethtool/rings.c
> @@ -216,7 +216,8 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
>         bool mod = false, thresh_mod = false;
>         struct nlattr **tb = info->attrs;
>         const struct nlattr *err_attr;
> -       int ret;
> +       struct netdev_rx_queue *rxq;
> +       int ret, i;
>
>         dev->ethtool_ops->get_ringparam(dev, &ringparam,
>                                         &kernel_ringparam, info->extack);
> @@ -263,6 +264,18 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)
>                 return -EINVAL;
>         }
>
> +       if (kernel_ringparam.tcp_data_split != ETHTOOL_TCP_DATA_SPLIT_ENABLED ||
> +           kernel_ringparam.tcp_data_split_thresh) {
> +               for (i = 0; i < dev->real_num_rx_queues; i++) {
> +                       rxq = __netif_get_rx_queue(dev, i);
> +                       if (rxq->mp_params.mp_priv) {
> +                               NL_SET_ERR_MSG(info->extack,
> +                                              "tcp-header-data-split is disabled or threshold is not zero");
> +                               return -EINVAL;
> +                       }

Probably worth adding a helper for this. I think the same loop is
checked in a few places.

Other than that, yes, this looks good to me.


-- 
Thanks,
Mina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ