Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] octeontx2-pf: add page pool ethtool statistics
@ 2026-06-15  3:21 Ratheesh Kannoth
  2026-06-15 20:32 ` Joe Damato
  2026-06-15 21:50 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Ratheesh Kannoth @ 2026-06-15  3:21 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, sgoutham,
	Ratheesh Kannoth

Expose page pool allocator statistics through ethtool.
When the interface is up, aggregate stats from each
receive queue page pool and append the common page_pool ethtool stat
block to the driver's private statistics set.

Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
---
 .../marvell/octeontx2/nic/otx2_ethtool.c      | 35 +++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
index a0340f3422bf..0a082f8d9714 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
@@ -133,6 +133,8 @@ static void otx2_get_strings(struct net_device *netdev, u32 sset, u8 *data)
 	ethtool_puts(&data, "reset_count");
 	ethtool_puts(&data, "Fec Corrected Errors: ");
 	ethtool_puts(&data, "Fec Uncorrected Errors: ");
+
+	page_pool_ethtool_stats_get_strings(data);
 }
 
 static void otx2_get_qset_stats(struct otx2_nic *pfvf,
@@ -182,6 +184,28 @@ static int otx2_get_phy_fec_stats(struct otx2_nic *pfvf)
 	return rc;
 }
 
+static void otx2_page_pool_stats(struct otx2_nic *vf, u64 *data)
+{
+#ifdef CONFIG_PAGE_POOL_STATS
+	bool up = !!(vf->netdev->flags & IFF_UP);
+	struct page_pool_stats stats = {};
+	struct otx2_hw *hw = &vf->hw;
+	struct otx2_pool *pool;
+	int pool_id;
+
+	if (up) {
+		for (pool_id = 0; pool_id < hw->rqpool_cnt; pool_id++) {
+			pool = &vf->qset.pool[pool_id];
+			if (!pool->page_pool)
+				continue;
+			page_pool_get_stats(pool->page_pool, &stats);
+		}
+	}
+
+	page_pool_ethtool_stats_get(data, &stats);
+#endif
+}
+
 /* Get device and per queue statistics */
 static void otx2_get_ethtool_stats(struct net_device *netdev,
 				   struct ethtool_stats *stats, u64 *data)
@@ -237,6 +261,8 @@ static void otx2_get_ethtool_stats(struct net_device *netdev,
 
 	*(data++) = fec_corr_blks;
 	*(data++) = fec_uncorr_blks;
+
+	otx2_page_pool_stats(pfvf, data);
 }
 
 static int otx2_get_sset_count(struct net_device *netdev, int sset)
@@ -254,7 +280,8 @@ static int otx2_get_sset_count(struct net_device *netdev, int sset)
 	otx2_update_lmac_fec_stats(pfvf);
 
 	return otx2_n_dev_stats + otx2_n_drv_stats + qstats_count +
-	       mac_stats + OTX2_FEC_STATS_CNT + 1;
+	       mac_stats + OTX2_FEC_STATS_CNT + 1 +
+	       page_pool_ethtool_stats_get_count();
 }
 
 /* Get no of queues device supports and current queue count */
@@ -1402,6 +1429,7 @@ static void otx2vf_get_strings(struct net_device *netdev, u32 sset, u8 *data)
 	otx2_get_qset_strings(vf, &data, 0);
 
 	ethtool_puts(&data, "reset_count");
+	page_pool_ethtool_stats_get_strings(data);
 }
 
 static void otx2vf_get_ethtool_stats(struct net_device *netdev,
@@ -1421,6 +1449,8 @@ static void otx2vf_get_ethtool_stats(struct net_device *netdev,
 
 	otx2_get_qset_stats(vf, stats, &data);
 	*(data++) = vf->reset_count;
+
+	otx2_page_pool_stats(vf, data);
 }
 
 static int otx2vf_get_sset_count(struct net_device *netdev, int sset)
@@ -1434,7 +1464,8 @@ static int otx2vf_get_sset_count(struct net_device *netdev, int sset)
 	qstats_count = otx2_n_queue_stats *
 		       (vf->hw.rx_queues + otx2_get_total_tx_queues(vf));
 
-	return otx2_n_dev_stats + otx2_n_drv_stats + qstats_count + 1;
+	return otx2_n_dev_stats + otx2_n_drv_stats + qstats_count + 1 +
+		page_pool_ethtool_stats_get_count();
 }
 
 static int otx2vf_get_link_ksettings(struct net_device *netdev,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] octeontx2-pf: add page pool ethtool statistics
  2026-06-15  3:21 [PATCH net-next] octeontx2-pf: add page pool ethtool statistics Ratheesh Kannoth
@ 2026-06-15 20:32 ` Joe Damato
  2026-06-15 21:50 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Damato @ 2026-06-15 20:32 UTC (permalink / raw)
  To: Ratheesh Kannoth
  Cc: linux-kernel, netdev, andrew+netdev, davem, edumazet, kuba,
	pabeni, sgoutham

On Mon, Jun 15, 2026 at 08:51:41AM +0530, Ratheesh Kannoth wrote:
> Expose page pool allocator statistics through ethtool.
> When the interface is up, aggregate stats from each
> receive queue page pool and append the common page_pool ethtool stat
> block to the driver's private statistics set.
> 
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> ---
>  .../marvell/octeontx2/nic/otx2_ethtool.c      | 35 +++++++++++++++++--
>  1 file changed, 33 insertions(+), 2 deletions(-)
> 

Reviewed-by: Joe Damato <joe@dama.to>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] octeontx2-pf: add page pool ethtool statistics
  2026-06-15  3:21 [PATCH net-next] octeontx2-pf: add page pool ethtool statistics Ratheesh Kannoth
  2026-06-15 20:32 ` Joe Damato
@ 2026-06-15 21:50 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-06-15 21:50 UTC (permalink / raw)
  To: Ratheesh Kannoth
  Cc: linux-kernel, netdev, andrew+netdev, davem, edumazet, pabeni,
	sgoutham

On Mon, 15 Jun 2026 08:51:41 +0530 Ratheesh Kannoth wrote:
> Expose page pool allocator statistics through ethtool.
> When the interface is up, aggregate stats from each
> receive queue page pool and append the common page_pool ethtool stat
> block to the driver's private statistics set.

include/net/page_pool/helpers.h :

/* Deprecated driver-facing API, use netlink instead */
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
int page_pool_ethtool_stats_get_count(void);
u8 *page_pool_ethtool_stats_get_strings(u8 *data);
u64 *page_pool_ethtool_stats_get(u64 *data, const void *stats);

Is the page pool in your driver shared by multiple netdevs?

If not just set netdev in page_pool_params
If yes then you need to explain it in the commit msg

Please note that net-next is closed for the next 2 weeks
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-15 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15  3:21 [PATCH net-next] octeontx2-pf: add page pool ethtool statistics Ratheesh Kannoth
2026-06-15 20:32 ` Joe Damato
2026-06-15 21:50 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox