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-next>] [day] [month] [year] [list]
Message-Id: <20250128163038.429864-1-jdamato@fastly.com>
Date: Tue, 28 Jan 2025 16:30:37 +0000
From: Joe Damato <jdamato@...tly.com>
To: netdev@...r.kernel.org
Cc: sridhar.samudrala@...el.com,
	Joe Damato <jdamato@...tly.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>,
	Stanislav Fomichev <sdf@...ichev.me>,
	Mina Almasry <almasrymina@...gle.com>,
	linux-kernel@...r.kernel.org (open list)
Subject: [RFC net-next] netdev-genl: Elide napi_id for TX-only NAPIs

TX-only NAPIs currently do not have NAPI IDs. If a TX queue happens to
be linked with a TX-only NAPI, elide the NAPI ID from the netlink output
as a NAPI ID of 0 is not useful for users.

Signed-off-by: Joe Damato <jdamato@...tly.com>
---
 net/core/netdev-genl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 715f85c6b62e..3116e683e516 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -397,9 +397,12 @@ netdev_nl_queue_fill_one(struct sk_buff *rsp, struct net_device *netdev,
 		break;
 	case NETDEV_QUEUE_TYPE_TX:
 		txq = netdev_get_tx_queue(netdev, q_idx);
-		if (txq->napi && nla_put_u32(rsp, NETDEV_A_QUEUE_NAPI_ID,
-					     txq->napi->napi_id))
+		if (!txq->napi)
 			goto nla_put_failure;
+		if (txq->napi->napi_id >= MIN_NAPI_ID)
+			if (nla_put_u32(rsp, NETDEV_A_QUEUE_NAPI_ID,
+					txq->napi->napi_id))
+				goto nla_put_failure;
 	}
 
 	genlmsg_end(rsp, hdr);

base-commit: 0ad9617c78acbc71373fb341a6f75d4012b01d69
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