public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/14] Standardized ethtool counters for Felix DSA driver
@ 2022-09-08 16:48 Vladimir Oltean
  2022-09-08 16:48 ` [PATCH net-next 01/14] net: dsa: felix: add definitions for the stream filter counters Vladimir Oltean
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Vladimir Oltean @ 2022-09-08 16:48 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Xiaoliang Yang, Claudiu Manoil, Alexandre Belloni, UNGLinuxDriver,
	Andrew Lunn, Vivien Didelot, Florian Fainelli, Maxim Kochetkov,
	Colin Foster, Richie Pearn, linux-kernel

The main purpose of this change set is to add reporting of structured
ethtool statistics counters to the felix DSA driver (see patch 11/14 for
details), as a prerequisite for extending these counters to the
eMAC/pMAC defined by the IEEE MAC Merge layer.

Along the way, the main purpose has diverged into multiple sub-purposes
which are also tackled:

- A bug fix patch submitted to "net" has made ocelot->stats_lock a spin
  lock, which is not an issue currently (all Ocelot switches are MMIO),
  but will be an issue for Colin Foster who is working on a SPI
  controlled Ocelot switch. We restore the hardware access to port stats
  to be sleepable.

- PSFP (tc-gate, tc-police) tc-flower stats on Felix use a non-converged
  procedure to access the hardware counters, although the interface is
  very similar to what is used for the port counters. Benefit from the
  logic used for the port counters, which gains us 64-bit tc-flower
  stats that are resistant to overflows.

- Also export the ndo_get_stats64 method used by the ocelot switchdev
  driver to Felix, so that ifconfig sees something hardware-based as
  well (but not 100% up to date).

- Create a new ocelot_stats.c file which groups everything stats-related
  together. Along with this, also move some other topic-specific code,
  like FDB and PTP, out of the main ocelot.c.

- Minimize the lines of code for the stats layout definitions. These
  changes alone cause the patch set to have an overall reduction of
  lines of code in the driver, even though we are adding new
  functionality as well.

Tested the port counters with lockdep and friends, with some
garden-variety traffic (ping, iperf3) and the PSFP counters with
tools/testing/selftests/drivers/net/ocelot/psfp.sh.

Vladimir Oltean (14):
  net: dsa: felix: add definitions for the stream filter counters
  net: mscc: ocelot: make access to STAT_VIEW sleepable again
  net: dsa: felix: check the 32-bit PSFP stats against overflow
  net: mscc: ocelot: report FIFO drop counters through stats->rx_dropped
  net: mscc: ocelot: sort Makefile files alphabetically
  net: mscc: ocelot: move stats code to ocelot_stats.c
  net: mscc: ocelot: unexport ocelot_port_fdb_do_dump from the common
    lib
  net: mscc: ocelot: move more PTP code from the lib to ocelot_ptp.c
  net: dsa: felix: use ocelot's ndo_get_stats64 method
  net: mscc: ocelot: exclude stats from bulk regions based on reg, not
    name
  net: mscc: ocelot: add support for all sorts of standardized counters
    present in DSA
  net: mscc: ocelot: harmonize names of SYS_COUNT_TX_AGING and
    OCELOT_STAT_TX_AGED
  net: mscc: ocelot: minimize definitions for stats
  net: mscc: ocelot: share the common stat definitions between all
    drivers

 drivers/net/dsa/ocelot/felix.c             |  55 ++
 drivers/net/dsa/ocelot/felix_vsc9959.c     | 509 +++------------
 drivers/net/dsa/ocelot/seville_vsc9953.c   | 376 +----------
 drivers/net/ethernet/mscc/Makefile         |  11 +-
 drivers/net/ethernet/mscc/ocelot.c         | 707 +--------------------
 drivers/net/ethernet/mscc/ocelot.h         |  12 +-
 drivers/net/ethernet/mscc/ocelot_net.c     |  88 +--
 drivers/net/ethernet/mscc/ocelot_ptp.c     | 481 ++++++++++++++
 drivers/net/ethernet/mscc/ocelot_stats.c   | 458 +++++++++++++
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 373 +----------
 drivers/net/ethernet/mscc/vsc7514_regs.c   |   3 +-
 include/soc/mscc/ocelot.h                  | 138 +++-
 12 files changed, 1293 insertions(+), 1918 deletions(-)
 create mode 100644 drivers/net/ethernet/mscc/ocelot_stats.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-09-09 10:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-08 16:48 [PATCH net-next 00/14] Standardized ethtool counters for Felix DSA driver Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 01/14] net: dsa: felix: add definitions for the stream filter counters Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 02/14] net: mscc: ocelot: make access to STAT_VIEW sleepable again Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 03/14] net: dsa: felix: check the 32-bit PSFP stats against overflow Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 04/14] net: mscc: ocelot: report FIFO drop counters through stats->rx_dropped Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 05/14] net: mscc: ocelot: sort Makefile files alphabetically Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 06/14] net: mscc: ocelot: move stats code to ocelot_stats.c Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 07/14] net: mscc: ocelot: unexport ocelot_port_fdb_do_dump from the common lib Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 08/14] net: mscc: ocelot: move more PTP code from the lib to ocelot_ptp.c Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 09/14] net: dsa: felix: use ocelot's ndo_get_stats64 method Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 10/14] net: mscc: ocelot: exclude stats from bulk regions based on reg, not name Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 11/14] net: mscc: ocelot: add support for all sorts of standardized counters present in DSA Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 12/14] net: mscc: ocelot: harmonize names of SYS_COUNT_TX_AGING and OCELOT_STAT_TX_AGED Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 13/14] net: mscc: ocelot: minimize definitions for stats Vladimir Oltean
2022-09-08 16:48 ` [PATCH net-next 14/14] net: mscc: ocelot: share the common stat definitions between all drivers Vladimir Oltean
2022-09-09 10:10 ` [PATCH net-next 00/14] Standardized ethtool counters for Felix DSA driver patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox