Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: don't dump Tx and uninitialized NAPIs

We use NAPI ID as the key for continuing dumps. We also depend
on the NAPIs being sorted by ID within the driver list. Tx NAPIs
(which don't have an ID assigned) break this expectation, it's
not currently possible to dump them reliably. Since Tx NAPIs
are relatively rare, and can't be used in doit (GET or SET)
hide them from the dump API as well.

Fixes: 27f91aaf49b3 ("netdev-genl: Add netlink framework functions for napi")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250103183207.1216004-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Jakub Kicinski and committed by
Paolo Abeni
fd48f071 4c122450

+3 -2
+3 -2
net/core/netdev-genl.c
··· 176 176 if (!hdr) 177 177 return -EMSGSIZE; 178 178 179 - if (napi->napi_id >= MIN_NAPI_ID && 180 - nla_put_u32(rsp, NETDEV_A_NAPI_ID, napi->napi_id)) 179 + if (nla_put_u32(rsp, NETDEV_A_NAPI_ID, napi->napi_id)) 181 180 goto nla_put_failure; 182 181 183 182 if (nla_put_u32(rsp, NETDEV_A_NAPI_IFINDEX, napi->dev->ifindex)) ··· 271 272 return err; 272 273 273 274 list_for_each_entry(napi, &netdev->napi_list, dev_list) { 275 + if (napi->napi_id < MIN_NAPI_ID) 276 + continue; 274 277 if (ctx->napi_id && napi->napi_id >= ctx->napi_id) 275 278 continue; 276 279