Skip to content

Commit

Permalink
net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
azaki1 authored and kuba-moo committed Jan 3, 2024
1 parent 7c402f7 commit 0dd415d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/ethtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,7 @@ static inline int ethtool_validate_duplex(__u8 duplex)
* be exploited to reduce the RSS queue spread.
*/
#define RXH_XFRM_SYM_XOR (1 << 0)
#define RXH_XFRM_NO_CHANGE 0xff

/* L2-L4 network traffic flow types */
#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
Expand Down
6 changes: 4 additions & 2 deletions net/ethtool/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,14 +1304,16 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
return -EOPNOTSUPP;

/* If either indir, hash key or function is valid, proceed further.
* Must request at least one change: indir size, hash key or function.
* Must request at least one change: indir size, hash key, function
* or input transformation.
*/
if ((rxfh.indir_size &&
rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE &&
rxfh.indir_size != dev_indir_size) ||
(rxfh.key_size && (rxfh.key_size != dev_key_size)) ||
(rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE &&
rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE))
rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE &&
rxfh.input_xfrm == RXH_XFRM_NO_CHANGE))
return -EINVAL;

if (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE)
Expand Down

0 comments on commit 0dd415d

Please sign in to comment.