mbox series

[net,0/8] Fixes for Ocelot driver statistics

Message ID 20220816135352.1431497-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series Fixes for Ocelot driver statistics | expand

Message

Vladimir Oltean Aug. 16, 2022, 1:53 p.m. UTC
This series contains bug fixes for the ocelot drivers (both switchdev
and DSA). Some concern the counters exposed to ethtool -S, and others to
the counters exposed to ifconfig. I'm aware that the changes are fairly
large, but I wanted to prioritize on a proper approach to addressing the
issues rather than a quick hack.

Some of the noticed problems:
- bad register offsets for some counters
- unhandled concurrency leading to corrupted counters
- unhandled 32-bit wraparound of ifconfig counters

The issues on the ocelot switchdev driver were noticed through code
inspection, I do not have the hardware to test.

This patch set necessarily converts ocelot->stats_lock from a mutex to a
spinlock. I know this affects Colin Foster's development with the SPI
controlled VSC7512. I have other changes prepared for net-next that
convert this back into a mutex (along with other changes in this area).

Vladimir Oltean (8):
  net: dsa: felix: fix ethtool 256-511 and 512-1023 TX packet counters
  net: mscc: ocelot: fix incorrect ndo_get_stats64 packet counters
  net: mscc: ocelot: fix address of SYS_COUNT_TX_AGING counter
  net: mscc: ocelot: turn stats_lock into a spinlock
  net: mscc: ocelot: fix race between ndo_get_stats64 and
    ocelot_check_stats_work
  net: mscc: ocelot: make struct ocelot_stat_layout array indexable
  net: mscc: ocelot: keep ocelot_stat_layout by reg address, not offset
  net: mscc: ocelot: report ndo_get_stats64 from the
    wraparound-resistant ocelot->stats

 drivers/net/dsa/ocelot/felix_vsc9959.c     | 558 +++++++++++++++++----
 drivers/net/dsa/ocelot/seville_vsc9953.c   | 553 ++++++++++++++++----
 drivers/net/ethernet/mscc/ocelot.c         |  62 ++-
 drivers/net/ethernet/mscc/ocelot_net.c     |  55 +-
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 468 +++++++++++++----
 drivers/net/ethernet/mscc/vsc7514_regs.c   |  84 +++-
 include/soc/mscc/ocelot.h                  | 179 ++++++-
 7 files changed, 1581 insertions(+), 378 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 18, 2022, 5:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 16 Aug 2022 16:53:44 +0300 you wrote:
> This series contains bug fixes for the ocelot drivers (both switchdev
> and DSA). Some concern the counters exposed to ethtool -S, and others to
> the counters exposed to ifconfig. I'm aware that the changes are fairly
> large, but I wanted to prioritize on a proper approach to addressing the
> issues rather than a quick hack.
> 
> Some of the noticed problems:
> - bad register offsets for some counters
> - unhandled concurrency leading to corrupted counters
> - unhandled 32-bit wraparound of ifconfig counters
> 
> [...]

Here is the summary with links:
  - [net,1/8] net: dsa: felix: fix ethtool 256-511 and 512-1023 TX packet counters
    https://git.kernel.org/netdev/net/c/40d21c4565bc
  - [net,2/8] net: mscc: ocelot: fix incorrect ndo_get_stats64 packet counters
    https://git.kernel.org/netdev/net/c/5152de7b79ab
  - [net,3/8] net: mscc: ocelot: fix address of SYS_COUNT_TX_AGING counter
    https://git.kernel.org/netdev/net/c/173ca86618d7
  - [net,4/8] net: mscc: ocelot: turn stats_lock into a spinlock
    https://git.kernel.org/netdev/net/c/22d842e3efe5
  - [net,5/8] net: mscc: ocelot: fix race between ndo_get_stats64 and ocelot_check_stats_work
    https://git.kernel.org/netdev/net/c/18d8e67df184
  - [net,6/8] net: mscc: ocelot: make struct ocelot_stat_layout array indexable
    https://git.kernel.org/netdev/net/c/9190460084dd
  - [net,7/8] net: mscc: ocelot: keep ocelot_stat_layout by reg address, not offset
    https://git.kernel.org/netdev/net/c/d4c367650704
  - [net,8/8] net: mscc: ocelot: report ndo_get_stats64 from the wraparound-resistant ocelot->stats
    https://git.kernel.org/netdev/net/c/e780e3193e88

You are awesome, thank you!