Skip to content

Commit e6af452

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Enhance driver logging for selected discovery events
Typically, debugging discovery issues requires the ndlp reference count, nlp flags, transport flags, and the io tag for root cause analysis. Modify important discovery log messages to include one or more of these attributes to aid in debugging and support. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20231031191224.150862-8-justintee8345@gmail.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 349b1e2 commit e6af452

2 files changed

Lines changed: 38 additions & 22 deletions

File tree

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,8 +2062,9 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
20622062
/* PLOGI completes to NPort <nlp_DID> */
20632063
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
20642064
"0102 PLOGI completes to NPort x%06x "
2065-
"Data: x%x x%x x%x x%x x%x\n",
2066-
ndlp->nlp_DID, ndlp->nlp_fc4_type,
2065+
"IoTag x%x Data: x%x x%x x%x x%x x%x\n",
2066+
ndlp->nlp_DID, iotag,
2067+
ndlp->nlp_fc4_type,
20672068
ulp_status, ulp_word4,
20682069
disc, vport->num_disc_nodes);
20692070

@@ -2362,9 +2363,10 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
23622363
/* PRLI completes to NPort <nlp_DID> */
23632364
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
23642365
"0103 PRLI completes to NPort x%06x "
2365-
"Data: x%x x%x x%x x%x\n",
2366+
"Data: x%x x%x x%x x%x x%x\n",
23662367
ndlp->nlp_DID, ulp_status, ulp_word4,
2367-
vport->num_disc_nodes, ndlp->fc4_prli_sent);
2368+
vport->num_disc_nodes, ndlp->fc4_prli_sent,
2369+
ndlp->fc4_xpt_flags);
23682370

23692371
/* Check to see if link went down during discovery */
23702372
if (lpfc_els_chk_latt(vport))
@@ -2805,7 +2807,7 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
28052807
IOCB_t *irsp;
28062808
struct lpfc_nodelist *ndlp;
28072809
int disc;
2808-
u32 ulp_status, ulp_word4, tmo;
2810+
u32 ulp_status, ulp_word4, tmo, iotag;
28092811
bool release_node = false;
28102812

28112813
/* we pass cmdiocb to state machine which needs rspiocb as well */
@@ -2818,9 +2820,11 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
28182820

28192821
if (phba->sli_rev == LPFC_SLI_REV4) {
28202822
tmo = get_wqe_tmo(cmdiocb);
2823+
iotag = get_wqe_reqtag(cmdiocb);
28212824
} else {
28222825
irsp = &rspiocb->iocb;
28232826
tmo = irsp->ulpTimeout;
2827+
iotag = irsp->ulpIoTag;
28242828
}
28252829

28262830
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
@@ -2838,9 +2842,11 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
28382842
/* ADISC completes to NPort <nlp_DID> */
28392843
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
28402844
"0104 ADISC completes to NPort x%x "
2841-
"Data: x%x x%x x%x x%x x%x\n",
2842-
ndlp->nlp_DID, ulp_status, ulp_word4,
2845+
"IoTag x%x Data: x%x x%x x%x x%x x%x\n",
2846+
ndlp->nlp_DID, iotag,
2847+
ulp_status, ulp_word4,
28432848
tmo, disc, vport->num_disc_nodes);
2849+
28442850
/* Check to see if link went down during discovery */
28452851
if (lpfc_els_chk_latt(vport)) {
28462852
spin_lock_irq(&ndlp->lock);
@@ -3001,7 +3007,7 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
30013007
int wake_up_waiter = 0;
30023008
u32 ulp_status;
30033009
u32 ulp_word4;
3004-
u32 tmo;
3010+
u32 tmo, iotag;
30053011

30063012
/* we pass cmdiocb to state machine which needs rspiocb as well */
30073013
cmdiocb->rsp_iocb = rspiocb;
@@ -3011,9 +3017,11 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
30113017

30123018
if (phba->sli_rev == LPFC_SLI_REV4) {
30133019
tmo = get_wqe_tmo(cmdiocb);
3020+
iotag = get_wqe_reqtag(cmdiocb);
30143021
} else {
30153022
irsp = &rspiocb->iocb;
30163023
tmo = irsp->ulpTimeout;
3024+
iotag = irsp->ulpIoTag;
30173025
}
30183026

30193027
spin_lock_irq(&ndlp->lock);
@@ -3032,9 +3040,11 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
30323040
/* LOGO completes to NPort <nlp_DID> */
30333041
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
30343042
"0105 LOGO completes to NPort x%x "
3035-
"refcnt %d nflags x%x Data: x%x x%x x%x x%x\n",
3036-
ndlp->nlp_DID, kref_read(&ndlp->kref), ndlp->nlp_flag,
3037-
ulp_status, ulp_word4,
3043+
"IoTag x%x refcnt %d nflags x%x xflags x%x "
3044+
"Data: x%x x%x x%x x%x\n",
3045+
ndlp->nlp_DID, iotag,
3046+
kref_read(&ndlp->kref), ndlp->nlp_flag,
3047+
ndlp->fc4_xpt_flags, ulp_status, ulp_word4,
30383048
tmo, vport->num_disc_nodes);
30393049

