octeontx2-pf: add page pool ethtool statistics
Ratheesh Kannoth
maintainerPATCH 1/1 octeontx2-pf: add page pool ethtool statistics
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.
--- .../marvell/octeontx2/nic/otx2_ethtool.c | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +33 -2
@@ -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,
Signature · 1 line
2.43.0
Quoted 10 lines · 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_poolethtool stat block to the driver's private statistics set.Signed-off-by Ratheesh Kannoth <[email protected]>--- .../marvell/octeontx2/nic/otx2_ethtool.c | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
Jakub Kicinski
maintainerQuoted 4 lines · 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_poolethtool 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
Signature · 1 line
pw-bot: cr