Skip to content

Commit 8ef047d

Browse files
committed
ethtool: Fix set RXNFC command with symmetric RSS hash
jira LE-4018 Rebuild_History Non-Buildable kernel-5.14.0-570.37.1.el9_6 commit-author Gal Pressman <gal@nvidia.com> commit 4f5a52a Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-5.14.0-570.37.1.el9_6/4f5a52ad.failed 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> (cherry picked from commit 4f5a52a) Signed-off-by: Jonathan Maple <jmaple@ciq.com> # Conflicts: # net/ethtool/ioctl.c
1 parent 1d74ccb commit 8ef047d

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
ethtool: Fix set RXNFC command with symmetric RSS hash
2+
3+
jira LE-4018
4+
Rebuild_History Non-Buildable kernel-5.14.0-570.37.1.el9_6
5+
commit-author Gal Pressman <gal@nvidia.com>
6+
commit 4f5a52adeb1ad675ca33f1e1eacd9c0bbaf393d4
7+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
8+
Will be included in final tarball splat. Ref for failed cherry-pick at:
9+
ciq/ciq_backports/kernel-5.14.0-570.37.1.el9_6/4f5a52ad.failed
10+
11+
The sanity check that both source and destination are set when symmetric
12+
RSS hash is requested is only relevant for ETHTOOL_SRXFH (rx-flow-hash),
13+
it should not be performed on any other commands (e.g.
14+
ETHTOOL_SRXCLSRLINS/ETHTOOL_SRXCLSRLDEL).
15+
16+
This resolves accessing uninitialized 'info.data' field, and fixes false
17+
errors in rule insertion:
18+
# ethtool --config-ntuple eth2 flow-type ip4 dst-ip 255.255.255.255 action -1 loc 0
19+
rmgr: Cannot insert RX class rule: Invalid argument
20+
Cannot insert classification rule
21+
22+
Fixes: 13e59344fb9d ("net: ethtool: add support for symmetric-xor RSS hash")
23+
Cc: Ahmed Zaki <ahmed.zaki@intel.com>
24+
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
25+
Signed-off-by: Gal Pressman <gal@nvidia.com>
26+
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
27+
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
28+
Reviewed-by: Ahmed Zaki <ahmed.zaki@intel.com>
29+
Link: https://patch.msgid.link/20250126191845.316589-1-gal@nvidia.com
30+
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
31+
32+
(cherry picked from commit 4f5a52adeb1ad675ca33f1e1eacd9c0bbaf393d4)
33+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
34+
35+
# Conflicts:
36+
# net/ethtool/ioctl.c
37+
diff --cc net/ethtool/ioctl.c
38+
index 65cfe76dafbe,34bee42e1247..000000000000
39+
--- a/net/ethtool/ioctl.c
40+
+++ b/net/ethtool/ioctl.c
41+
@@@ -992,7 -992,13 +992,17 @@@ static noinline_for_stack int ethtool_s
42+
if (rc)
43+
return rc;
44+
45+
++<<<<<<< HEAD
46+
+ if (ops->get_rxfh) {
47+
++=======
48+
+ /* Nonzero ring with RSS only makes sense if NIC adds them together */
49+
+ if (cmd == ETHTOOL_SRXCLSRLINS && info.flow_type & FLOW_RSS &&
50+
+ !ops->cap_rss_rxnfc_adds &&
51+
+ ethtool_get_flow_spec_ring(info.fs.ring_cookie))
52+
+ return -EINVAL;
53+
+
54+
+ if (cmd == ETHTOOL_SRXFH && ops->get_rxfh) {
55+
++>>>>>>> 4f5a52adeb1a (ethtool: Fix set RXNFC command with symmetric RSS hash)
56+
struct ethtool_rxfh_param rxfh = {};
57+
58+
rc = ops->get_rxfh(dev, &rxfh);
59+
* Unmerged path net/ethtool/ioctl.c

0 commit comments

Comments
 (0)