30403050
if (lpfc_els_chk_latt(vport)) {
@@ -5075,16 +5085,19 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
50755085
if (logerr) {
50765086
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
50775087
"0137 No retry ELS command x%x to remote "
5078-
"NPORT x%x: Out of Resources: Error:x%x/%x\n",
5079-
cmd, did, ulp_status,
5080-
ulp_word4);
5088+
"NPORT x%x: Out of Resources: Error:x%x/%x "
5089+
"IoTag x%x\n",
5090+
cmd, did, ulp_status, ulp_word4,
5091+
cmdiocb->iotag);
50815092
}
50825093
else {
50835094
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
5084-
"0108 No retry ELS command x%x to remote "
5085-
"NPORT x%x Retried:%d Error:x%x/%x\n",
5086-
cmd, did, cmdiocb->retry, ulp_status,
5087-
ulp_word4);
5095+
"0108 No retry ELS command x%x to remote "
5096+
"NPORT x%x Retried:%d Error:x%x/%x "
5097+
"IoTag x%x nflags x%x\n",
5098+
cmd, did, cmdiocb->retry, ulp_status,
5099+
ulp_word4, cmdiocb->iotag,
5100+
(ndlp ? ndlp->nlp_flag : 0));
50885101
}
50895102
return 0;
50905103
}

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,8 +2995,9 @@ lpfc_sli4_unreg_rpi_cmpl_clr(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
29952995
LPFC_SLI_INTF_IF_TYPE_2)) {
29962996
if (ndlp) {
29972997
lpfc_printf_vlog(
2998-
vport, KERN_INFO, LOG_MBOX | LOG_SLI,
2999-
"0010 UNREG_LOGIN vpi:%x "
2998+
vport, KERN_INFO,
2999+
LOG_MBOX | LOG_SLI | LOG_NODE,
3000+
"0010 UNREG_LOGIN vpi:x%x "
30003001
"rpi:%x DID:%x defer x%x flg x%x "
30013002
"x%px\n",
30023003
vport->vpi, ndlp->nlp_rpi,
@@ -3012,7 +3013,8 @@ lpfc_sli4_unreg_rpi_cmpl_clr(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
30123013
(ndlp->nlp_defer_did !=
30133014
NLP_EVT_NOTHING_PENDING)) {
30143015
lpfc_printf_vlog(
3015-
vport, KERN_INFO, LOG_DISCOVERY,
3016+
vport, KERN_INFO,
3017+
LOG_MBOX | LOG_SLI | LOG_NODE,
30163018
"4111 UNREG cmpl deferred "
30173019
"clr x%x on "
30183020
"NPort x%x Data: x%x x%px\n",
@@ -10144,11 +10146,12 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
1014410146
spin_unlock_irqrestore(&phba->hbalock, iflags);
1014510147
lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
1014610148
"(%d):0354 Mbox cmd issue - Enqueue Data: "
10147-
"x%x (x%x/x%x) x%x x%x x%x\n",
10149+
"x%x (x%x/x%x) x%x x%x x%x x%x\n",
1014810150
mboxq->vport ? mboxq->vport->vpi : 0xffffff,
1014910151
bf_get(lpfc_mqe_command, &mboxq->u.mqe),
1015010152
lpfc_sli_config_mbox_subsys_get(phba, mboxq),
1015110153
lpfc_sli_config_mbox_opcode_get(phba, mboxq),
10154+
mboxq->u.mb.un.varUnregLogin.rpi,
1015210155
phba->pport->port_state,
1015310156
psli->sli_flag, MBX_NOWAIT);
1015410157
/* Wake up worker thread to transport mailbox command from head */

0 commit comments

Comments
 (0)