aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.h
diff options
context:
space:
mode:
authorSamiullah Khawaja <[email protected]>2025-07-23 01:30:31 +0000
committerJakub Kicinski <[email protected]>2025-07-25 01:34:55 +0000
commit8e7583a4f65f3dbf3e8deb4e60f3679c276bef62 (patch)
treed8223d0f701032f1979ed7cbbc2b6b8ad8407864 /net/core/dev.h
parentnet: Use netif_threaded_enable instead of netif_set_threaded in drivers (diff)
downloadkernel-8e7583a4f65f3dbf3e8deb4e60f3679c276bef62.tar.gz
kernel-8e7583a4f65f3dbf3e8deb4e60f3679c276bef62.zip
net: define an enum for the napi threaded state
Instead of using '0' and '1' for napi threaded state use an enum with 'disabled' and 'enabled' states. Tested: ./tools/testing/selftests/net/nl_netdev.py TAP version 13 1..7 ok 1 nl_netdev.empty_check ok 2 nl_netdev.lo_check ok 3 nl_netdev.page_pool_check ok 4 nl_netdev.napi_list_check ok 5 nl_netdev.dev_set_threaded ok 6 nl_netdev.napi_set_threaded ok 7 nl_netdev.nsim_rxq_reset_down # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0 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.h')
-rw-r--r--net/core/dev.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/core/dev.h b/net/core/dev.h
index f5b567310908..ab69edc0c3e3 100644
--- a/net/core/dev.h
+++ b/net/core/dev.h
@@ -315,14 +315,19 @@ static inline void napi_set_irq_suspend_timeout(struct napi_struct *n,
WRITE_ONCE(n->irq_suspend_timeout, timeout);
}
-static inline bool napi_get_threaded(struct napi_struct *n)
+static inline enum netdev_napi_threaded napi_get_threaded(struct napi_struct *n)
{
- return test_bit(NAPI_STATE_THREADED, &n->state);
+ if (test_bit(NAPI_STATE_THREADED, &n->state))
+ return NETDEV_NAPI_THREADED_ENABLED;
+
+ return NETDEV_NAPI_THREADED_DISABLED;
}
-int napi_set_threaded(struct napi_struct *n, bool threaded);
+int napi_set_threaded(struct napi_struct *n,
+ enum netdev_napi_threaded threaded);
-int netif_set_threaded(struct net_device *dev, bool threaded);
+int netif_set_threaded(struct net_device *dev,
+ enum netdev_napi_threaded threaded);
int rps_cpumask_housekeeping(struct cpumask *mask);