Skip to content

Commit 1f492ea

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: core: Use variable timeout for EMAD retries
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: caf7297 ("mlxsw: core: Introduce support for asynchronous EMAD register access") Reported-by: Denis Yulevich <[email protected]> Tested-by: Denis Yulevich <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fb738b9 commit 1f492ea

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+2
-1
lines changed

Diff for: drivers/net/ethernet/mellanox/mlxsw/core.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ static void mlxsw_emad_trans_timeout_schedule(struct mlxsw_reg_trans *trans)
571571
if (trans->core->fw_flash_in_progress)
572572
timeout = msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_DURING_FW_FLASH_MS);
573573

574-
queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw, timeout);
574+
queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw,
575+
timeout << trans->retries);
575576
}
576577

577578
static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core,

0 commit comments

Comments
 (0)