Commit 2b91cc12 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

ethtool: ntuple: fix rss + ring_cookie check



The info.flow_type is for RXFH commands, ntuple flow_type is inside
the flow spec. The check currently does nothing, as info.flow_type
is 0 (or even uninitialized by user space) for ETHTOOL_SRXCLSRLINS.

Fixes: 9e43ad7a ("net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in")
Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
Reviewed-by: default avatarJoe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20250201013040.725123-3-kuba@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 244f8aa4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -993,7 +993,7 @@ 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 */
	if (cmd == ETHTOOL_SRXCLSRLINS && info.flow_type & FLOW_RSS &&
	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;