Thread (4 messages) flat view 4 messages, 3 authors, 2026-03-11

Re: [PATCH net-next] net: mana: Expose page_pool stats via ethtool

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-02-27 15:11:27
Also in: linux-hyperv, linux-rdma, lkml

+static void mana_get_page_pool_stats(struct net_device *ndev, u64 *data)
+{
+#ifdef CONFIG_PAGE_POOL_STATS
+	struct mana_port_context *apc = netdev_priv(ndev);
+	unsigned int num_queues = apc->num_queues;
+	struct page_pool_stats pp_stats = {};
+	int q;
+
+	for (q = 0; q < num_queues; q++) {
+		if (!apc->rxqs[q] || !apc->rxqs[q]->page_pool)
+			continue;
+
+		page_pool_get_stats(apc->rxqs[q]->page_pool, &pp_stats);
+	}
+
+	page_pool_ethtool_stats_get(data, &pp_stats);
+#endif /* CONFIG_PAGE_POOL_STATS */
You should not need this #ifdef. The stubs should make the code do
sensible things if CONFIG_PAGE_POOL_STATS is not enabled.

	 Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help