Adds common code for collecting basic statistics used by many SW based PMD's such as af_packet, af_xdp, null, tap and ring.
Solves the problem where counters could tear because of 32 bit load/store on 32 bit platforms. v5 - use consume/release memory order for update on 32 bit case - initialize mbuf in ring test which was causing byte counts to be messed up. 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 | 22 ++-- drivers/net/af_packet/rte_eth_af_packet.c | 82 +++----------- drivers/net/af_xdp/rte_eth_af_xdp.c | 98 +++++------------ 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 | 98 +++++++++++++++++ lib/ethdev/ethdev_swstats.c | 109 +++++++++++++++++++ lib/ethdev/ethdev_swstats.h | 124 +++++++++++++++++++++ lib/ethdev/meson.build | 2 + lib/ethdev/version.map | 3 + 14 files changed, 480 insertions(+), 438 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