Skip to content

Commit 88b8fd9

Browse files
committed
Merge branch 'bug-fixes-for-rss-symmetric-xor'
Ahmed Zaki says: ==================== Bug fixes for RSS symmetric-xor A couple of fixes for the symmetric-xor recently merged in net-next [1]. The first patch copies the xfrm value back to user-space when ethtool is built with --disable-netlink. The second allows ethtool to change other RSS attributes while not changing the xfrm values. Link: https://lore.kernel.org/netdev/[email protected]/ [1] ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 8dc4c41 + 0dd415d commit 88b8fd9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,11 @@ static noinline_for_stack int ethtool_get_rxfh(struct net_device *dev,
12511251
if (copy_to_user(useraddr + offsetof(struct ethtool_rxfh, hfunc),
12521252
&rxfh_dev.hfunc, sizeof(rxfh.hfunc))) {
12531253
ret = -EFAULT;
1254+
} else if (copy_to_user(useraddr +
1255+
offsetof(struct ethtool_rxfh, input_xfrm),
1256+
&rxfh_dev.input_xfrm,
1257+
sizeof(rxfh.input_xfrm))) {
1258+
ret = -EFAULT;
12541259
} else if (copy_to_user(useraddr +
12551260
offsetof(struct ethtool_rxfh, rss_config[0]),
12561261
rss_config, total_size)) {
@@ -1299,14 +1304,16 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
12991304
return -EOPNOTSUPP;
13001305

13011306
/* If either indir, hash key or function is valid, proceed further.
1302-
* 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.
13031309
*/
13041310
if ((rxfh.indir_size &&
13051311
rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE &&
13061312
rxfh.indir_size != dev_indir_size) ||
13071313
(rxfh.key_size && (rxfh.key_size != dev_key_size)) ||
13081314
(rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE &&
1309-
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))
13101317
return -EINVAL;
13111318

13121319
if (rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE)

0 commit comments

Comments
 (0)