[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <de4a2a8a-1eb9-4fa8-af87-7526e58218e9@nvidia.com>
Date: Sun, 9 Feb 2025 10:17:30 +0200
From: Gal Pressman <gal@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
andrew+netdev@...n.ch, horms@...nel.org, ecree.xilinx@...il.com
Subject: Re: [PATCH net-next 1/7] net: ethtool: prevent flow steering to RSS
contexts which don't exist
On 07/02/2025 1:53, Jakub Kicinski wrote:
> Since commit 42dc431f5d0e ("ethtool: rss: prevent rss ctx deletion
> when in use") we prevent removal of RSS contexts pointed to by
Nit: I would try to avoid the line break in the middle of the cited commit.
> existing flow rules. Core should also prevent creation of rules
> which point to RSS context which don't exist in the first place.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> CC: ecree.xilinx@...il.com
> CC: gal@...dia.com
> ---
> net/ethtool/ioctl.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 7609ce2b2c5e..98b7dcea207a 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -993,10 +993,14 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
> return rc;
>
> /* Nonzero ring with RSS only makes sense if NIC adds them together */
This comment should be moved inside the if statement.
> - if (cmd == ETHTOOL_SRXCLSRLINS && info.fs.flow_type & FLOW_RSS &&
> - !ops->cap_rss_rxnfc_adds &&
> - ethtool_get_flow_spec_ring(info.fs.ring_cookie))
> - return -EINVAL;
> + if (cmd == ETHTOOL_SRXCLSRLINS && info.fs.flow_type & FLOW_RSS) {
> + if (!ops->cap_rss_rxnfc_adds &&
> + ethtool_get_flow_spec_ring(info.fs.ring_cookie))
> + return -EINVAL;
> +
> + if (!xa_load(&dev->ethtool->rss_ctx, info.rss_context))
Accessing rss_ctx without rss_lock?
> + return -EINVAL;
> + }
>
> if (cmd == ETHTOOL_SRXFH && ops->get_rxfh) {
> struct ethtool_rxfh_param rxfh = {};
Powered by blists - more mailing lists