net: dpaa2-mac: retrieve MAC statistics in one firmware command
authorIoana Ciornei <ioana.ciornei@nxp.com>
Mon, 23 Mar 2026 11:50:38 +0000 (13:50 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 26 Mar 2026 11:47:28 +0000 (12:47 +0100)
commitd369154d9d7fa7530a2520b945905fbecd35b05b
treeff53124550869334d1570057d0adac7391558d56
parentfbf3fecf6ae1c9f429c2450f5a10d5640d7c5f9c
net: dpaa2-mac: retrieve MAC statistics in one firmware command

The latest MC firmware version added a new command to retrieve all DPMAC
counters in a single firmware call. Use this new command, when possible,
in dpaa2-mac as well.

In order to use the dpmac_get_statistics() API, two DMA memory areas are
used: one to transmit what counters the driver is requesting and one to
receive the values of those counters. These memory areas are allocated
and DMA mapped at probe time so that we don't waste time at runtime.

And since we are planning to add rmon, eth-ctrl and other standard
statistics using the same infrastructure, make the setup and cleanup
processes as generic as possibile through the dpaa2_mac_setup_stats()
and dpaa2_mac_clear_stats() functions.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://patch.msgid.link/20260323115039.3932600-3-ioana.ciornei@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h