Commit c27aad00 authored by Jakub Byczkowski's avatar Jakub Byczkowski Committed by Doug Ledford

IB/hfi1: Modify logging frequency of DCC errors

Use rate-limit state to limit number of messages logged
to kernel message buffer for DCC errors. Add new macro
dd_dev_info_ratelimited for that propose. Replace all
dd_dev_info calls in handle_dcc_err function with
rate-limited version.
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJakub Byczkowski <jakub.byczkowski@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent f9215b5e
...@@ -7827,7 +7827,8 @@ static void handle_dcc_err(struct hfi1_devdata *dd, u32 unused, u64 reg) ...@@ -7827,7 +7827,8 @@ static void handle_dcc_err(struct hfi1_devdata *dd, u32 unused, u64 reg)
} }
/* just report this */ /* just report this */
dd_dev_info(dd, "DCC Error: fmconfig error: %s\n", extra); dd_dev_info_ratelimited(dd, "DCC Error: fmconfig error: %s\n",
extra);
reg &= ~DCC_ERR_FLG_FMCONFIG_ERR_SMASK; reg &= ~DCC_ERR_FLG_FMCONFIG_ERR_SMASK;
} }
...@@ -7878,34 +7879,35 @@ static void handle_dcc_err(struct hfi1_devdata *dd, u32 unused, u64 reg) ...@@ -7878,34 +7879,35 @@ static void handle_dcc_err(struct hfi1_devdata *dd, u32 unused, u64 reg)
} }
/* just report this */ /* just report this */
dd_dev_info(dd, "DCC Error: PortRcv error: %s\n", extra); dd_dev_info_ratelimited(dd, "DCC Error: PortRcv error: %s\n"
dd_dev_info(dd, " hdr0 0x%llx, hdr1 0x%llx\n", " hdr0 0x%llx, hdr1 0x%llx\n",
hdr0, hdr1); extra, hdr0, hdr1);
reg &= ~DCC_ERR_FLG_RCVPORT_ERR_SMASK; reg &= ~DCC_ERR_FLG_RCVPORT_ERR_SMASK;
} }
if (reg & DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_UC_SMASK) { if (reg & DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_UC_SMASK) {
/* informative only */ /* informative only */
dd_dev_info(dd, "8051 access to LCB blocked\n"); dd_dev_info_ratelimited(dd, "8051 access to LCB blocked\n");
reg &= ~DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_UC_SMASK; reg &= ~DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_UC_SMASK;
} }
if (reg & DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_HOST_SMASK) { if (reg & DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_HOST_SMASK) {
/* informative only */ /* informative only */
dd_dev_info(dd, "host access to LCB blocked\n"); dd_dev_info_ratelimited(dd, "host access to LCB blocked\n");
reg &= ~DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_HOST_SMASK; reg &= ~DCC_ERR_FLG_EN_CSR_ACCESS_BLOCKED_HOST_SMASK;
} }
/* report any remaining errors */ /* report any remaining errors */
if (reg) if (reg)
dd_dev_info(dd, "DCC Error: %s\n", dd_dev_info_ratelimited(dd, "DCC Error: %s\n",
dcc_err_string(buf, sizeof(buf), reg)); dcc_err_string(buf, sizeof(buf), reg));
if (lcl_reason == 0) if (lcl_reason == 0)
lcl_reason = OPA_LINKDOWN_REASON_UNKNOWN; lcl_reason = OPA_LINKDOWN_REASON_UNKNOWN;
if (do_bounce) { if (do_bounce) {
dd_dev_info(dd, "%s: PortErrorAction bounce\n", __func__); dd_dev_info_ratelimited(dd, "%s: PortErrorAction bounce\n",
__func__);
set_link_down_reason(ppd, lcl_reason, 0, lcl_reason); set_link_down_reason(ppd, lcl_reason, 0, lcl_reason);
queue_work(ppd->hfi1_wq, &ppd->link_bounce_work); queue_work(ppd->hfi1_wq, &ppd->link_bounce_work);
} }
......
...@@ -1942,6 +1942,10 @@ static inline u64 hfi1_pkt_base_sdma_integrity(struct hfi1_devdata *dd) ...@@ -1942,6 +1942,10 @@ static inline u64 hfi1_pkt_base_sdma_integrity(struct hfi1_devdata *dd)
dev_info(&(dd)->pcidev->dev, "%s: " fmt, \ dev_info(&(dd)->pcidev->dev, "%s: " fmt, \
get_unit_name((dd)->unit), ##__VA_ARGS__) get_unit_name((dd)->unit), ##__VA_ARGS__)
#define dd_dev_info_ratelimited(dd, fmt, ...) \
dev_info_ratelimited(&(dd)->pcidev->dev, "%s: " fmt, \
get_unit_name((dd)->unit), ##__VA_ARGS__)
#define dd_dev_dbg(dd, fmt, ...) \ #define dd_dev_dbg(dd, fmt, ...) \
dev_dbg(&(dd)->pcidev->dev, "%s: " fmt, \ dev_dbg(&(dd)->pcidev->dev, "%s: " fmt, \
get_unit_name((dd)->unit), ##__VA_ARGS__) get_unit_name((dd)->unit), ##__VA_ARGS__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment