Skip to content

Commit 2a0a935

Browse files
shayshyiSaeed Mahameed
authored and
Saeed Mahameed
committed
net/mlx5: Collect command failures data only for known commands
DEVX can issue a general command, which is not used by mlx5 driver. In case such command is failed, mlx5 is trying to collect the failure data, However, mlx5 doesn't create a storage for this command, since mlx5 doesn't use it. This lead to array-index-out-of-bounds error. Fix it by checking whether the command is known before collecting the failure data. Fixes: 34f46ae ("net/mlx5: Add command failures data to debugfs") Signed-off-by: Shay Drory <shayd@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 18c40a1 commit 2a0a935

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,10 @@ static void mlx5_cmd_err_trace(struct mlx5_core_dev *dev, u16 opcode, u16 op_mod
19201920
static void cmd_status_log(struct mlx5_core_dev *dev, u16 opcode, u8 status,
19211921
u32 syndrome, int err)
19221922
{
1923+
const char *namep = mlx5_command_str(opcode);
19231924
struct mlx5_cmd_stats *stats;
19241925

1925-
if (!err)
1926+
if (!err || !(strcmp(namep, "unknown command opcode")))
19261927
return;
19271928

19281929
stats = &dev->cmd.stats[opcode];

0 commit comments

Comments
 (0)