Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: lpfc: Zero CGN stats only during initial driver load and stat reset

Currently congestion management framework results are cleared whenever the
framework settings changed (such as it being turned off then back on). This
unfortunately means prior stats, rolled up to higher time windows lose
meaning.

Change such that stats are not cleared. Thus they pause and resume with
prior values still being considered.

Link: https://lore.kernel.org/r/20210910233159.115896-13-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>

authored by

James Smart and committed by
Martin K. Petersen
afd63fa5 3ea998cb

+4 -4
-2
drivers/scsi/lpfc/lpfc_init.c
··· 13394 13394 atomic_set(&phba->cgn_sync_alarm_cnt, 0); 13395 13395 atomic_set(&phba->cgn_sync_warn_cnt, 0); 13396 13396 13397 - atomic64_set(&phba->cgn_acqe_stat.alarm, 0); 13398 - atomic64_set(&phba->cgn_acqe_stat.warn, 0); 13399 13397 atomic_set(&phba->cgn_driver_evt_cnt, 0); 13400 13398 atomic_set(&phba->cgn_latency_evt_cnt, 0); 13401 13399 atomic64_set(&phba->cgn_latency_evt, 0);
+4 -2
drivers/scsi/lpfc/lpfc_sli.c
··· 7764 7764 7765 7765 /* Zero out Congestion Signal ACQE counter */ 7766 7766 phba->cgn_acqe_cnt = 0; 7767 - atomic64_set(&phba->cgn_acqe_stat.warn, 0); 7768 - atomic64_set(&phba->cgn_acqe_stat.alarm, 0); 7769 7767 7770 7768 acqe = bf_get(lpfc_mbx_set_feature_CGN_acqe_freq, 7771 7769 &pmb->u.mqe.un.set_feature); ··· 8015 8017 /* initialize congestion buffer info */ 8016 8018 lpfc_init_congestion_buf(phba); 8017 8019 lpfc_init_congestion_stat(phba); 8020 + 8021 + /* Zero out Congestion Signal counters */ 8022 + atomic64_set(&phba->cgn_acqe_stat.alarm, 0); 8023 + atomic64_set(&phba->cgn_acqe_stat.warn, 0); 8018 8024 } 8019 8025 8020 8026 rc = lpfc_sli4_cgn_params_read(phba);