Files
linux/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.h
George Cherian 5ed66306ea octeontx2-af: Add devlink health reporters for NIX
Add health reporters for RVU NIX block.
NIX Health reporters handle following HW event groups
- GENERAL events
- ERROR events
- RAS events
- RVU event

Output:

 # devlink health
 pci/0002:01:00.0:
   reporter hw_npa_intr
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_npa_gen
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_npa_err
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_npa_ras
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_nix_intr
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_nix_gen
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_nix_err
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true
   reporter hw_nix_ras
     state healthy error 0 recover 0 grace_period 0 auto_recover true auto_dump true

 # devlink health dump show pci/0002:01:00.0 reporter hw_nix_intr
  NIX_AF_RVU:
	NIX RVU Interrupt Reg : 1
	Unmap Slot Error
 # devlink health dump show pci/0002:01:00.0 reporter hw_nix_gen
  NIX_AF_GENERAL:
	NIX General Interrupt Reg : 1
	Rx multicast pkt drop

Each reporter dump shows the Register value and the description of the cause.

Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: George Cherian <george.cherian@marvell.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-01-21 11:57:51 -08:00

83 lines
2.0 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Marvell OcteonTx2 RVU Devlink
*
* Copyright (C) 2020 Marvell.
*
*/
#ifndef RVU_DEVLINK_H
#define RVU_DEVLINK_H
#define RVU_REPORTERS(_name) \
static const struct devlink_health_reporter_ops rvu_ ## _name ## _reporter_ops = { \
.name = #_name, \
.recover = rvu_ ## _name ## _recover, \
.dump = rvu_ ## _name ## _dump, \
}
enum npa_af_rvu_health {
NPA_AF_RVU_INTR,
NPA_AF_RVU_GEN,
NPA_AF_RVU_ERR,
NPA_AF_RVU_RAS,
};
struct rvu_npa_event_ctx {
u64 npa_af_rvu_int;
u64 npa_af_rvu_gen;
u64 npa_af_rvu_err;
u64 npa_af_rvu_ras;
};
struct rvu_npa_health_reporters {
struct rvu_npa_event_ctx *npa_event_ctx;
struct devlink_health_reporter *rvu_hw_npa_intr_reporter;
struct work_struct intr_work;
struct devlink_health_reporter *rvu_hw_npa_gen_reporter;
struct work_struct gen_work;
struct devlink_health_reporter *rvu_hw_npa_err_reporter;
struct work_struct err_work;
struct devlink_health_reporter *rvu_hw_npa_ras_reporter;
struct work_struct ras_work;
};
enum nix_af_rvu_health {
NIX_AF_RVU_INTR,
NIX_AF_RVU_GEN,
NIX_AF_RVU_ERR,
NIX_AF_RVU_RAS,
};
struct rvu_nix_event_ctx {
u64 nix_af_rvu_int;
u64 nix_af_rvu_gen;
u64 nix_af_rvu_err;
u64 nix_af_rvu_ras;
};
struct rvu_nix_health_reporters {
struct rvu_nix_event_ctx *nix_event_ctx;
struct devlink_health_reporter *rvu_hw_nix_intr_reporter;
struct work_struct intr_work;
struct devlink_health_reporter *rvu_hw_nix_gen_reporter;
struct work_struct gen_work;
struct devlink_health_reporter *rvu_hw_nix_err_reporter;
struct work_struct err_work;
struct devlink_health_reporter *rvu_hw_nix_ras_reporter;
struct work_struct ras_work;
};
struct rvu_devlink {
struct devlink *dl;
struct rvu *rvu;
struct workqueue_struct *devlink_wq;
struct rvu_npa_health_reporters *rvu_npa_health_reporter;
struct rvu_nix_health_reporters *rvu_nix_health_reporter;
};
/* Devlink APIs */
int rvu_register_dl(struct rvu *rvu);
void rvu_unregister_dl(struct rvu *rvu);
#endif /* RVU_DEVLINK_H */