Skip to content

mlxsw: Add support for new reset flow

Petr Machata linux-kselftest linux-pci netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 14 repliesIn review 12 of 14 applied

Patches in v1 12 of 14 applied

#Subject and filesSizeRepliesApplied
1/14devlink: Move private netlink flags to C filenet/devlink/devl_internal.h net/devlink/netlink.c+3 -31 replyApplied
2/14devlink: Acquire device lock during netns dismantlenet/devlink/core.c net/devlink/devl_internal.h+17 -21 replyApplied
3/14devlink: Enable the use of private flags in post_doit operationsnet/devlink/netlink.c+11 -51 reply
4/14devlink: Allow taking device lock in pre_doit operationsnet/devlink/devl_internal.h net/devlink/health.c net/devlink/netlink.c +1 more+18 -101 replyApplied
5/14devlink: Acquire device lock during reload commandDocumentation/netlink/specs/devlink.yaml net/devlink/netlink.c net/devlink/netlink_gen.c +1 more+22 -41 replyApplied
6/14devlink: Add device lock assert in reload operationnet/devlink/dev.c+8 -01 replyApplied
7/14PCI: Add no PM reset quirk for NVIDIA Spectrum devicesdrivers/pci/quirks.c+13 -01 replyApplied
8/14PCI: Add debug print for device ready delaydrivers/pci/pci.c+3 -01 replyApplied
9/14mlxsw: Extend MRSR pack() function to support new commandsdrivers/net/ethernet/mellanox/mlxsw/pci.c drivers/net/ethernet/mellanox/mlxsw/reg.h+13 -31 replyApplied
10/14mlxsw: pci: Rename mlxsw_pci_sw_reset()drivers/net/ethernet/mellanox/mlxsw/pci.c+5 -51 replyApplied
11/14mlxsw: pci: Move software reset code to a separate functiondrivers/net/ethernet/mellanox/mlxsw/pci.c+11 -51 reply
12/14mlxsw: pci: Add support for new reset flowdrivers/net/ethernet/mellanox/mlxsw/pci.c drivers/net/ethernet/mellanox/mlxsw/reg.h+45 -11 replyApplied
13/14mlxsw: pci: Implement PCI reset handlersdrivers/net/ethernet/mellanox/mlxsw/pci.c+28 -01 replyApplied
14/14selftests: mlxsw: Add PCI reset testtools/testing/selftests/drivers/net/mlxsw/pci_reset.sh+58 -01 replyApplied

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchJiri PirkoBjorn HelgaasPetr MachataSimon Horman
1/14R-b R-b
2/14R-b R-b
3/14R-b R-b
4/14R-b R-b
5/14R-b R-b
6/14R-b R-b
7/14A-b
8/14A-b R-b
9/14R-b R-b
10/14R-b R-b
11/14R-b R-b
12/14R-b R-b
13/14R-b R-b
14/14R-b R-b

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 [PATCH net-next 00/14] mlxsw: Add support for new reset flow

Ido Schimmel writes:

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 old 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 #1-#6 adjust devlink to acquire the device lock during reload.

Patches #7 adds reset method quirk for NVIDIA Spectrum devices.

Patch #8 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 #9-#11 are straightforward preparations in mlxsw.

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

Patch #13 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 #14 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 (11):
devlink: Move private netlink flags to C file
devlink: Acquire device lock during netns dismantle
devlink: Enable the use of private flags in post_doit operations
devlink: Allow taking device lock in pre_doit operations
devlink: Acquire device lock during reload command
devlink: Add device lock assert in reload operation
PCI: Add no PM reset quirk 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

 Documentation/netlink/specs/devlink.yaml      |  4 +-
 drivers/net/ethernet/mellanox/mlxsw/pci.c     | 90 +++++++++++++++++--
 drivers/net/ethernet/mellanox/mlxsw/reg.h     | 16 +++-
 drivers/pci/pci.c                             |  3 +
 drivers/pci/quirks.c                          | 13 +++
 net/devlink/core.c                            |  4 +-
 net/devlink/dev.c                             |  8 ++
 net/devlink/devl_internal.h                   | 21 ++++-
 net/devlink/health.c                          |  3 +-
 net/devlink/netlink.c                         | 47 +++++++---
 net/devlink/netlink_gen.c                     |  4 +-
 net/devlink/netlink_gen.h                     |  5 ++
 net/devlink/region.c                          |  3 +-
 .../selftests/drivers/net/mlxsw/pci_reset.sh  | 58 ++++++++++++
 14 files changed, 248 insertions(+), 31 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/pci_reset.sh
Signature · 1 line
2.41.0