[v10,0/8] Common statistics for software PMD's

Message ID 20240522161427.64568-1-stephen@networkplumber.org (mailing list archive)
Headers
Series Common statistics for software PMD's |

Message

Stephen Hemminger May 22, 2024, 4:12 p.m. UTC
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 two counters (current and offset) to implement
SMP safe reset on 64 bit platforms; this avoids having to do locked
operation in the fast path.  On 32 bit platforms, the compiler
will split access to 64 bit variables by default; therefore
it has to use std atomic.

By using common code, it also fixes missing counts in several drivers.
And fixes several bugs.

v10 - can use fast 64 bit counter on all architecture except I686
    - get rid of rte_read/write_once macros
    - adjust #include based on iwyu

Stephen Hemminger (8):
  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
  net/ring: use generic SW stats
  net/tap: use generic SW stats
  net/null: use generic SW stats

 drivers/net/af_packet/rte_eth_af_packet.c |  78 +++---------
 drivers/net/af_xdp/rte_eth_af_xdp.c       |  85 ++++---------
 drivers/net/null/rte_eth_null.c           |  83 ++++---------
 drivers/net/pcap/pcap_ethdev.c            | 100 ++++-----------
 drivers/net/ring/rte_eth_ring.c           |  63 +++-------
 drivers/net/tap/rte_eth_tap.c             |  75 ++----------
 drivers/net/tap/rte_eth_tap.h             |  15 +--
 lib/eal/include/meson.build               |   1 +
 lib/eal/include/rte_counter.h             | 141 ++++++++++++++++++++++
 lib/ethdev/ethdev_swstats.c               | 102 ++++++++++++++++
 lib/ethdev/ethdev_swstats.h               | 117 ++++++++++++++++++
 lib/ethdev/meson.build                    |   2 +
 lib/ethdev/version.map                    |   3 +
 13 files changed, 484 insertions(+), 381 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