[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <169266035756.10199.12776067447174397659.stgit@anambiarhost.jf.intel.com>
Date: Mon, 21 Aug 2023 16:25:57 -0700
From: Amritha Nambiar <amritha.nambiar@...el.com>
To: netdev@...r.kernel.org, kuba@...nel.org, davem@...emloft.net
Cc: sridhar.samudrala@...el.com, amritha.nambiar@...el.com
Subject: [net-next PATCH v2 9/9] 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>
---
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 63b8690d8ba3..47be577782e4 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -141,6 +141,7 @@ netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
struct netdev_rx_queue *rx_queue, *rxq;
struct netdev_queue *tx_queue, *txq;
unsigned int rx_qid, tx_qid;
+ pid_t pid;
void *hdr;
if (!napi->dev)
@@ -171,6 +172,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_s32(rsp, NETDEV_A_NAPI_PID, pid))
+ goto nla_put_failure;
+ }
+
genlmsg_end(rsp, hdr);
return 0;
Powered by blists - more mailing lists