Skip to content

Commit 51a5365

Browse files
committed
Merge branch 'Devlink-health-reporting-and-recovery-system'
Eran Ben Elisha says: ==================== Devlink health reporting and recovery system The health mechanism is targeted for Real Time Alerting, in order to know when something bad had happened to a PCI device - Provide alert debug information - Self healing - If problem needs vendor support, provide a way to gather all needed debugging information. The main idea is to unify and centralize driver health reports in the generic devlink instance and allow the user to set different attributes of the health reporting and recovery procedures. The devlink health reporter: Device driver creates a "health reporter" per each error/health type. Error/Health type can be a known/generic (eg pci error, fw error, rx/tx error) or unknown (driver specific). For each registered health reporter a driver can issue error/health reports asynchronously. All health reports handling is done by devlink. Device driver can provide specific callbacks for each "health reporter", e.g. - Recovery procedures - Diagnostics and object dump procedures - OOB initial attributes Different parts of the driver can register different types of health reporters with different handlers. Once an error is reported, devlink health will do the following actions: * A log is being send to the kernel trace events buffer * Health status and statistics are being updated for the reporter instance * Object dump is being taken and saved at the reporter instance (as long as there is no other dump which is already stored) * Auto recovery attempt is being done. Depends on: - Auto-recovery configuration - Grace period vs. time passed since last recover The user interface: User can access/change each reporter attributes and driver specific callbacks via devlink, e.g per error type (per health reporter) - Configure reporter's generic attributes (like: Disable/enable auto recovery) - Invoke recovery procedure - Run diagnostics - Object dump The devlink health interface (via netlink): DEVLINK_CMD_HEALTH_REPORTER_GET Retrieves status and configuration info per DEV and reporter. DEVLINK_CMD_HEALTH_REPORTER_SET Allows reporter-related configuration setting. DEVLINK_CMD_HEALTH_REPORTER_RECOVER Triggers a reporter's recovery procedure. DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE Retrieves diagnostics data from a reporter on a device. DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET Retrieves the last stored dump. Devlink health saves a single dump. If an dump is not already stored by the devlink for this reporter, devlink generates a new dump. dump output is defined by the reporter. DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR Clears the last saved dump file for the specified reporter. netlink +--------------------------+ | | | + | | | | +--------------------------+ |request for ops |(diagnose, mlx5_core devlink |recover, |dump) +--------+ +--------------------------+ | | | reporter| | | | | +---------v----------+ | | | ops execution | | | | | <----------------------------------+ | | | | | | | | | | | + ^------------------+ | | | | | request for ops | | | | | (recover, dump) | | | | | | | | | +-+------------------+ | | | health report | | health handler | | | +-------------------------------> | | | | | +--------------------+ | | | health reporter create | | | +----------------------------> | +--------+ +--------------------------+ In this patchset, mlx5e TX reporter is implemented. v2: - Remove FW* reporters to decrease the amount of patches in the patchset ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f88c19a + b8c45a0 commit 51a5365

File tree

11 files changed

+1782
-169
lines changed

11 files changed

+1782
-169
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
The health mechanism is targeted for Real Time Alerting, in order to know when
2+
something bad had happened to a PCI device
3+
- Provide alert debug information
4+
- Self healing
5+
- If problem needs vendor support, provide a way to gather all needed debugging
6+
information.
7+
8+
The main idea is to unify and centralize driver health reports in the
9+
generic devlink instance and allow the user to set different
10+
attributes of the health reporting and recovery procedures.
11+
12+
The devlink health reporter:
13+
Device driver creates a "health reporter" per each error/health type.
14+
Error/Health type can be a known/generic (eg pci error, fw error, rx/tx error)
15+
or unknown (driver specific).
16+
For each registered health reporter a driver can issue error/health reports
17+
asynchronously. All health reports handling is done by devlink.
18+
Device driver can provide specific callbacks for each "health reporter", e.g.
19+
- Recovery procedures
20+
- Diagnostics and object dump procedures
21+
- OOB initial parameters
22+
Different parts of the driver can register different types of health reporters
23+
with different handlers.
24+
25+
Once an error is reported, devlink health will do the following actions:
26+
* A log is being send to the kernel trace events buffer
27+
* Health status and statistics are being updated for the reporter instance
28+
* Object dump is being taken and saved at the reporter instance (as long as
29+
there is no other dump which is already stored)
30+
* Auto recovery attempt is being done. Depends on:
31+
- Auto-recovery configuration
32+
- Grace period vs. time passed since last recover
33+
34+
The user interface:
35+
User can access/change each reporter's parameters and driver specific callbacks
36+
via devlink, e.g per error type (per health reporter)
37+
- Configure reporter's generic parameters (like: disable/enable auto recovery)
38+
- Invoke recovery procedure
39+
- Run diagnostics
40+
- Object dump
41+
42+
The devlink health interface (via netlink):
43+
DEVLINK_CMD_HEALTH_REPORTER_GET
44+
Retrieves status and configuration info per DEV and reporter.
45+
DEVLINK_CMD_HEALTH_REPORTER_SET
46+
Allows reporter-related configuration setting.
47+
DEVLINK_CMD_HEALTH_REPORTER_RECOVER
48+
Triggers a reporter's recovery procedure.
49+
DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE
50+
Retrieves diagnostics data from a reporter on a device.
51+
DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET
52+
Retrieves the last stored dump. Devlink health
53+
saves a single dump. If an dump is not already stored by the devlink
54+
for this reporter, devlink generates a new dump.
55+
dump output is defined by the reporter.
56+
DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR
57+
Clears the last saved dump file for the specified reporter.
58+
59+
60+
netlink
61+
+--------------------------+
62+
| |
63+
| + |
64+
| | |
65+
+--------------------------+
66+
|request for ops
67+
|(diagnose,
68+
mlx5_core devlink |recover,
69+
|dump)
70+
+--------+ +--------------------------+
71+
| | | reporter| |
72+
| | | +---------v----------+ |
73+
| | ops execution | | | |
74+
| <----------------------------------+ | |
75+
| | | | | |
76+
| | | + ^------------------+ |
77+
| | | | request for ops |
78+
| | | | (recover, dump) |
79+
| | | | |
80+
| | | +-+------------------+ |
81+
| | health report | | health handler | |
82+
| +-------------------------------> | |
83+
| | | +--------------------+ |
84+
| | health reporter create | |
85+
| +----------------------------> |
86+
+--------+ +--------------------------+

