mlxsw: Couple of fixes
Subsystems (3)
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
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.
--- drivers/net/ethernet/mellanox/mlxsw/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/Kconfig +1 -1
@@ -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
PATCH 2/2 mlxsw: core: Use variable timeout for EMAD retries
In reply to Ido SchimmelFrom: 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.
--- drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/core.c +2 -1
@@ -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
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=yandCONFIG_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!