summaryrefslogtreecommitdiffstats
path: root/net/ethtool
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-01-03 01:00:08 +0100
committerJakub Kicinski <kuba@kernel.org>2024-01-03 01:00:08 +0100
commit88b8fd9770896231791ad0026d8dddde537d3c82 (patch)
tree072e3a8ebcc9d8297531f4b75d509a8d6323926c /net/ethtool
parentxsk: make struct xsk_cb_desc available outside CONFIG_XDP_SOCKETS (diff)
parentnet: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm (diff)
downloadlinux-88b8fd9770896231791ad0026d8dddde537d3c82.tar.xz
linux-88b8fd9770896231791ad0026d8dddde537d3c82.zip
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/20231213003321.605376-1-ahmed.zaki@intel.com/ [1] ==================== Link: https://lore.kernel.org/r/20231221184235.9192-1-ahmed.zaki@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool')
-rw-r--r--net/ethtool/ioctl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 86d47425038b..4c4f46dfc251 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1252,6 +1252,11 @@ static noinline_for_stack int ethtool_get_rxfh(struct net_device *dev,
&rxfh_dev.hfunc, sizeof(rxfh.hfunc))) {
ret = -EFAULT;
} else if (copy_to_user(useraddr +
+ offsetof(struct ethtool_rxfh, input_xfrm),
+ &rxfh_dev.input_xfrm,
+ sizeof(rxfh.input_xfrm))) {
+ ret = -EFAULT;
+ } else if (copy_to_user(useraddr +
offsetof(struct ethtool_rxfh, rss_config[0]),
rss_config, total_size)) {
ret = -EFAULT;
@@ -1299,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)