The registers can be dumped through the API rte_eth_dev_get_reg_info. However, only register values are exported, which is inconvenient for users to interpret. Therefore, an extension of the structure "rte_dev_reg_info" and a new API rte_eth_dev_get_reg_info_ext is added to support the capability of exporting the name of the corresponding register and filtering by names.
The hns3 driver and telemetry are examples for that. -- v4: 1. fix mispellings. 2. add const to 'filter'. 3. remove redundant assigning. v3: 1. fix mispellings. 2. use snprintf instead of sprintf. 3. add more comment on rte_eth_dev_get_reg_info_ext. 4. add __rte_experimental. 5. add version map. v2: 1. fix compile error. 2. add new API to support it instead of the old one. 3. split patches on hns3 driver. Jie Hai (7): ethdev: support report register names and filter ethdev: add telemetry cmd for registers net/hns3: fix dump counter of registers net/hns3: remove dump format of registers net/hns3: add names for registers net/hns3: support filter directly accessed registers net/hns3: support filter dump of registers doc/guides/rel_notes/release_24_03.rst | 8 + drivers/net/hns3/hns3_regs.c | 1359 +++++++++++++++++++++--- lib/ethdev/rte_dev_info.h | 11 + lib/ethdev/rte_ethdev.c | 34 + lib/ethdev/rte_ethdev.h | 28 + lib/ethdev/rte_ethdev_telemetry.c | 126 +++ lib/ethdev/version.map | 1 + 7 files changed, 1394 insertions(+), 173 deletions(-) -- 2.30.0