]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/net/ethernet/mellanox/mlx5/core/en/health.h
net/mlx5e: Do not recover from a non-fatal syndrome
[mirror_ubuntu-jammy-kernel.git] / drivers / net / ethernet / mellanox / mlx5 / core / en / health.h
CommitLineData
de8650a8
EBE
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2019 Mellanox Technologies. */
3
4edc17fd
AL
4#ifndef __MLX5E_EN_HEALTH_H
5#define __MLX5E_EN_HEALTH_H
de8650a8 6
de8650a8
EBE
7#include "en.h"
8
0a35ab3e
SM
9#define MLX5E_RX_ERR_CQE(cqe) (get_cqe_opcode(cqe) != MLX5_CQE_RESP_SEND)
10
8276ea13
AL
11static inline bool cqe_syndrome_needs_recover(u8 syndrome)
12{
187a9830 13 return syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
8276ea13
AL
14 syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR ||
15 syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR;
16}
17
06293ae4
AL
18int mlx5e_reporter_tx_create(struct mlx5e_priv *priv);
19void mlx5e_reporter_tx_destroy(struct mlx5e_priv *priv);
20void mlx5e_reporter_tx_err_cqe(struct mlx5e_txqsq *sq);
21int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq);
de8650a8 22
2bf09e60
AL
23int mlx5e_reporter_cq_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg);
24int mlx5e_reporter_cq_common_diagnose(struct mlx5e_cq *cq, struct devlink_fmsg *fmsg);
2d708887
AL
25int mlx5e_reporter_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name);
26int mlx5e_reporter_named_obj_nest_end(struct devlink_fmsg *fmsg);
27
9032e719
AL
28int mlx5e_reporter_rx_create(struct mlx5e_priv *priv);
29void mlx5e_reporter_rx_destroy(struct mlx5e_priv *priv);
be5323c8 30void mlx5e_reporter_icosq_cqe_err(struct mlx5e_icosq *icosq);
8276ea13 31void mlx5e_reporter_rq_cqe_err(struct mlx5e_rq *rq);
32c57fb2 32void mlx5e_reporter_rx_timeout(struct mlx5e_rq *rq);
9032e719 33
c50de4af
AL
34#define MLX5E_REPORTER_PER_Q_MAX_LEN 256
35
36struct mlx5e_err_ctx {
37 int (*recover)(void *ctx);
38 void *ctx;
39};
40
41int mlx5e_health_sq_to_ready(struct mlx5e_channel *channel, u32 sqn);
42int mlx5e_health_channel_eq_recover(struct mlx5_eq_comp *eq, struct mlx5e_channel *channel);
43int mlx5e_health_recover_channels(struct mlx5e_priv *priv);
44int mlx5e_health_report(struct mlx5e_priv *priv,
45 struct devlink_health_reporter *reporter, char *err_str,
46 struct mlx5e_err_ctx *err_ctx);
11af6a6d
AL
47int mlx5e_health_create_reporters(struct mlx5e_priv *priv);
48void mlx5e_health_destroy_reporters(struct mlx5e_priv *priv);
49void mlx5e_health_channels_update(struct mlx5e_priv *priv);
50
c50de4af 51
de8650a8 52#endif