lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <169059165828.3736.1595843116804085813.stgit@anambiarhost.jf.intel.com>
Date: Fri, 28 Jul 2023 17:47:38 -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 v1 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 8401f646a10b..60af99ffb9ec 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 *msg, struct napi_struct *napi)
 	struct netdev_queue *tx_queue, *txq;
 	unsigned int rx_qid, tx_qid;
 	struct nlattr *napi_info;
+	pid_t pid;
 
 	napi_info = nla_nest_start(msg, NETDEV_A_NAPI_NAPI_INFO);
 	if (!napi_info)
@@ -165,6 +166,12 @@ netdev_nl_napi_fill_one(struct sk_buff *msg, struct napi_struct *napi)
 		if (nla_put_u32(msg, NETDEV_A_NAPI_INFO_ENTRY_IRQ, napi->irq))
 			goto nla_put_failure;
 
+	if (napi->thread) {
+		pid = task_pid_nr(napi->thread);
+		if (nla_put_s32(msg, NETDEV_A_NAPI_INFO_ENTRY_PID, pid))
+			goto nla_put_failure;
+	}
+
 	nla_nest_end(msg, napi_info);
 	return 0;
 nla_put_failure:


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