Skip to content

mlxsw: Avoid non-tracker helpers when holding and putting netdevices

Petr Machata netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 1 replyApplied 7/7

Patches in v1 All 7 applied

#Subject and filesSizeRepliesApplied
1/7mlxsw: spectrum: Drop unused functions mlxsw_sp_port_lower_dev_hold/_put()drivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h+0 -190 repliesApplied
2/7mlxsw: spectrum_nve: Do not take reference when looking up netdevicedrivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c+4 -30 repliesApplied
3/7mlxsw: spectrum_switchdev: Use tracker helpers to hold & put netdevicesdrivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+5 -40 repliesApplied
4/7mlxsw: spectrum_router: FIB: Use tracker helpers to hold & put netdevicesdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+5 -30 repliesApplied
5/7mlxsw: spectrum_router: hw_stats: Use tracker helpers to hold & put netdevicesdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+3 -20 repliesApplied
6/7mlxsw: spectrum_router: RIF: Use tracker helpers to hold & put netdevicesdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+4 -30 repliesApplied
7/7mlxsw: spectrum_router: IPv6 events: Use tracker helpers to hold & put netdevicesdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+3 -20 repliesApplied

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIdo SchimmelEric Dumazet
SeriesR-b
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/7] mlxsw: Avoid non-tracker helpers when holding and putting netdevices

Using the tracking helpers, netdev_hold() and netdev_put(), makes it easier to debug netdevice refcount imbalances when CONFIG_NET_DEV_REFCNT_TRACKER is enabled. For example, the following traceback shows the callpath to the point of an outstanding hold that was never put:

    unregister_netdevice: waiting for swp3 to become free. Usage count = 6
    ref_tracker: eth%d@ffff888123c9a580 has 1/5 users at
	mlxsw_sp_switchdev_event+0x6bd/0xcc0 [mlxsw_spectrum]
	notifier_call_chain+0xbf/0x3b0
	atomic_notifier_call_chain+0x78/0x200
	br_switchdev_fdb_notify+0x25f/0x2c0 [bridge]
	fdb_notify+0x16a/0x1a0 [bridge]
	[...]

In this patchset, get rid of all non-ref-tracking helpers in mlxsw.

- Patch #1 drops two functions that are not used anymore, but contain dev_hold() / dev_put() calls.

- Patch #2 avoids taking a reference in one function which is called under RTNL.

- The remaining patches convert individual hold/put sites one by one from trackerless to tracker-enabled.

Petr Machata (7):
mlxsw: spectrum: Drop unused functions

    mlxsw_sp_port_lower_dev_hold/_put()

mlxsw: spectrum_nve: Do not take reference when looking up netdevice
mlxsw: spectrum_switchdev: Use tracker helpers to hold & put
netdevices
mlxsw: spectrum_router: FIB: Use tracker helpers to hold & put
netdevices
mlxsw: spectrum_router: hw_stats: Use tracker helpers to hold & put
netdevices
mlxsw: spectrum_router: RIF: Use tracker helpers to hold & put
netdevices
mlxsw: spectrum_router: IPv6 events: Use tracker helpers to hold & put
netdevices

 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 17 -------------
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  2 --
 .../ethernet/mellanox/mlxsw/spectrum_nve.c    |  7 +++---
 .../ethernet/mellanox/mlxsw/spectrum_router.c | 25 +++++++++++--------
 .../mellanox/mlxsw/spectrum_switchdev.c       |  9 ++++---
 5 files changed, 24 insertions(+), 36 deletions(-)
Signature · 1 line
2.41.0