summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAmritha Nambiar <amritha.nambiar@intel.com>2023-12-01 15:29:18 -0800
committerJakub Kicinski <kuba@kernel.org>2023-12-04 18:04:06 -0800
commitdb4704f4e4dfce835e934609fca735a648ce26e8 (patch)
tree3d74be9997941e1f60db7307916da9e8a5bba2ae /net/core
parent8481a249a0eaf0000dbb18f7689ccd50ea9835cd (diff)
downloadlinux-db4704f4e4dfce835e934609fca735a648ce26e8.tar.gz
linux-db4704f4e4dfce835e934609fca735a648ce26e8.tar.bz2
linux-db4704f4e4dfce835e934609fca735a648ce26e8.zip
netdev-genl: Add PID for the NAPI thread
In the threaded NAPI mode, expose the PID of the NAPI thread. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Link: https://lore.kernel.org/r/170147335818.5260.10253384006102593087.stgit@anambiarhost.jf.intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/netdev-genl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 9753c19e36de..fd98936da3ae 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -163,6 +163,7 @@ netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
const struct genl_info *info)
{
void *hdr;
+ pid_t pid;
if (WARN_ON_ONCE(!napi->dev))
return -EINVAL;
@@ -183,6 +184,12 @@ netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
if (napi->irq >= 0 && nla_put_u32(rsp, NETDEV_A_NAPI_IRQ, napi->irq))
goto nla_put_failure;
+ if (napi->thread) {
+ pid = task_pid_nr(napi->thread);
+ if (nla_put_u32(rsp, NETDEV_A_NAPI_PID, pid))
+ goto nla_put_failure;
+ }
+
genlmsg_end(rsp, hdr);
return 0;