Skip to content

Commit

Permalink
Merge tag 'mlx5-updates-2020-07-02' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2020-07-02

Rx and Tx devlink health reporters enhancements.

1) Code cleanup
2) devlink output format improvements
3) Print more useful info on devlink health diagnose output
4) TX timeout recovery, on a single SQ recover failure, stop the loop
and reset all rings (re-open netdev).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 3, 2020
2 parents 8c8278a + e620556 commit de2afdc
Show file tree
Hide file tree
Showing 9 changed files with 266 additions and 132 deletions.
20 changes: 0 additions & 20 deletions drivers/net/ethernet/mellanox/mlx5/core/en.h
Original file line number Diff line number Diff line change
Expand Up @@ -852,26 +852,6 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget);
int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget);
void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq);

static inline u32 mlx5e_rqwq_get_size(struct mlx5e_rq *rq)
{
switch (rq->wq_type) {
case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ:
return mlx5_wq_ll_get_size(&rq->mpwqe.wq);
default:
return mlx5_wq_cyc_get_size(&rq->wqe.wq);
}
}

static inline u32 mlx5e_rqwq_get_cur_sz(struct mlx5e_rq *rq)
{
switch (rq->wq_type) {
case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ:
return rq->mpwqe.wq.cur_sz;
default:
return rq->wqe.wq.cur_sz;
}
}

bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev);
bool mlx5e_striding_rq_possible(struct mlx5_core_dev *mdev,
struct mlx5e_params *params);
Expand Down
58 changes: 44 additions & 14 deletions drivers/net/ethernet/mellanox/mlx5/core/en/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "lib/eq.h"
#include "lib/mlx5.h"

int mlx5e_reporter_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name)
int mlx5e_health_fmsg_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name)
{
int err;

Expand All @@ -20,7 +20,7 @@ int mlx5e_reporter_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name)
return 0;
}

int mlx5e_reporter_named_obj_nest_end(struct devlink_fmsg *fmsg)
int mlx5e_health_fmsg_named_obj_nest_end(struct devlink_fmsg *fmsg)
{
int err;

Expand All @@ -35,7 +35,7 @@ int mlx5e_reporter_named_obj_nest_end(struct devlink_fmsg *fmsg)
return 0;
}

int mlx5e_reporter_cq_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg)
int mlx5e_health_cq_diag_fmsg(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg)
{
struct mlx5e_priv *priv = cq->channel->priv;
u32 out[MLX5_ST_SZ_DW(query_cq_out)] = {};
Expand All @@ -50,7 +50,7 @@ int mlx5e_reporter_cq_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg)
cqc = MLX5_ADDR_OF(query_cq_out, out, cq_context);
hw_status = MLX5_GET(cqc, cqc, status);

err = mlx5e_reporter_named_obj_nest_start(fmsg, "CQ");
err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "CQ");
if (err)
return err;

Expand All @@ -62,14 +62,22 @@ int mlx5e_reporter_cq_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg)
if (err)
return err;

err = mlx5e_reporter_named_obj_nest_end(fmsg);
err = devlink_fmsg_u32_pair_put(fmsg, "ci", mlx5_cqwq_get_ci(&cq->wq));
if (err)
return err;

err = devlink_fmsg_u32_pair_put(fmsg, "size", mlx5_cqwq_get_size(&cq->wq));
if (err)
return err;

err = mlx5e_health_fmsg_named_obj_nest_end(fmsg);
if (err)
return err;

return 0;
}

int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg)
int mlx5e_health_cq_common_diag_fmsg(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg)
{
u8 cq_log_stride;
u32 cq_sz;
Expand All @@ -78,7 +86,7 @@ int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *
cq_sz = mlx5_cqwq_get_size(&cq->wq);
cq_log_stride = mlx5_cqwq_get_log_stride_size(&cq->wq);

err = mlx5e_reporter_named_obj_nest_start(fmsg, "CQ");
err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "CQ");
if (err)
return err;

Expand All @@ -90,26 +98,48 @@ int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *
if (err)
return err;

err = mlx5e_reporter_named_obj_nest_end(fmsg);
err = mlx5e_health_fmsg_named_obj_nest_end(fmsg);
if (err)
return err;

return 0;
}

int mlx5e_health_create_reporters(struct mlx5e_priv *priv)
int mlx5e_health_eq_diag_fmsg(struct mlx5_eq_comp *eq, struct devlink_fmsg *fmsg)
{
int err;

err = mlx5e_reporter_tx_create(priv);
err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "EQ");
if (err)
return err;

