aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJoe Damato <jdamato@fastly.com>2025-02-05 19:37:47 +0000
committerJakub Kicinski <kuba@kernel.org>2025-02-06 16:59:25 -0800
commit6597e8d35851e1e0cb381f76ce1d960518fd8c94 (patch)
tree6bc4840bf5a436cfec3627b96d0a6b919c291edc /include/net
parentMerge branch 'io_uring-zero-copy-rx' (diff)
downloadlinux-6597e8d35851e1e0cb381f76ce1d960518fd8c94.tar.gz
linux-6597e8d35851e1e0cb381f76ce1d960518fd8c94.zip
netdev-genl: Elide napi_id when not present
There are at least two cases where napi_id may not present and the napi_id should be elided: 1. Queues could be created, but napi_enable may not have been called yet. In this case, there may be a NAPI but it may not have an ID and output of a napi_id should be elided. 2. TX-only NAPIs currently do not have NAPI IDs. If a TX queue happens to be linked with a TX-only NAPI, elide the NAPI ID from the netlink output as a NAPI ID of 0 is not useful for users. Signed-off-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250205193751.297211-1-jdamato@fastly.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/busy_poll.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index c39a426ebf52..741fa7754700 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -24,6 +24,11 @@
*/
#define MIN_NAPI_ID ((unsigned int)(NR_CPUS + 1))
+static inline bool napi_id_valid(unsigned int napi_id)
+{
+ return napi_id >= MIN_NAPI_ID;
+}
+
#define BUSY_POLL_BUDGET 8
#ifdef CONFIG_NET_RX_BUSY_POLL