Skip to content

Commit b1f0349

Browse files
mosheshemesh2kuba-moo
authored andcommitted
net/mlx5: Stop polling for command response if interface goes down
Stop polling on firmware response to command in polling mode if the command interface got down. This situation can occur, for example, if a firmware fatal error is detected during polling. This change halts the polling process when the command interface goes down, preventing unnecessary waits. Fixes: b898ce7 ("net/mlx5: cmdif, Avoid skipping reclaim pages if FW is not accessible") Signed-off-by: Moshe Shemesh <[email protected]> Reviewed-by: Shay Drori <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8169a60 commit b1f0349

File tree

1 file changed

+5
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+5
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/cmd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent)
294294
return;
295295
}
296296
cond_resched();
297+
if (mlx5_cmd_is_down(dev)) {
298+
ent->ret = -ENXIO;
299+
return;
300+
}
297301
} while (time_before(jiffies, poll_end));
298302

299303
ent->ret = -ETIMEDOUT;
@@ -1070,7 +1074,7 @@ static void cmd_work_handler(struct work_struct *work)
10701074
poll_timeout(ent);
10711075
/* make sure we read the descriptor after ownership is SW */
10721076
rmb();
1073-
mlx5_cmd_comp_handler(dev, 1ULL << ent->idx, (ent->ret == -ETIMEDOUT));
1077+
mlx5_cmd_comp_handler(dev, 1ULL << ent->idx, !!ent->ret);
10741078
}
10751079
}
10761080

0 commit comments

Comments
 (0)