err = mlx5e_reporter_rx_create(priv);
err = devlink_fmsg_u8_pair_put(fmsg, "eqn", eq->core.eqn);
if (err)
return err;

return 0;
err = devlink_fmsg_u32_pair_put(fmsg, "irqn", eq->core.irqn);
if (err)
return err;

err = devlink_fmsg_u32_pair_put(fmsg, "vecidx", eq->core.vecidx);
if (err)
return err;

err = devlink_fmsg_u32_pair_put(fmsg, "ci", eq->core.cons_index);
if (err)
return err;

err = devlink_fmsg_u32_pair_put(fmsg, "size", eq->core.nent);
if (err)
return err;

return mlx5e_health_fmsg_named_obj_nest_end(fmsg);
}

void mlx5e_health_create_reporters(struct mlx5e_priv *priv)
{
mlx5e_reporter_tx_create(priv);
mlx5e_reporter_rx_create(priv);
}

void mlx5e_health_destroy_reporters(struct mlx5e_priv *priv)
Expand Down Expand Up @@ -291,7 +321,7 @@ int mlx5e_health_queue_dump(struct mlx5e_priv *priv, struct devlink_fmsg *fmsg,
if (err)
return err;

err = mlx5e_reporter_named_obj_nest_start(fmsg, lbl);
err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, lbl);
if (err)
return err;

Expand All @@ -303,7 +333,7 @@ int mlx5e_health_queue_dump(struct mlx5e_priv *priv, struct devlink_fmsg *fmsg,
if (err)
return err;

err = mlx5e_reporter_named_obj_nest_end(fmsg);
err = mlx5e_health_fmsg_named_obj_nest_end(fmsg);
if (err)
return err;

Expand Down
16 changes: 9 additions & 7 deletions drivers/net/ethernet/mellanox/mlx5/core/en/health.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ static inline bool cqe_syndrome_needs_recover(u8 syndrome)
syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR;
}

int mlx5e_reporter_tx_create(struct mlx5e_priv *priv);
void mlx5e_reporter_tx_create(struct mlx5e_priv *priv);
void mlx5e_reporter_tx_destroy(struct mlx5e_priv *priv);
void mlx5e_reporter_tx_err_cqe(struct mlx5e_txqsq *sq);
int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq);

int mlx5e_reporter_cq_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg);
int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg);
int mlx5e_reporter_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name);
int mlx5e_reporter_named_obj_nest_end(struct devlink_fmsg *fmsg);
int mlx5e_health_cq_diag_fmsg(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg);
int mlx5e_health_cq_common_diag_fmsg(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg);
int mlx5e_health_eq_diag_fmsg(struct mlx5_eq_comp *eq, struct devlink_fmsg *fmsg);
int mlx5e_health_fmsg_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name);
int mlx5e_health_fmsg_named_obj_nest_end(struct devlink_fmsg *fmsg);

int mlx5e_reporter_rx_create(struct mlx5e_priv *priv);
void mlx5e_reporter_rx_create(struct mlx5e_priv *priv);
void mlx5e_reporter_rx_destroy(struct mlx5e_priv *priv);
void mlx5e_reporter_icosq_cqe_err(struct mlx5e_icosq *icosq);
void mlx5e_reporter_rq_cqe_err(struct mlx5e_rq *rq);
void mlx5e_reporter_rx_timeout(struct mlx5e_rq *rq);

#define MLX5E_REPORTER_PER_Q_MAX_LEN 256
#define MLX5E_REPORTER_FLUSH_TIMEOUT_MSEC 2000

struct mlx5e_err_ctx {
int (*recover)(void *ctx);
Expand All @@ -46,7 +48,7 @@ int mlx5e_health_recover_channels(struct mlx5e_priv *priv);
int mlx5e_health_report(struct mlx5e_priv *priv,
struct devlink_health_reporter *reporter, char *err_str,
struct mlx5e_err_ctx *err_ctx);
int mlx5e_health_create_reporters(struct mlx5e_priv *priv);
void mlx5e_health_create_reporters(struct mlx5e_priv *priv);
void mlx5e_health_destroy_reporters(struct mlx5e_priv *priv);
void mlx5e_health_channels_update(struct mlx5e_priv *priv);
int mlx5e_health_rsc_fmsg_dump(struct mlx5e_priv *priv, struct mlx5_rsc_key *key,
Expand Down
Loading

0 comments on commit de2afdc

Please sign in to comment.