Skip to content

Commit 359aeb8

Browse files
Merge patch series "Update lpfc to revision 14.4.0.5"
Justin Tee <justintee8345@gmail.com> says: Update lpfc to revision 14.4.0.5 This patch set contains bug fixes related to HBA state clean ups, FCP discovery on older adapters, kref imbalances, log message improvements, and support for a new diagnostic loopback testing mode. The patches were cut against Martin's 6.12/scsi-queue tree. Link: https://lore.kernel.org/r/20240912232447.45607-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents 9547464 + b071c1a commit 359aeb8

File tree

12 files changed

+226
-99
lines changed

12 files changed

+226
-99
lines changed

drivers/scsi/lpfc/lpfc_bsg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3208,6 +3208,9 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
32083208
cmdiocbq->num_bdes = num_bde;
32093209
cmdiocbq->cmd_flag |= LPFC_IO_LIBDFC;
32103210
cmdiocbq->cmd_flag |= LPFC_IO_LOOPBACK;
3211+
if (phba->cfg_vmid_app_header)
3212+
cmdiocbq->cmd_flag |= LPFC_IO_VMID;
3213+
32113214
cmdiocbq->vport = phba->pport;
32123215
cmdiocbq->cmd_cmpl = NULL;
32133216
cmdiocbq->bpl_dmabuf = txbmp;

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,8 +1572,8 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
15721572
}
15731573
}
15741574
} else
1575-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1576-
"3065 GFT_ID failed x%08x\n", ulp_status);
1575+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_DISCOVERY,
1576+
"3065 GFT_ID status x%08x\n", ulp_status);
15771577

15781578
out:
15791579
lpfc_ct_free_iocb(phba, cmdiocb);
@@ -1647,6 +1647,18 @@ lpfc_cmpl_ct(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
16471647
}
16481648

16491649
out:
1650+
/* If the caller wanted a synchronous DA_ID completion, signal the
1651+
* wait obj and clear flag to reset the vport.
1652+
*/
1653+
if (ndlp->save_flags & NLP_WAIT_FOR_DA_ID) {
1654+
if (ndlp->da_id_waitq)
1655+
wake_up(ndlp->da_id_waitq);
1656+
}
1657+
1658+
spin_lock_irq(&ndlp->lock);
1659+
ndlp->save_flags &= ~NLP_WAIT_FOR_DA_ID;
1660+
spin_unlock_irq(&ndlp->lock);
1661+
16501662
lpfc_ct_free_iocb(phba, cmdiocb);
16511663
lpfc_nlp_put(ndlp);
16521664
return;
@@ -2246,7 +2258,7 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22462258
}
22472259

22482260
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2249-
"0229 FDMI cmd %04x failed, latt = %d "
2261+
"0229 FDMI cmd %04x latt = %d "
22502262
"ulp_status: x%x, rid x%x\n",
22512263
be16_to_cpu(fdmi_cmd), latt, ulp_status,
22522264
ulp_word4);
@@ -2263,9 +2275,9 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22632275
/* Check for a CT LS_RJT response */
22642276
cmd = be16_to_cpu(fdmi_cmd);
22652277
if (be16_to_cpu(fdmi_rsp) == SLI_CT_RESPONSE_FS_RJT) {
2266-
/* FDMI rsp failed */
2278+
/* Log FDMI reject */
22672279
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_ELS,
2268-
"0220 FDMI cmd failed FS_RJT Data: x%x", cmd);
2280+
"0220 FDMI cmd FS_RJT Data: x%x", cmd);
22692281

