net/mlx5e: Change reporters create functions to return void

Creation of devlink health reporters is not fatal for mlx5e instance load.
In case of error in reporter's creation, the return value is ignored.
Change all reporters creation functions to return void.

In addition, with this change, a failure in creating a reporter, will not
prevent the driver from trying to create the next reporter in the list.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
Eran Ben Elisha 2020-04-06 16:00:35 +03:00 committed by Saeed Mahameed
parent 8c8278a5b1
commit b3ea4c4fdc
4 changed files with 10 additions and 21 deletions

View File

@ -97,19 +97,10 @@ int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *
return 0;
}
int mlx5e_health_create_reporters(struct mlx5e_priv *priv)
void mlx5e_health_create_reporters(struct mlx5e_priv *priv)
{
int err;
err = mlx5e_reporter_tx_create(priv);
if (err)
return err;
err = mlx5e_reporter_rx_create(priv);
if (err)
return err;
return 0;
mlx5e_reporter_tx_create(priv);
mlx5e_reporter_rx_create(priv);
}
void mlx5e_health_destroy_reporters(struct mlx5e_priv *priv)

View File

@ -16,7 +16,7 @@ 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);
@ -26,7 +26,7 @@ int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_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_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);
@ -46,7 +46,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,

View File

@ -563,7 +563,7 @@ static const struct devlink_health_reporter_ops mlx5_rx_reporter_ops = {
#define MLX5E_REPORTER_RX_GRACEFUL_PERIOD 500
int mlx5e_reporter_rx_create(struct mlx5e_priv *priv)
void mlx5e_reporter_rx_create(struct mlx5e_priv *priv)
{
struct devlink *devlink = priv_to_devlink(priv->mdev);
struct devlink_health_reporter *reporter;
@ -575,10 +575,9 @@ int mlx5e_reporter_rx_create(struct mlx5e_priv *priv)
if (IS_ERR(reporter)) {
netdev_warn(priv->netdev, "Failed to create rx reporter, err = %ld\n",
PTR_ERR(reporter));
return PTR_ERR(reporter);
return;
}
priv->rx_reporter = reporter;
return 0;
}
void mlx5e_reporter_rx_destroy(struct mlx5e_priv *priv)

View File

@ -406,7 +406,7 @@ static const struct devlink_health_reporter_ops mlx5_tx_reporter_ops = {
#define MLX5_REPORTER_TX_GRACEFUL_PERIOD 500
int mlx5e_reporter_tx_create(struct mlx5e_priv *priv)
void mlx5e_reporter_tx_create(struct mlx5e_priv *priv)
{
struct devlink_health_reporter *reporter;
struct mlx5_core_dev *mdev = priv->mdev;
@ -421,10 +421,9 @@ int mlx5e_reporter_tx_create(struct mlx5e_priv *priv)
netdev_warn(priv->netdev,
"Failed to create tx reporter, err = %ld\n",
PTR_ERR(reporter));
return PTR_ERR(reporter);
return;
}
priv->tx_reporter = reporter;
return 0;
}
void mlx5e_reporter_tx_destroy(struct mlx5e_priv *priv)