netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ethtool: Don't check if RSS context exists in case of context 0
@ 2025-02-25  7:13 Gal Pressman
  2025-02-25 16:35 ` Joe Damato
  2025-02-26  1:01 ` Jakub Kicinski
  0 siblings, 2 replies; 16+ messages in thread
From: Gal Pressman @ 2025-02-25  7:13 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, netdev
  Cc: Andrew Lunn, Simon Horman, Joe Damato, Gal Pressman, Tariq Toukan

Context 0 (default context) always exists, there is no need to check
whether it exists or not when adding a flow steering rule.

The existing check fails when creating a flow steering rule for context
0 as it is not stored in the rss_ctx xarray.

For example:
$ ethtool --config-ntuple eth2 flow-type tcp4 dst-ip 194.237.147.23 dst-port 19983 context 0 loc 618
rmgr: Cannot insert RX class rule: Invalid argument
Cannot insert classification rule

Fixes: de7f7582dff2 ("net: ethtool: prevent flow steering to RSS contexts which don't exist")
Cc: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
 net/ethtool/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 98b7dcea207a..0be7a622dddf 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -998,7 +998,8 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
 		    ethtool_get_flow_spec_ring(info.fs.ring_cookie))
 			return -EINVAL;
 
-		if (!xa_load(&dev->ethtool->rss_ctx, info.rss_context))
+		if (info.rss_context &&
+		    !xa_load(&dev->ethtool->rss_ctx, info.rss_context))
 			return -EINVAL;
 	}
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-03-04 11:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25  7:13 [PATCH net-next] net: ethtool: Don't check if RSS context exists in case of context 0 Gal Pressman
2025-02-25 16:35 ` Joe Damato
2025-02-26  1:01 ` Jakub Kicinski
2025-02-26  6:08   ` Gal Pressman
2025-02-27  2:27     ` Jakub Kicinski
2025-02-27  4:45       ` Jakub Kicinski
2025-02-27 15:18         ` Edward Cree
2025-02-27 15:29           ` Jakub Kicinski
2025-02-27 16:24             ` Edward Cree
2025-02-27 16:56               ` Jakub Kicinski
2025-02-27 19:54                 ` Edward Cree
2025-03-02  9:55       ` Gal Pressman
2025-03-03 22:17         ` Jakub Kicinski
2025-03-04 11:09           ` Gal Pressman
2025-03-04 11:27             ` Gal Pressman
2025-02-26 17:42   ` Joe Damato

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).