summaryrefslogtreecommitdiff
path: root/include/net/netdev_queues.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-04-08 12:59:55 -0700
committerJakub Kicinski <kuba@kernel.org>2025-04-09 17:01:52 -0700
commitce7b14947484e6190372f2c3dbfb69aafbc4c0fc (patch)
tree92629aa80020f1a3c58f50e897987cc12c6c070b /include/net/netdev_queues.h
parent87eba404f2e1785d410b51a31ff030932194e1c6 (diff)
netdev: depend on netdev->lock for qstats in ops locked drivers
We mostly needed rtnl_lock in qstat to make sure the queue count is stable while we work. For "ops locked" drivers the instance lock protects the queue count, so we don't have to take rtnl_lock. For currently ops-locked drivers: netdevsim and bnxt need the protection from netdev going down while we dump, which instance lock provides. gve doesn't care. Reviewed-by: Joe Damato <jdamato@fastly.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20250408195956.412733-9-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/netdev_queues.h')
-rw-r--r--include/net/netdev_queues.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index 825141d675e5..ea709b59d827 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -85,9 +85,11 @@ struct netdev_queue_stats_tx {
* for some of the events is not maintained, and reliable "total" cannot
* be provided).
*
+ * Ops are called under the instance lock if netdev_need_ops_lock()
+ * returns true, otherwise under rtnl_lock.
* Device drivers can assume that when collecting total device stats,
* the @get_base_stats and subsequent per-queue calls are performed
- * "atomically" (without releasing the rtnl_lock).
+ * "atomically" (without releasing the relevant lock).
*
* Device drivers are encouraged to reset the per-queue statistics when
* number of queues change. This is because the primary use case for