Skip to content

Commit 0dd415d

Browse files
azaki1kuba-moo
authored andcommitted
net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm
Add a NO_CHANGE uAPI value for the new RXFH/RSS input_xfrm uAPI field. This needed so that user-space can set other RSS values (hkey or indir table) without affecting input_xfrm. Should have been part of [1]. Link: https://lore.kernel.org/netdev/[email protected]/ [1] Fixes: 13e5934 ("net: ethtool: add support for symmetric-xor RSS hash") Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Ahmed Zaki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7c402f7 commit 0dd415d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

include/uapi/linux/ethtool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,6 +2002,7 @@ static inline int ethtool_validate_duplex(__u8 duplex)
20022002
* be exploited to reduce the RSS queue spread.
20032003
*/
20042004
#define RXH_XFRM_SYM_XOR (1 << 0)
2005+
#define RXH_XFRM_NO_CHANGE 0xff
20052006

20062007
/* L2-L4 network traffic flow types */
20072008
#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */

net/ethtool/ioctl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,14 +1304,16 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
13041304
return -EOPNOTSUPP;
13051305

13061306
/* If either indir, hash key or function is valid, proceed further.
1307-
* Must request at least one change: indir size, hash key or function.
1307+
* Must request at least one change: indir size, hash key, function
1308+
* or input transformation.
13081309
*/
13091310
if ((rxfh.indir_size &&
13101311
rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE &&
13111312
rxfh.indir_size != dev_indir_size) ||
13121313
(rxfh.key_size && (rxfh.key_size != dev_key_size)) ||
13131314
(rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE &&
1314-
rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE))
1315+
rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE &&
1316+
rxfh.input_xfrm == RXH_XFRM_NO_CHANGE))
13151317
return -EINVAL;
13161318

13171319
if (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE)

0 commit comments

Comments
 (0)