summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2021-08-16 09:28:56 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2021-08-24 22:56:34 -0400
commit7481811c3ac39498636acdbcc4cab74ae2a1ffe5 (patch)
tree9d4fa5792057a93a5bd692c57989fb8f879ac26e /drivers/scsi/lpfc/lpfc_els.c
parent17b27ac5922454ff7de91cbed458643608c36abc (diff)
scsi: lpfc: Add support for maintaining the cm statistics buffer
Add the logic to move the congestion management and event information into the cmd statistics buffer maintained for the adapter. The update includes rolling up values for the last minute, hour, and day information. Link: https://lore.kernel.org/r/20210816162901.121235-12-jsmart2021@gmail.com Co-developed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index d6e64a6c5c07..0ebe5d7a7697 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -3783,6 +3783,7 @@ lpfc_least_capable_settings(struct lpfc_hba *phba,
u32 rsp_sig_cap = 0, drv_sig_cap = 0;
u32 rsp_sig_freq_cyc = 0, rsp_sig_freq_scale = 0;
struct lpfc_cgn_info *cp;
+ u32 crc;
u16 sig_freq;
/* Get rsp signal and frequency capabilities. */
@@ -3856,6 +3857,8 @@ lpfc_least_capable_settings(struct lpfc_hba *phba,
cp->cgn_alarm_freq = cpu_to_le16(sig_freq);
cp->cgn_warn_freq = cpu_to_le16(sig_freq);
}
+ crc = lpfc_cgn_calc_crc32(cp, LPFC_CGN_INFO_SZ, LPFC_CGN_CRC32_SEED);
+ cp->cgn_info_crc = cpu_to_le32(crc);
return;
out_no_support:
@@ -9539,6 +9542,7 @@ lpfc_els_rcv_fpin_cgn(struct lpfc_hba *phba, struct fc_tlv_desc *tlv)
const char *cgn_sev_str;
u32 cgn_sev;
uint16_t value;
+ u32 crc;
bool nm_log = false;
int rc = 1;
@@ -9601,6 +9605,11 @@ cleanup:
LPFC_CGN_FPIN_WARN)
cp->cgn_warn_freq =
cpu_to_le16(value);
+ crc = lpfc_cgn_calc_crc32
+ (cp,
+ LPFC_CGN_INFO_SZ,
+ LPFC_CGN_CRC32_SEED);
+ cp->cgn_info_crc = cpu_to_le32(crc);
}
/* Don't deliver to upper layer since
@@ -9688,6 +9697,7 @@ lpfc_els_rcv_fpin(struct lpfc_vport *vport, void *p, u32 fpin_length)
/* If descriptor is bad, drop the rest of the data */
return;
}
+ lpfc_cgn_update_stat(phba, dtag);
cnt = be32_to_cpu(tlv->desc_len);
/* Sanity check descriptor length. The desc_len value does not