22702282
/* Should we fallback to FDMI-2 / FDMI-1 ? */
22712283
switch (cmd) {

drivers/scsi/lpfc/lpfc_disc.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ enum lpfc_nlp_save_flags {
9090
NLP_IN_RECOV_POST_DEV_LOSS = 0x1,
9191
/* wait for outstanding LOGO to cmpl */
9292
NLP_WAIT_FOR_LOGO = 0x2,
93+
/* wait for outstanding DA_ID to finish */
94+
NLP_WAIT_FOR_DA_ID = 0x4
9395
};
9496

9597
struct lpfc_nodelist {
@@ -159,7 +161,12 @@ struct lpfc_nodelist {
159161
uint32_t nvme_fb_size; /* NVME target's supported byte cnt */
160162
#define NVME_FB_BIT_SHIFT 9 /* PRLI Rsp first burst in 512B units. */
161163
uint32_t nlp_defer_did;
164+
165+
/* These wait objects are NPIV specific. These IOs must complete
166+
* synchronously.
167+
*/
162168
wait_queue_head_t *logo_waitq;
169+
wait_queue_head_t *da_id_waitq;
163170
};
164171

165172
struct lpfc_node_rrq {

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 63 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
979979
phba->fcoe_cvl_eventtag_attn =
980980
phba->fcoe_cvl_eventtag;
981981
lpfc_printf_log(phba, KERN_WARNING, LOG_FIP | LOG_ELS,
982-
"2611 FLOGI failed on FCF (x%x), "
982+
"2611 FLOGI FCF (x%x), "
983983
"status:x%x/x%x, tmo:x%x, perform "
984984
"roundrobin FCF failover\n",
985985
phba->fcf.current_rec.fcf_indx,
@@ -997,11 +997,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
997997
if (!(ulp_status == IOSTAT_LOCAL_REJECT &&
998998
((ulp_word4 & IOERR_PARAM_MASK) ==
999999
IOERR_LOOP_OPEN_FAILURE)))
1000-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1001-
"2858 FLOGI failure Status:x%x/x%x TMO"
1002-
":x%x Data x%lx x%x\n",
1003-
ulp_status, ulp_word4, tmo,
1004-
phba->hba_flag, phba->fcf.fcf_flag);
1000+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
1001+
"2858 FLOGI Status:x%x/x%x TMO"
1002+
":x%x Data x%lx x%x\n",
1003+
ulp_status, ulp_word4, tmo,
1004+
phba->hba_flag, phba->fcf.fcf_flag);
10051005

10061006
/* Check for retry */
10071007
if (lpfc_els_retry(phba, cmdiocb, rspiocb)) {
@@ -1023,7 +1023,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
10231023
lpfc_nlp_put(ndlp);
10241024

10251025
lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS,
1026-
"0150 FLOGI failure Status:x%x/x%x "
1026+
"0150 FLOGI Status:x%x/x%x "
10271027
"xri x%x TMO:x%x refcnt %d\n",
10281028
ulp_status, ulp_word4, cmdiocb->sli4_xritag,
10291029
tmo, kref_read(&ndlp->kref));
@@ -1032,11 +1032,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
10321032
if (!(ulp_status == IOSTAT_LOCAL_REJECT &&
10331033
((ulp_word4 & IOERR_PARAM_MASK) ==
10341034
IOERR_LOOP_OPEN_FAILURE))) {
1035-
/* FLOGI failure */
1036-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1037-
"0100 FLOGI failure Status:x%x/x%x "
1038-
"TMO:x%x\n",
1039-
ulp_status, ulp_word4, tmo);
1035+
/* Warn FLOGI status */
1036+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
1037+
"0100 FLOGI Status:x%x/x%x "
1038+
"TMO:x%x\n",
1039+
ulp_status, ulp_word4, tmo);
10401040
goto flogifail;
10411041
}
10421042

@@ -1964,16 +1964,16 @@ lpfc_cmpl_els_rrq(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
19641964

19651965
if (ulp_status) {
19661966
/* Check for retry */
1967-
/* RRQ failed Don't print the vport to vport rjts */
1967+
/* Warn RRQ status Don't print the vport to vport rjts */
19681968
if (ulp_status != IOSTAT_LS_RJT ||
19691969
(((ulp_word4) >> 16 != LSRJT_INVALID_CMD) &&
19701970
((ulp_word4) >> 16 != LSRJT_UNABLE_TPC)) ||
19711971
(phba)->pport->cfg_log_verbose & LOG_ELS)
1972-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1973-
"2881 RRQ failure DID:%06X Status:"
1974-
"x%x/x%x\n",
1975-
ndlp->nlp_DID, ulp_status,
1976-
ulp_word4);
1972+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
1973+
"2881 RRQ DID:%06X Status:"
1974+
"x%x/x%x\n",
1975+
ndlp->nlp_DID, ulp_status,
1976+
ulp_word4);
19771977
}
19781978

