[PATCH net-next v5 0/3] net: dpaa2-mac: export standard statistics

From: Ioana Ciornei

Date: Mon Mar 23 2026 - 07:57:17 EST


This patch set adds support for standard ethtool statistics - rmon,
eth-ctrl, eth-mac and pause - to dpaa2-mac and its users dpaa2-eth and
dpaa2-switch.

The first patch extends the firmware APIs related to MAC counters and
adds dpmac_get_statistics() which can be used to retrieve multiple counter
values through a single firmware call.

This new API is put in use in the second patch by gathering all
previously exported ethtool statistics through a single MC firmware
call. In this patch we are also adding the setup and cleanup
infrastructure which will be also used for the standard ethtool
counters.

The third patch adds the actual suppord for rmon, eth-ctrl, eth-mac and
pause statistics in dpaa2-mac and its users.

Changes in v5:
- 3/3: use DPMAC_CNT_ING_UNDERSIZED for the rmon etherStatsUndersizePkts
counter

Changes in v4:
- 2/3: fix dma_sync call and memory leak in the cleanup
- 3/3: add dma_sync_single_for_device before calling the MC API

Changes in v3:
- 1/3: limit the documentation entries to 80 chars
- 2/3: use dma_alloc_noncoherent() instead of kcalloc + dma_map_single
- 2/3, 3/3: reduce the number of lines that have more than 80 chars

Changes in v2:
- 2/3: fix fallback usecase by using dpaa2_mac_ethtool_stats[i].id
- 2/3: use the __le32/__le64 types for cnt_idx, cnt_values etc

Ioana Ciornei (3):
net: dpaa2-mac: extend APIs related to statistics
net: dpaa2-mac: retrieve MAC statistics in one firmware command
net: dpaa2-mac: export standard statistics

.../ethernet/freescale/dpaa2/dpaa2-ethtool.c | 61 ++-
.../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 409 ++++++++++++++++--
.../net/ethernet/freescale/dpaa2/dpaa2-mac.h | 27 +-
.../freescale/dpaa2/dpaa2-switch-ethtool.c | 48 +-
.../net/ethernet/freescale/dpaa2/dpmac-cmd.h | 11 +-
drivers/net/ethernet/freescale/dpaa2/dpmac.c | 31 +-
drivers/net/ethernet/freescale/dpaa2/dpmac.h | 94 +++-
7 files changed, 638 insertions(+), 43 deletions(-)

--
2.25.1