Adds common code for collecting basic statistics used by many SW based PMD's such as af_packet, af_xdp, null, tap and ring.
This version uses std atomic on all platforms. The memory order is chosen to be the best performance but still providing the guarantees expected of PMD counters. By using common code, it also fixes missing counts in several drivers. And fixes several bugs. v7 - use stdatomic even on 64 bit. Does cause extra locked operation for increment on x86 64 but will be safe. - rebase Stephen Hemminger (9): eal: generic 64 bit counter ethdev: add common counters for statistics net/af_packet: use generic SW stats net/af_xdp: use generic SW stats net/pcap: use generic SW stats test/pmd_ring: initialize mbufs net/ring: use generic SW stats net/tap: use generic SW stats net/null: use generic SW stats app/test/test_pmd_ring.c | 26 ++++- drivers/net/af_packet/rte_eth_af_packet.c | 82 +++----------- drivers/net/af_xdp/rte_eth_af_xdp.c | 97 +++++------------ drivers/net/null/rte_eth_null.c | 80 +++----------- drivers/net/pcap/pcap_ethdev.c | 125 +++++----------------- drivers/net/ring/rte_eth_ring.c | 71 +++++------- drivers/net/tap/rte_eth_tap.c | 88 +++------------ drivers/net/tap/rte_eth_tap.h | 15 +-- lib/eal/include/meson.build | 1 + lib/eal/include/rte_counter.h | 116 ++++++++++++++++++++ lib/ethdev/ethdev_swstats.c | 101 +++++++++++++++++ lib/ethdev/ethdev_swstats.h | 124 +++++++++++++++++++++ lib/ethdev/meson.build | 2 + lib/ethdev/version.map | 3 + 14 files changed, 495 insertions(+), 436 deletions(-) create mode 100644 lib/eal/include/rte_counter.h create mode 100644 lib/ethdev/ethdev_swstats.c create mode 100644 lib/ethdev/ethdev_swstats.h -- 2.43.0