summaryrefslogtreecommitdiff
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2024-06-27 16:33:51 +0100
committerJakub Kicinski <kuba@kernel.org>2024-06-28 18:53:21 -0700
commit87925151191b64d9623e63ccf11e517eacc99d7d (patch)
tree4e4c6614bd25cbc859f6f870a517085a3c63318e /include/linux/ethtool.h
parent30a32cdf6b130356805b3193a6208de25cbb2015 (diff)
net: ethtool: add a mutex protecting RSS contexts
While this is not needed to serialise the ethtool entry points (which are all under RTNL), drivers may have cause to asynchronously access dev->ethtool->rss_ctx; taking dev->ethtool->rss_lock allows them to do this safely without needing to take the RTNL. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/7f9c15eb7525bf87af62c275dde3a8570ee8bf0a.1719502240.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9cdbc8e3ed5c..f74bb0cf8ed1 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -1104,10 +1104,13 @@ int ethtool_virtdev_set_link_ksettings(struct net_device *dev,
/**
* struct ethtool_netdev_state - per-netdevice state for ethtool features
* @rss_ctx: XArray of custom RSS contexts
+ * @rss_lock: Protects entries in @rss_ctx. May be taken from
+ * within RTNL.
* @wol_enabled: Wake-on-LAN is enabled
*/
struct ethtool_netdev_state {
struct xarray rss_ctx;
+ struct mutex rss_lock;
unsigned wol_enabled:1;
};