Skip to content

Commit adea874

Browse files
gal-pressmanSasha Levin
authored andcommitted
net: ethtool: Don't check if RSS context exists in case of context 0
[ Upstream commit d78ebc7 ] 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 An example usecase for this could be: - A high-priority rule (loc 0) directing specific port traffic to context 0. - A low-priority rule (loc 1) directing all other TCP traffic to context 1. This is a user-visible regression that was caught in our testing environment, it was not reported by a user yet. Fixes: de7f758 ("net: ethtool: prevent flow steering to RSS contexts which don't exist") Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Nimrod Oren <noren@nvidia.com> Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Edward Cree <ecree.xilinx@gmail.com> Link: https://patch.msgid.link/20250612071958.1696361-2-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4cca03f commit adea874

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ethtool/ioctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,8 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
10011001
ethtool_get_flow_spec_ring(info.fs.ring_cookie))
10021002
return -EINVAL;
10031003

1004-
if (!xa_load(&dev->ethtool->rss_ctx, info.rss_context))
1004+
if (info.rss_context &&
1005+
!xa_load(&dev->ethtool->rss_ctx, info.rss_context))
10051006
return -EINVAL;
10061007
}
10071008

0 commit comments

Comments
 (0)