Skip to content

Commit 72c8f42

Browse files
Shalom Toledodavem330
authored andcommitted
mlxsw: core: Extend EMAD information reported to devlink hwerr
Extend EMAD information reported to devlink hwerr tracepoint with transaction id and reg id (both, hex and string). Signed-off-by: Shalom Toledo <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2aa4aa2 commit 72c8f42

File tree

1 file changed

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

1 file changed

+10
-2
lines changed

drivers/net/ethernet/mellanox/mlxsw/core.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,8 +1683,11 @@ int mlxsw_reg_trans_write(struct mlxsw_core *mlxsw_core,
16831683
}
16841684
EXPORT_SYMBOL(mlxsw_reg_trans_write);
16851685

1686+
#define MLXSW_REG_TRANS_ERR_STRING_SIZE 256
1687+
16861688
static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
16871689
{
1690+
char err_string[MLXSW_REG_TRANS_ERR_STRING_SIZE];
16881691
struct mlxsw_core *mlxsw_core = trans->core;
16891692
int err;
16901693

@@ -1702,9 +1705,14 @@ static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
17021705
mlxsw_core_reg_access_type_str(trans->type),
17031706
trans->emad_status,
17041707
mlxsw_emad_op_tlv_status_str(trans->emad_status));
1708+
1709+
snprintf(err_string, MLXSW_REG_TRANS_ERR_STRING_SIZE,
1710+
"(tid=%llx,reg_id=%x(%s)) %s\n", trans->tid,
1711+
trans->reg->id, mlxsw_reg_id_str(trans->reg->id),
1712+
mlxsw_emad_op_tlv_status_str(trans->emad_status));
1713+
17051714
trace_devlink_hwerr(priv_to_devlink(mlxsw_core),
1706-
trans->emad_status,
1707-
mlxsw_emad_op_tlv_status_str(trans->emad_status));
1715+
trans->emad_status, err_string);
17081716
}
17091717

17101718
list_del(&trans->bulk_list);

0 commit comments

Comments
 (0)