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 <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Shalom Toledo 2019-11-12 08:48:28 +02:00 коммит произвёл David S. Miller
Родитель 2aa4aa2051
Коммит 72c8f428b5
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -1683,8 +1683,11 @@ int mlxsw_reg_trans_write(struct mlxsw_core *mlxsw_core,
}
EXPORT_SYMBOL(mlxsw_reg_trans_write);
#define MLXSW_REG_TRANS_ERR_STRING_SIZE 256
static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
{
char err_string[MLXSW_REG_TRANS_ERR_STRING_SIZE];
struct mlxsw_core *mlxsw_core = trans->core;
int err;
@ -1702,9 +1705,14 @@ static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
mlxsw_core_reg_access_type_str(trans->type),
trans->emad_status,
mlxsw_emad_op_tlv_status_str(trans->emad_status));
snprintf(err_string, MLXSW_REG_TRANS_ERR_STRING_SIZE,
"(tid=%llx,reg_id=%x(%s)) %s\n", trans->tid,
trans->reg->id, mlxsw_reg_id_str(trans->reg->id),
mlxsw_emad_op_tlv_status_str(trans->emad_status));
trace_devlink_hwerr(priv_to_devlink(mlxsw_core),
trans->emad_status,
mlxsw_emad_op_tlv_status_str(trans->emad_status));
trans->emad_status, err_string);
}
list_del(&trans->bulk_list);