19791979
lpfc_clr_rrq_active(phba, rrq->xritag, rrq);
@@ -2077,16 +2077,16 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
20772077
}
20782078
goto out;
20792079
}
2080-
/* PLOGI failed Don't print the vport to vport rjts */
2080+
/* Warn PLOGI status Don't print the vport to vport rjts */
20812081
if (ulp_status != IOSTAT_LS_RJT ||
20822082
(((ulp_word4) >> 16 != LSRJT_INVALID_CMD) &&
20832083
((ulp_word4) >> 16 != LSRJT_UNABLE_TPC)) ||
20842084
(phba)->pport->cfg_log_verbose & LOG_ELS)
2085-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2086-
"2753 PLOGI failure DID:%06X "
2087-
"Status:x%x/x%x\n",
2088-
ndlp->nlp_DID, ulp_status,
2089-
ulp_word4);
2085+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
2086+
"2753 PLOGI DID:%06X "
2087+
"Status:x%x/x%x\n",
2088+
ndlp->nlp_DID, ulp_status,
2089+
ulp_word4);
20902090

20912091
/* Do not call DSM for lpfc_els_abort'ed ELS cmds */
20922092
if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4))
@@ -2323,7 +2323,6 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
23232323
struct lpfc_vport *vport = cmdiocb->vport;
23242324
struct lpfc_nodelist *ndlp;
23252325
char *mode;
2326-
u32 loglevel;
23272326
u32 ulp_status;
23282327
u32 ulp_word4;
23292328
bool release_node = false;
@@ -2372,17 +2371,14 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
23722371
* could be expected.
23732372
*/
23742373
if (test_bit(FC_FABRIC, &vport->fc_flag) ||
2375-
vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH) {
2376-
mode = KERN_ERR;
2377-
loglevel = LOG_TRACE_EVENT;
2378-
} else {
2374+
vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH)
2375+
mode = KERN_WARNING;
2376+
else
23792377
mode = KERN_INFO;
2380-
loglevel = LOG_ELS;
2381-
}
23822378

2383-
/* PRLI failed */
2384-
lpfc_printf_vlog(vport, mode, loglevel,
2385-
"2754 PRLI failure DID:%06X Status:x%x/x%x, "
2379+
/* Warn PRLI status */
2380+
lpfc_printf_vlog(vport, mode, LOG_ELS,
2381+
"2754 PRLI DID:%06X Status:x%x/x%x, "
23862382
"data: x%x x%x x%x\n",
23872383
ndlp->nlp_DID, ulp_status,
23882384
ulp_word4, ndlp->nlp_state,
@@ -2854,11 +2850,11 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
28542850
}
28552851
goto out;
28562852
}
2857-
/* ADISC failed */
2858-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2859-
"2755 ADISC failure DID:%06X Status:x%x/x%x\n",
2860-
ndlp->nlp_DID, ulp_status,
2861-
ulp_word4);
2853+
/* Warn ADISC status */
2854+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
2855+
"2755 ADISC DID:%06X Status:x%x/x%x\n",
2856+
ndlp->nlp_DID, ulp_status,
2857+
ulp_word4);
28622858
lpfc_disc_state_machine(vport, ndlp, cmdiocb,
28632859
NLP_EVT_CMPL_ADISC);
28642860

@@ -3045,12 +3041,12 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
30453041
* discovery. The PLOGI will retry.
30463042
*/
30473043
if (ulp_status) {
3048-
/* LOGO failed */
3049-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
3050-
"2756 LOGO failure, No Retry DID:%06X "
3051-
"Status:x%x/x%x\n",
3052-
ndlp->nlp_DID, ulp_status,
3053-
ulp_word4);
3044+
/* Warn LOGO status */
3045+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
3046+
"2756 LOGO, No Retry DID:%06X "
3047+
"Status:x%x/x%x\n",
3048+
ndlp->nlp_DID, ulp_status,
3049+
ulp_word4);
30543050

30553051
if (lpfc_error_lost_link(vport, ulp_status, ulp_word4))
30563052
skip_recovery = 1;
@@ -4837,11 +4833,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
48374833
if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) &&
48384834
(cmd == ELS_CMD_FDISC) &&
48394835
(stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){
4840-
lpfc_printf_vlog(vport, KERN_ERR,
4841-
LOG_TRACE_EVENT,
4842-
"0125 FDISC Failed (x%x). "
4843-
"Fabric out of resources\n",
4844-
stat.un.lsRjtError);
4836+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
4837+
"0125 FDISC (x%x). "
4838+
"Fabric out of resources\n",
4839+
stat.un.lsRjtError);
48454840
lpfc_vport_set_state(vport,
48464841
FC_VPORT_NO_FABRIC_RSCS);
48474842
}
@@ -4877,11 +4872,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
48774872
LSEXP_NOTHING_MORE) {
48784873
vport->fc_sparam.cmn.bbRcvSizeMsb &= 0xf;
48794874
retry = 1;
4880-
lpfc_printf_vlog(vport, KERN_ERR,
4881-
LOG_TRACE_EVENT,
4882-
"0820 FLOGI Failed (x%x). "
4883-
"BBCredit Not Supported\n",
4884-
stat.un.lsRjtError);
4875+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
4876+
"0820 FLOGI (x%x). "
4877+
"BBCredit Not Supported\n",
4878+
stat.un.lsRjtError);
48854879
}
48864880
break;
48874881