drivers/net/ethernet/mellanox/mlx5/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
2222
#
2323
mlx5_core-$(CONFIG_MLX5_CORE_EN) += en_main.o en_common.o en_fs.o en_ethtool.o \
2424
en_tx.o en_rx.o en_dim.o en_txrx.o en/xdp.o en_stats.o \
25-
en_selftest.o en/port.o en/monitor_stats.o
25+
en_selftest.o en/port.o en/monitor_stats.o en/reporter_tx.o
2626

2727
#
2828
# Netdev extra

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,7 @@ struct mlx5e_txqsq {
388388
struct mlx5e_channel *channel;
389389
int txq_ix;
390390
u32 rate_limit;
391-
struct mlx5e_txqsq_recover {
392-
struct work_struct recover_work;
393-
u64 last_recover;
394-
} recover;
391+
struct work_struct recover_work;
395392
} ____cacheline_aligned_in_smp;
396393

397394
struct mlx5e_dma_info {
@@ -682,6 +679,13 @@ struct mlx5e_rss_params {
682679
u8 hfunc;
683680
};
684681

682+
struct mlx5e_modify_sq_param {
683+
int curr_state;
684+
int next_state;
685+
int rl_update;
686+
int rl_index;
687+
};
688+
685689
struct mlx5e_priv {
686690
/* priv data path fields - start */
687691
struct mlx5e_txqsq *txq2sq[MLX5E_MAX_NUM_CHANNELS * MLX5E_MAX_NUM_TC];
@@ -737,6 +741,7 @@ struct mlx5e_priv {
737741
#ifdef CONFIG_MLX5_EN_TLS
738742
struct mlx5e_tls *tls;
739743
#endif
744+
struct devlink_health_reporter *tx_reporter;
740745
};
741746

742747
struct mlx5e_profile {
@@ -866,6 +871,11 @@ void mlx5e_set_rq_type(struct mlx5_core_dev *mdev, struct mlx5e_params *params);
866871
void mlx5e_init_rq_type_params(struct mlx5_core_dev *mdev,
867872
struct mlx5e_params *params);
868873

874+
int mlx5e_modify_sq(struct mlx5_core_dev *mdev, u32 sqn,
875+
struct mlx5e_modify_sq_param *p);
876+
void mlx5e_activate_txqsq(struct mlx5e_txqsq *sq);
877+
void mlx5e_tx_disable_queue(struct netdev_queue *txq);
878+
869879
static inline bool mlx5e_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev)
870880
{
871881
return (MLX5_CAP_ETH(mdev, tunnel_stateless_gre) &&
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2+
/* Copyright (c) 2018 Mellanox Technologies. */
3+
4+
#ifndef __MLX5E_EN_REPORTER_H
5+
#define __MLX5E_EN_REPORTER_H
6+
7+
#include <linux/mlx5/driver.h>
8+
#include "en.h"
9+
10+
int mlx5e_tx_reporter_create(struct mlx5e_priv *priv);
11+
void mlx5e_tx_reporter_destroy(struct mlx5e_priv *priv);
12+
void mlx5e_tx_reporter_err_cqe(struct mlx5e_txqsq *sq);
13+
void mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq);
14+
15+
#endif

0 commit comments

Comments
 (0)