Skip to content

Commit 503757c

Browse files
Saeed Mahameedkuba-moo
authored andcommitted
net: ethtool: Fix RSS setting
When user submits a rxfh set command without touching XFRM_SYM_XOR, rxfh.input_xfrm is set to RXH_XFRM_NO_CHANGE, which is equal to 0xff. Testing if (rxfh.input_xfrm & RXH_XFRM_SYM_XOR && !ops->cap_rss_sym_xor_supported) return -EOPNOTSUPP; Will always be true on devices that don't set cap_rss_sym_xor_supported, since rxfh.input_xfrm & RXH_XFRM_SYM_XOR is always true, if input_xfrm was not set, i.e RXH_XFRM_NO_CHANGE=0xff, which will result in failure of any command that doesn't require any change of XFRM, e.g RSS context or hash function changes. To avoid this breakage, test if rxfh.input_xfrm != RXH_XFRM_NO_CHANGE before testing other conditions. Note that the problem will only trigger with XFRM-aware userspace, old ethtool CLI would continue to work. Fixes: 0dd415d ("net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm") Signed-off-by: Saeed Mahameed <[email protected]> Reviewed-by: Ahmed Zaki <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 51df8e0 commit 503757c

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
@@ -1306,7 +1306,8 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
13061306
if (rxfh.input_xfrm && rxfh.input_xfrm != RXH_XFRM_SYM_XOR &&
13071307
rxfh.input_xfrm != RXH_XFRM_NO_CHANGE)
13081308
return -EINVAL;
1309-
if ((rxfh.input_xfrm & RXH_XFRM_SYM_XOR) &&
1309+
if (rxfh.input_xfrm != RXH_XFRM_NO_CHANGE &&
1310+
(rxfh.input_xfrm & RXH_XFRM_SYM_XOR) &&
13101311
!ops->cap_rss_sym_xor_supported)
13111312
return -EOPNOTSUPP;
13121313

0 commit comments

Comments
 (0)