Skip to content

Commit 21cbe07

Browse files
gal-pressmanmehmetb0
authored andcommitted
ethtool: Fix set RXNFC command with symmetric RSS hash
BugLink: https://bugs.launchpad.net/bugs/2111953 [ Upstream commit 4f5a52a ] The sanity check that both source and destination are set when symmetric RSS hash is requested is only relevant for ETHTOOL_SRXFH (rx-flow-hash), it should not be performed on any other commands (e.g. ETHTOOL_SRXCLSRLINS/ETHTOOL_SRXCLSRLDEL). This resolves accessing uninitialized 'info.data' field, and fixes false errors in rule insertion: # ethtool --config-ntuple eth2 flow-type ip4 dst-ip 255.255.255.255 action -1 loc 0 rmgr: Cannot insert RX class rule: Invalid argument Cannot insert classification rule Fixes: 13e5934 ("net: ethtool: add support for symmetric-xor RSS hash") Cc: Ahmed Zaki <ahmed.zaki@intel.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Edward Cree <ecree.xilinx@gmail.com> Reviewed-by: Ahmed Zaki <ahmed.zaki@intel.com> Link: https://patch.msgid.link/20250126191845.316589-1-gal@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 236a10a commit 21cbe07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ethtool/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
992992
ethtool_get_flow_spec_ring(info.fs.ring_cookie))
993993
return -EINVAL;
994994

995-
if (ops->get_rxfh) {
995+
if (cmd == ETHTOOL_SRXFH && ops->get_rxfh) {
996996
struct ethtool_rxfh_param rxfh = {};
997997

998998
rc = ops->get_rxfh(dev, &rxfh);

0 commit comments

Comments
 (0)