Skip to content

Commit 5bd8770

Browse files
shayshyikuba-moo
authored andcommitted
net/mlx5: Add NOT_READY command return status
Add a new command status MLX5_CMD_STAT_NOT_READY to handle cases where the firmware is not ready. Signed-off-by: Shay Drory <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9c754d0 commit 5bd8770

File tree

2 files changed

+7
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core
  • include/linux/mlx5

2 files changed

+7
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static const char *cmd_status_str(u8 status)
754754
return "bad resource";
755755
case MLX5_CMD_STAT_RES_BUSY:
756756
return "resource busy";
757+
case MLX5_CMD_STAT_NOT_READY:
758+
return "FW not ready";
757759
case MLX5_CMD_STAT_LIM_ERR:
758760
return "limits exceeded";
759761
case MLX5_CMD_STAT_BAD_RES_STATE_ERR:
@@ -787,6 +789,7 @@ static int cmd_status_to_err(u8 status)
787789
case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO;
788790
case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL;
789791
case MLX5_CMD_STAT_RES_BUSY: return -EBUSY;
792+
case MLX5_CMD_STAT_NOT_READY: return -EAGAIN;
790793
case MLX5_CMD_STAT_LIM_ERR: return -ENOMEM;
791794
case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL;
792795
case MLX5_CMD_STAT_IX_ERR: return -EINVAL;
@@ -815,14 +818,16 @@ EXPORT_SYMBOL(mlx5_cmd_out_err);
815818
static void cmd_status_print(struct mlx5_core_dev *dev, void *in, void *out)
816819
{
817820
u16 opcode, op_mod;
821+
u8 status;
818822
u16 uid;
819823

820824
opcode = in_to_opcode(in);
821825
op_mod = MLX5_GET(mbox_in, in, op_mod);
822826
uid = MLX5_GET(mbox_in, in, uid);
827+
status = MLX5_GET(mbox_out, out, status);
823828

824829
if (!uid && opcode != MLX5_CMD_OP_DESTROY_MKEY &&
825-
opcode != MLX5_CMD_OP_CREATE_UCTX)
830+
opcode != MLX5_CMD_OP_CREATE_UCTX && status != MLX5_CMD_STAT_NOT_READY)
826831
mlx5_cmd_out_err(dev, opcode, op_mod, out);
827832
}
828833

include/linux/mlx5/device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,7 @@ enum {
14491449
MLX5_CMD_STAT_BAD_SYS_STATE_ERR = 0x4,
14501450
MLX5_CMD_STAT_BAD_RES_ERR = 0x5,
14511451
MLX5_CMD_STAT_RES_BUSY = 0x6,
1452+
MLX5_CMD_STAT_NOT_READY = 0x7,
14521453
MLX5_CMD_STAT_LIM_ERR = 0x8,
14531454
MLX5_CMD_STAT_BAD_RES_STATE_ERR = 0x9,
14541455
MLX5_CMD_STAT_IX_ERR = 0xa,

0 commit comments

Comments
 (0)