Skip to content

Commit 29a6421

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Modify CGN warning signal calculation based on EDC response
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9852d85 commit 29a6421

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
19321932
union lpfc_wqe128 *wqe;
19331933
struct lpfc_iocbq *sync_buf;
19341934
unsigned long iflags;
1935-
u32 ret_val;
1935+
u32 ret_val, cgn_sig_freq;
19361936
u32 atot, wtot, max;
19371937
u8 warn_sync_period = 0;
19381938

@@ -1987,8 +1987,10 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
19871987
} else if (wtot) {
19881988
if (phba->cgn_reg_signal == EDC_CG_SIG_WARN_ONLY ||
19891989
phba->cgn_reg_signal == EDC_CG_SIG_WARN_ALARM) {
1990+
cgn_sig_freq = phba->cgn_sig_freq ? phba->cgn_sig_freq :
1991+
lpfc_fabric_cgn_frequency;
19901992
/* We hit an Signal warning condition */
1991-
max = LPFC_SEC_TO_MSEC / lpfc_fabric_cgn_frequency *
1993+
max = LPFC_SEC_TO_MSEC / cgn_sig_freq *
19921994
lpfc_acqe_cgn_frequency;
19931995
bf_set(cmf_sync_wsigmax, &wqe->cmf_sync, max);
19941996
bf_set(cmf_sync_wsigcnt, &wqe->cmf_sync, wtot);

0 commit comments

Comments
 (0)