0001
0002
0003
0004
0005
0006
0007
0008 #ifndef RVU_DEVLINK_H
0009 #define RVU_DEVLINK_H
0010
0011 #define RVU_REPORTERS(_name) \
0012 static const struct devlink_health_reporter_ops rvu_ ## _name ## _reporter_ops = { \
0013 .name = #_name, \
0014 .recover = rvu_ ## _name ## _recover, \
0015 .dump = rvu_ ## _name ## _dump, \
0016 }
0017
0018 enum npa_af_rvu_health {
0019 NPA_AF_RVU_INTR,
0020 NPA_AF_RVU_GEN,
0021 NPA_AF_RVU_ERR,
0022 NPA_AF_RVU_RAS,
0023 };
0024
0025 struct rvu_npa_event_ctx {
0026 u64 npa_af_rvu_int;
0027 u64 npa_af_rvu_gen;
0028 u64 npa_af_rvu_err;
0029 u64 npa_af_rvu_ras;
0030 };
0031
0032 struct rvu_npa_health_reporters {
0033 struct rvu_npa_event_ctx *npa_event_ctx;
0034 struct devlink_health_reporter *rvu_hw_npa_intr_reporter;
0035 struct work_struct intr_work;
0036 struct devlink_health_reporter *rvu_hw_npa_gen_reporter;
0037 struct work_struct gen_work;
0038 struct devlink_health_reporter *rvu_hw_npa_err_reporter;
0039 struct work_struct err_work;
0040 struct devlink_health_reporter *rvu_hw_npa_ras_reporter;
0041 struct work_struct ras_work;
0042 };
0043
0044 enum nix_af_rvu_health {
0045 NIX_AF_RVU_INTR,
0046 NIX_AF_RVU_GEN,
0047 NIX_AF_RVU_ERR,
0048 NIX_AF_RVU_RAS,
0049 };
0050
0051 struct rvu_nix_event_ctx {
0052 u64 nix_af_rvu_int;
0053 u64 nix_af_rvu_gen;
0054 u64 nix_af_rvu_err;
0055 u64 nix_af_rvu_ras;
0056 };
0057
0058 struct rvu_nix_health_reporters {
0059 struct rvu_nix_event_ctx *nix_event_ctx;
0060 struct devlink_health_reporter *rvu_hw_nix_intr_reporter;
0061 struct work_struct intr_work;
0062 struct devlink_health_reporter *rvu_hw_nix_gen_reporter;
0063 struct work_struct gen_work;
0064 struct devlink_health_reporter *rvu_hw_nix_err_reporter;
0065 struct work_struct err_work;
0066 struct devlink_health_reporter *rvu_hw_nix_ras_reporter;
0067 struct work_struct ras_work;
0068 };
0069
0070 struct rvu_devlink {
0071 struct devlink *dl;
0072 struct rvu *rvu;
0073 struct workqueue_struct *devlink_wq;
0074 struct rvu_npa_health_reporters *rvu_npa_health_reporter;
0075 struct rvu_nix_health_reporters *rvu_nix_health_reporter;
0076 };
0077
0078
0079 int rvu_register_dl(struct rvu *rvu);
0080 void rvu_unregister_dl(struct rvu *rvu);
0081
0082 #endif