[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <170130409873.5198.6723749951487504481.stgit@anambiarhost.jf.intel.com>
Date: Wed, 29 Nov 2023 16:28:18 -0800
From: Amritha Nambiar <amritha.nambiar@...el.com>
To: netdev@...r.kernel.org, kuba@...nel.org, pabeni@...hat.com
Cc: edumazet@...gle.com, ast@...nel.org, sdf@...gle.com, lorenzo@...nel.org,
tariqt@...dia.com, daniel@...earbox.net, anthony.l.nguyen@...el.com,
lucien.xin@...il.com, michael.chan@...adcom.com, sridhar.samudrala@...el.com,
amritha.nambiar@...el.com
Subject: [net-next PATCH v10 10/11] 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@...el.com>
Reviewed-by: Sridhar Samudrala <sridhar.samudrala@...el.com>
---
net/core/netdev-genl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index e87d2f2d7fec..b39e9c8c0dc1 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -152,6 +152,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;
@@ -172,6 +173,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;
Powered by blists - more mailing lists