Skip to content

Commit 4f5a52a

Browse files
gal-pressmanPaolo Abeni
authored andcommitted
ethtool: Fix set RXNFC command with symmetric RSS hash
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 <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Gal Pressman <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Reviewed-by: Edward Cree <[email protected]> Reviewed-by: Ahmed Zaki <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent e091043 commit 4f5a52a

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
@@ -998,7 +998,7 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
998998
ethtool_get_flow_spec_ring(info.fs.ring_cookie))
999999
return -EINVAL;
10001000

1001-
if (ops->get_rxfh) {
1001+
if (cmd == ETHTOOL_SRXFH && ops->get_rxfh) {
10021002
struct ethtool_rxfh_param rxfh = {};
10031003

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

0 commit comments

Comments
 (0)