scsi: lpfc: Zero CGN stats only during initial driver load and stat reset
authorJames Smart <jsmart2021@gmail.com>
Fri, 10 Sep 2021 23:31:57 +0000 (16:31 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Sep 2021 03:33:21 +0000 (23:33 -0400)
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>
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_sli.c

index d3a2281cb48b4397b3e7b3f7f9ff27752cc4922e..ff2a4e3875236ebf2ee62bfd5cc6e3ceae8050c2 100644 (file)
@@ -13394,8 +13394,6 @@ lpfc_init_congestion_buf(struct lpfc_hba *phba)
        atomic_set(&phba->cgn_sync_alarm_cnt, 0);
        atomic_set(&phba->cgn_sync_warn_cnt, 0);
 
-       atomic64_set(&phba->cgn_acqe_stat.alarm, 0);
-       atomic64_set(&phba->cgn_acqe_stat.warn, 0);
        atomic_set(&phba->cgn_driver_evt_cnt, 0);
        atomic_set(&phba->cgn_latency_evt_cnt, 0);
        atomic64_set(&phba->cgn_latency_evt, 0);
index 651e6ee64e88b4466d39fd0dcb176a2499aa089a..34cf2bfcce07207e68027ae75f2669fb674e56fb 100644 (file)
@@ -7764,8 +7764,6 @@ lpfc_mbx_cmpl_cgn_set_ftrs(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
        /* Zero out Congestion Signal ACQE counter */
        phba->cgn_acqe_cnt = 0;
-       atomic64_set(&phba->cgn_acqe_stat.warn, 0);
-       atomic64_set(&phba->cgn_acqe_stat.alarm, 0);
 
        acqe = bf_get(lpfc_mbx_set_feature_CGN_acqe_freq,
                      &pmb->u.mqe.un.set_feature);
@@ -8017,6 +8015,10 @@ lpfc_cmf_setup(struct lpfc_hba *phba)
                        /* initialize congestion buffer info */
                        lpfc_init_congestion_buf(phba);
                        lpfc_init_congestion_stat(phba);
+
+                       /* Zero out Congestion Signal counters */
+                       atomic64_set(&phba->cgn_acqe_stat.alarm, 0);
+                       atomic64_set(&phba->cgn_acqe_stat.warn, 0);
                }
 
                rc = lpfc_sli4_cgn_params_read(phba);