@@ -4891,11 +4885,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
48914885
((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) ||
48924886
(stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID))
48934887
) {
4894-
lpfc_printf_vlog(vport, KERN_ERR,
4895-
LOG_TRACE_EVENT,
4896-
"0122 FDISC Failed (x%x). "
4897-
"Fabric Detected Bad WWN\n",
4898-
stat.un.lsRjtError);
4888+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
4889+
"0122 FDISC (x%x). "
4890+
"Fabric Detected Bad WWN\n",
4891+
stat.un.lsRjtError);
48994892
lpfc_vport_set_state(vport,
49004893
FC_VPORT_FABRIC_REJ_WWN);
49014894
}
@@ -5355,8 +5348,8 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
53555348
u32 ulp_status, ulp_word4, tmo, did, iotag;
53565349

53575350
if (!vport) {
5358-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
5359-
"3177 ELS response failed\n");
5351+
lpfc_printf_log(phba, KERN_WARNING, LOG_ELS,
5352+
"3177 null vport in ELS rsp\n");
53605353
goto out;
53615354
}
53625355
if (cmdiocb->context_un.mbox)
@@ -9658,11 +9651,12 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
96589651
if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err)
96599652
continue;
96609653

9661-
/* On the ELS ring we can have ELS_REQUESTs or
9662-
* GEN_REQUESTs waiting for a response.
9654+
/* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs,
9655+
* or GEN_REQUESTs waiting for a CQE response.
96639656
*/
96649657
ulp_command = get_job_cmnd(phba, piocb);
9665-
if (ulp_command == CMD_ELS_REQUEST64_CR) {
9658+
if (ulp_command == CMD_ELS_REQUEST64_WQE ||
9659+
ulp_command == CMD_XMIT_ELS_RSP64_WQE) {
96669660
list_add_tail(&piocb->dlist, &abort_list);
96679661

96689662
/* If the link is down when flushing ELS commands
@@ -11327,10 +11321,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1132711321
/* Check for retry */
1132811322
if (lpfc_els_retry(phba, cmdiocb, rspiocb))
1132911323
goto out;
11330-
/* FDISC failed */
11331-
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11332-
"0126 FDISC failed. (x%x/x%x)\n",
11333-
ulp_status, ulp_word4);
11324+
/* Warn FDISC status */
11325+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
11326+
"0126 FDISC cmpl status: x%x/x%x)\n",
11327+
ulp_status, ulp_word4);
1133411328
goto fdisc_failed;
1133511329
}
1133611330

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
527527
* the following lpfc_nlp_put is necessary after fabric node is
528528
* recovered.
529529
*/
530+
spin_lock_irqsave(&ndlp->lock, iflags);
531+
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
532+
spin_unlock_irqrestore(&ndlp->lock, iflags);
530533
if (recovering) {
531534
lpfc_printf_vlog(vport, KERN_INFO,
532535
LOG_DISCOVERY | LOG_NODE,
@@ -539,6 +542,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
539542
spin_lock_irqsave(&ndlp->lock, iflags);
540543
ndlp->save_flags |= NLP_IN_RECOV_POST_DEV_LOSS;
541544
spin_unlock_irqrestore(&ndlp->lock, iflags);
545+
return fcf_inuse;
542546
} else if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) {
543547
/* Fabric node fully recovered before this dev_loss_tmo
544548
* queue work is processed. Thus, ignore the
@@ -552,15 +556,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
552556
ndlp->nlp_DID, kref_read(&ndlp->kref),
553557
ndlp, ndlp->nlp_flag,
554558
vport->port_state);
555-
spin_lock_irqsave(&ndlp->lock, iflags);
556-
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
557-
spin_unlock_irqrestore(&ndlp->lock, iflags);
558559
return fcf_inuse;
559560
}
560561

561-
spin_lock_irqsave(&ndlp->lock, iflags);
562-
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
563-
spin_unlock_irqrestore(&ndlp->lock, iflags);
564562
lpfc_nlp_put(ndlp);
565563
return fcf_inuse;
566564
}

0 commit comments

Comments
 (0)