summaryrefslogtreecommitdiff
path: root/net/ethtool/common.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-06-26 13:28:48 -0700
committerJakub Kicinski <kuba@kernel.org>2025-06-30 08:41:25 -0700
commit040cef30b5e67271e3193e0206f82b206fc97095 (patch)
tree9904df6952d0f6cbfcdb511350606348aa9672ce /net/ethtool/common.c
parent739d18cce105ce3c8437ad56bec3fbe62f0210bb (diff)
net: ethtool: move get_rxfh callback under the rss_lock
We already call get_rxfh under the rss_lock when we read back context state after changes. Let's be consistent and always hold the lock. The existing callers are all under rtnl_lock so this should make no difference in practice, but it makes the locking rules far less confusing IMHO. Any RSS callback and any access to the RSS XArray should hold the lock. Link: https://patch.msgid.link/20250626202848.104457-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool/common.c')
-rw-r--r--net/ethtool/common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index eb253e0fd61b..d62dc56f2f5b 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -707,7 +707,9 @@ static u32 ethtool_get_max_rxfh_channel(struct net_device *dev)
if (!rxfh.indir)
return U32_MAX;
+ mutex_lock(&dev->ethtool->rss_lock);
ret = dev->ethtool_ops->get_rxfh(dev, &rxfh);
+ mutex_unlock(&dev->ethtool->rss_lock);
if (ret) {
current_max = U32_MAX;
goto out_free;