]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: lpfc: Modify CGN warning signal calculation based on EDC response
authorJustin Tee <justin.tee@broadcom.com>
Thu, 31 Oct 2024 22:32:09 +0000 (15:32 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 3 Nov 2024 01:45:23 +0000 (21:45 -0400)
CGN warning signals are currently statically fixed to a passed in driver
parameter called lpfc_fabric_cgn_frequency.  However, CGN frequency
should be more correctly based on EDC responses from the fabric when
available.  Otherwise, still allow the driver to fall back on user
configured lpfc_fabric_cgn_frequency driver parameter.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20241031223219.152342-2-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 2ec6e55771b45ab70320a9ad1934d5ead2371d4c..80a43fd40af26e52a2fe8c3cd723814035ead275 100644 (file)
@@ -1932,7 +1932,7 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
        union lpfc_wqe128 *wqe;
        struct lpfc_iocbq *sync_buf;
        unsigned long iflags;
-       u32 ret_val;
+       u32 ret_val, cgn_sig_freq;
        u32 atot, wtot, max;
        u8 warn_sync_period = 0;
 
@@ -1987,8 +1987,10 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
        } else if (wtot) {
                if (phba->cgn_reg_signal == EDC_CG_SIG_WARN_ONLY ||
                    phba->cgn_reg_signal == EDC_CG_SIG_WARN_ALARM) {
+                       cgn_sig_freq = phba->cgn_sig_freq ? phba->cgn_sig_freq :
+                                       lpfc_fabric_cgn_frequency;
                        /* We hit an Signal warning condition */
-                       max = LPFC_SEC_TO_MSEC / lpfc_fabric_cgn_frequency *
+                       max = LPFC_SEC_TO_MSEC / cgn_sig_freq *
                                lpfc_acqe_cgn_frequency;
                        bf_set(cmf_sync_wsigmax, &wqe->cmf_sync, max);
                        bf_set(cmf_sync_wsigcnt, &wqe->cmf_sync, wtot);