Skip to content

RFC mlxsw: Add support for new reset flow

Ido Schimmel linux-pci netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12netdevsim: Block until all devices are releaseddrivers/net/netdevsim/bus.c+12 -01 reply
2/12devlink: Hold a reference on parent devicenet/devlink/core.c+3 -03 replies
3/12devlink: Acquire device lock during reloadnet/devlink/core.c net/devlink/dev.c net/devlink/devl_internal.h +3 more+46 -121 reply
4/12PCI: Add no PM reset quirk for NVIDIA Spectrum devicesdrivers/pci/quirks.c+13 -02 replies
5/12PCI: Add device-specific reset for NVIDIA Spectrum devicesdrivers/pci/quirks.c+29 -03 replies
6/12PCI: Add debug print for device ready delaydrivers/pci/pci.c+3 -01 reply
7/12mlxsw: Extend MRSR pack() function to support new commandsdrivers/net/ethernet/mellanox/mlxsw/pci.c drivers/net/ethernet/mellanox/mlxsw/reg.h+13 -30 replies
8/12mlxsw: pci: Rename mlxsw_pci_sw_reset()drivers/net/ethernet/mellanox/mlxsw/pci.c+5 -50 replies
9/12mlxsw: pci: Move software reset code to a separate functiondrivers/net/ethernet/mellanox/mlxsw/pci.c+9 -30 replies
10/12mlxsw: pci: Add support for new reset flowdrivers/net/ethernet/mellanox/mlxsw/pci.c drivers/net/ethernet/mellanox/mlxsw/reg.h+45 -10 replies
11/12mlxsw: pci: Implement PCI reset handlersdrivers/net/ethernet/mellanox/mlxsw/pci.c+28 -00 replies
12/12selftests: mlxsw: Add PCI reset testtools/testing/selftests/drivers/net/mlxsw/pci_reset.sh+58 -00 replies

Reviews trailers per patch

8 of 12 patches have a Reviewed-by or Acked-by.

PatchJiri PirkoPetr MachataBjorn HelgaasJakub Kicinski
1/12R-b
2/12R-b
3/12
4/12A-b
5/12
6/12A-b
7/12R-b
8/12R-b
9/12R-b
10/12
11/12R-b
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [RFC PATCH net-next 00/12] mlxsw: Add support for new reset flow

This patchset changes mlxsw to issue a PCI reset during probe and devlink reload so that the PCI firmware could be upgraded without a reboot.

Unlike the previous version of this patchset [1], in this version the driver no longer tries to issue a PCI reset by triggering a PCI link toggle on its own, but instead calls the PCI core to issue the reset.

The PCI APIs require the device lock to be held which is why patches #2-#3 adjust devlink to hold a reference on the associated device and acquire the device lock during reload. Patch #1 prepares netdevsim for these devlink changes. See the commit message for more details.

Patches #4-#5 add reset method quirks for NVIDIA Spectrum devices.

Patch #6 adds a debug level print in PCI core so that device ready delay will be printed even if it is shorter than one second.

Patches #7-#9 are straightforward preparations in mlxsw.

Patch #10 finally implements the new reset flow in mlxsw.

Patch #11 adds PCI reset handlers in mlxsw to avoid user space from resetting the device from underneath an unaware driver. Instead, the driver is gracefully de-initialized before the PCI reset and then initialized again after it.

Patch #12 adds a PCI reset selftest to make sure this code path does not regress.

[1] https://lore.kernel.org/netdev/[email protected]/

Amit Cohen (3):
mlxsw: Extend MRSR pack() function to support new commands
mlxsw: pci: Rename mlxsw_pci_sw_reset()
mlxsw: pci: Move software reset code to a separate function

Ido Schimmel (9):
netdevsim: Block until all devices are released
devlink: Hold a reference on parent device
devlink: Acquire device lock during reload
PCI: Add no PM reset quirk for NVIDIA Spectrum devices
PCI: Add device-specific reset for NVIDIA Spectrum devices
PCI: Add debug print for device ready delay
mlxsw: pci: Add support for new reset flow
mlxsw: pci: Implement PCI reset handlers
selftests: mlxsw: Add PCI reset test

 drivers/net/ethernet/mellanox/mlxsw/pci.c     | 90 +++++++++++++++++--
 drivers/net/ethernet/mellanox/mlxsw/reg.h     | 16 +++-
 drivers/net/netdevsim/bus.c                   | 12 +++
 drivers/pci/pci.c                             |  3 +
 drivers/pci/quirks.c                          | 42 +++++++++
 net/devlink/core.c                            |  7 +-
 net/devlink/dev.c                             |  8 ++
 net/devlink/devl_internal.h                   | 19 +++-
 net/devlink/health.c                          |  3 +-
 net/devlink/netlink.c                         | 21 +++--
 net/devlink/region.c                          |  3 +-
 .../selftests/drivers/net/mlxsw/pci_reset.sh  | 58 ++++++++++++
 12 files changed, 261 insertions(+), 21 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/pci_reset.sh
Signature · 1 line
2.40.1