aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorSamiullah Khawaja <[email protected]>2025-07-23 01:30:30 +0000
committerJakub Kicinski <[email protected]>2025-07-25 01:34:55 +0000
commit78afdadafe6fe0c74c08fda156e7be0a0b402b90 (patch)
tree50ed59524c68cb20ee0d60a6196b49feacd7b028 /net/core/dev.c
parentnet: Create separate gro_flush_normal function (diff)
downloadkernel-78afdadafe6fe0c74c08fda156e7be0a0b402b90.tar.gz
kernel-78afdadafe6fe0c74c08fda156e7be0a0b402b90.zip
net: Use netif_threaded_enable instead of netif_set_threaded in drivers
Prepare for adding an enum type for NAPI threaded states by adding netif_threaded_enable API. De-export the existing netif_set_threaded API and only use it internally. Update existing drivers to use netif_threaded_enable instead of the de-exported netif_set_threaded. Note that dev_set_threaded used by mt76 debugfs file is unchanged. Signed-off-by: Samiullah Khawaja <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 76384b8a7871..f28661d6f5ea 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7029,7 +7029,23 @@ int netif_set_threaded(struct net_device *dev, bool threaded)
return err;
}
-EXPORT_SYMBOL(netif_set_threaded);
+
+/**
+ * netif_threaded_enable() - enable threaded NAPIs
+ * @dev: net_device instance
+ *
+ * Enable threaded mode for the NAPI instances of the device. This may be useful
+ * for devices where multiple NAPI instances get scheduled by a single
+ * interrupt. Threaded NAPI allows moving the NAPI processing to cores other
+ * than the core where IRQ is mapped.
+ *
+ * This function should be called before @dev is registered.
+ */
+void netif_threaded_enable(struct net_device *dev)
+{
+ WARN_ON_ONCE(netif_set_threaded(dev, true));
+}
+EXPORT_SYMBOL(netif_threaded_enable);
/**
* netif_queue_set_napi - Associate queue with the napi