Skip to contentSkip to conversation

mlxsw: Couple of fixes

PATCH Applied Ido Schimmel 2 participants 4 messages Nov 17, 2020 – Nov 18, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mlxsw: Couple of fixes

From: Ido Schimmel <[email protected]>

This patch set contains two fixes for mlxsw.

Patch #1 fixes firmware flashing when CONFIG_MLXSW_CORE=y and CONFIG_MLXFW=m.

Patch #2 prevents EMAD transactions from needlessly failing when the system is under heavy load by using exponential backoff.

Please consider patch #2 for stable.

Ido Schimmel (2):
mlxsw: Fix firmware flashing
mlxsw: core: Use variable timeout for EMAD retries

 drivers/net/ethernet/mellanox/mlxsw/Kconfig | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/core.c  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/2 mlxsw: Fix firmware flashing

From: Ido Schimmel <[email protected]>

The commit cited below moved firmware flashing functionality from mlxsw_spectrum to mlxsw_core, but did not adjust the Kconfig dependencies. This makes it possible to have mlxsw_core as built-in and mlxfw as a module. The mlxfw code is therefore not reachable from mlxsw_core and firmware flashing fails:

# devlink dev flash pci/0000:01:00.0 file mellanox/mlxsw_spectrum-13.2008.1310.mfa2
devlink answers: Operation not supported

Fix by having mlxsw_core select mlxfw.

Fixes b79cb787ac70 ("mlxsw: Move fw flashing code into core.c")
---
 drivers/net/ethernet/mellanox/mlxsw/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/Kconfig +1 -1
index 872e9910bb7c..a619d90559f7 100644
@@ -6,6 +6,7 @@
 config MLXSW_CORE
 	tristate "Mellanox Technologies Switch ASICs support"
 	select NET_DEVLINK
+	select MLXFW
 	help
 	  This driver supports Mellanox Technologies Switch ASICs family.
 
@@ -82,7 +83,6 @@ config MLXSW_SPECTRUM
 	select GENERIC_ALLOCATOR
 	select PARMAN
 	select OBJAGG
-	select MLXFW
 	imply PTP_1588_CLOCK
 	select NET_PTP_CLASSIFY if PTP_1588_CLOCK
 	default m
Signature · 1 line
2.28.0
#2 lore raw

PATCH 2/2 mlxsw: core: Use variable timeout for EMAD retries

In reply to Ido Schimmel

From: Ido Schimmel <[email protected]>

The driver sends Ethernet Management Datagram (EMAD) packets to the device for configuration purposes and waits for up to 200ms for a reply. A request is retried up to 5 times.

When the system is under heavy load, replies are not always processed in time and EMAD transactions fail.

Make the process more robust to such delays by using exponential backoff. First wait for up to 200ms, then retransmit and wait for up to 400ms and so on.

Fixes caf7297e7ab5 ("mlxsw: core: Introduce support for asynchronous EMAD register access")
---
 drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/core.c +2 -1
index 937b8e46f8c7..1a86535c4968 100644
@@ -571,7 +571,8 @@ static void mlxsw_emad_trans_timeout_schedule(struct mlxsw_reg_trans *trans)
 	if (trans->core->fw_flash_in_progress)
 		timeout = msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_DURING_FW_FLASH_MS);
 
-	queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw, timeout);
+	queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw,
+			   timeout << trans->retries);
 }
 
 static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core,
Signature · 1 line
2.28.0
maintainer Applied
#3 lore raw
In reply to Ido Schimmel
Quoted 9 lines · On Tue, 17 Nov 2020 19:33:50 +0200 Ido Schimmel wrote:

This patch set contains two fixes for mlxsw.

Patch #1 fixes firmware flashing when CONFIG_MLXSW_CORE=y and CONFIG_MLXFW=m.

Patch #2 prevents EMAD transactions from needlessly failing when the system is under heavy load by using exponential backoff.

Please consider patch #2 for stable.

Applied, and queued, thanks!