Skip to content

Commit af46076

Browse files
Merge patch series "lpfc: Update lpfc to revision 14.2.0.15"
Justin Tee <[email protected]> says: Update lpfc to revision 14.2.0.15 This patch set contains error handling fixes, ELS bug fixes, and logging improvements. The patches were cut against Martin's 6.7/scsi-queue tree. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 949189a + 8a9a690 commit af46076

File tree

7 files changed

+48
-15
lines changed

7 files changed

+48
-15
lines changed

Diff for: drivers/scsi/lpfc/lpfc_els.c

+23
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ lpfc_els_chk_latt(struct lpfc_vport *vport)
131131
return 1;
132132
}
133133

134+
static bool lpfc_is_els_acc_rsp(struct lpfc_dmabuf *buf)
135+
{
136+
struct fc_els_ls_acc *rsp = buf->virt;
137+
138+
if (rsp && rsp->la_cmd == ELS_LS_ACC)
139+
return true;
140+
return false;
141+
}
142+
134143
/**
135144
* lpfc_prep_els_iocb - Allocate and prepare a lpfc iocb data structure
136145
* @vport: pointer to a host virtual N_Port data structure.
@@ -1107,6 +1116,8 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11071116
prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
11081117
if (!prsp)
11091118
goto out;
1119+
if (!lpfc_is_els_acc_rsp(prsp))
1120+
goto out;
11101121
sp = prsp->virt + sizeof(uint32_t);
11111122

11121123
/* FLOGI completes successfully */
@@ -2119,6 +2130,10 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
21192130
/* Good status, call state machine */
21202131
prsp = list_entry(cmdiocb->cmd_dmabuf->list.next,
21212132
struct lpfc_dmabuf, list);
2133+
if (!prsp)
2134+
goto out;
2135+
if (!lpfc_is_els_acc_rsp(prsp))
2136+
goto out;
21222137
ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp);
21232138

21242139
sp = (struct serv_parm *)((u8 *)prsp->virt +
@@ -3445,6 +3460,8 @@ lpfc_cmpl_els_disc_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
34453460
prdf = (struct lpfc_els_rdf_rsp *)prsp->virt;
34463461
if (!prdf)
34473462
goto out;
3463+
if (!lpfc_is_els_acc_rsp(prsp))
3464+
goto out;
34483465

34493466
for (i = 0; i < ELS_RDF_REG_TAG_CNT &&
34503467
i < be32_to_cpu(prdf->reg_d1.reg_desc.count); i++)
@@ -4043,6 +4060,9 @@ lpfc_cmpl_els_edc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
40434060
edc_rsp->acc_hdr.la_cmd,
40444061
be32_to_cpu(edc_rsp->desc_list_len));
40454062

4063+
if (!lpfc_is_els_acc_rsp(prsp))
4064+
goto out;
4065+
40464066
/*
40474067
* Payload length in bytes is the response descriptor list
40484068
* length minus the 12 bytes of Link Service Request
@@ -11339,6 +11359,9 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1133911359
prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
1134011360
if (!prsp)
1134111361
goto out;
11362+
if (!lpfc_is_els_acc_rsp(prsp))
11363+
goto out;
11364+
1134211365
sp = prsp->virt + sizeof(uint32_t);
1134311366
fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp);
1134411367
memcpy(&vport->fabric_portname, &sp->portName,

Diff for: drivers/scsi/lpfc/lpfc_hbadisc.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -5654,7 +5654,7 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
56545654
((uint32_t)ndlp->nlp_xri << 16) |
56555655
((uint32_t)ndlp->nlp_type << 8)
56565656
);
5657-
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
5657+
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE,
56585658
"0929 FIND node DID "
56595659
"Data: x%px x%x x%x x%x x%x x%px\n",
56605660
ndlp, ndlp->nlp_DID,
@@ -5701,8 +5701,8 @@ lpfc_findnode_mapped(struct lpfc_vport *vport)
57015701
((uint32_t)ndlp->nlp_type << 8) |
57025702
((uint32_t)ndlp->nlp_rpi & 0xff));
57035703
spin_unlock_irqrestore(shost->host_lock, iflags);
5704-
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
5705-
"2025 FIND node DID "
5704+
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE,
5705+
"2025 FIND node DID MAPPED "
57065706
"Data: x%px x%x x%x x%x x%px\n",
57075707
ndlp, ndlp->nlp_DID,
57085708
ndlp->nlp_flag, data1,
@@ -6468,7 +6468,7 @@ __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param)
64686468

64696469
list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
64706470
if (filter(ndlp, param)) {
6471-
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
6471+
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE,
64726472
"3185 FIND node filter %ps DID "
64736473
"ndlp x%px did x%x flg x%x st x%x "
64746474
"xri x%x type x%x rpi x%x\n",

Diff for: drivers/scsi/lpfc/lpfc_logmsg.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define LOG_MBOX 0x00000004 /* Mailbox events */
2626
#define LOG_INIT 0x00000008 /* Initialization events */
2727
#define LOG_LINK_EVENT 0x00000010 /* Link events */
28-
#define LOG_IP 0x00000020 /* IP traffic history */
28+
#define LOG_NODE_VERBOSE 0x00000020 /* Node verbose events */
2929
#define LOG_FCP 0x00000040 /* FCP traffic history */
3030
#define LOG_NODE 0x00000080 /* Node table events */
3131
#define LOG_TEMP 0x00000100 /* Temperature sensor events */

Diff for: drivers/scsi/lpfc/lpfc_nportdisc.c

+14-4
Original file line numberDiff line numberDiff line change
@@ -934,25 +934,35 @@ lpfc_rcv_prli_support_check(struct lpfc_vport *vport,
934934
struct ls_rjt stat;
935935
uint32_t *payload;
936936
uint32_t cmd;
937+
PRLI *npr;
937938

938939
payload = cmdiocb->cmd_dmabuf->virt;
939940
cmd = *payload;
941+
npr = (PRLI *)((uint8_t *)payload + sizeof(uint32_t));
942+
940943
if (vport->phba->nvmet_support) {
941944
/* Must be a NVME PRLI */
942-
if (cmd == ELS_CMD_PRLI)
945+
if (cmd == ELS_CMD_PRLI)
943946
goto out;
944947
} else {
945948
/* Initiator mode. */
946949
if (!vport->nvmei_support && (cmd == ELS_CMD_NVMEPRLI))
947950
goto out;
951+
952+
/* NPIV ports will RJT initiator only functions */
953+
if (vport->port_type == LPFC_NPIV_PORT &&
954+
npr->initiatorFunc && !npr->targetFunc)
955+
goto out;
948956
}
949957
return 1;
950958
out:
951-
lpfc_printf_vlog(vport, KERN_WARNING, LOG_NVME_DISC,
959+
lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY,
952960
"6115 Rcv PRLI (%x) check failed: ndlp rpi %d "
953-
"state x%x flags x%x\n",
961+
"state x%x flags x%x port_type: x%x "
962+
"npr->initfcn: x%x npr->tgtfcn: x%x\n",
954963
cmd, ndlp->nlp_rpi, ndlp->nlp_state,
955-
ndlp->nlp_flag);
964+
ndlp->nlp_flag, vport->port_type,
965+
npr->initiatorFunc, npr->targetFunc);
956966
memset(&stat, 0, sizeof(struct ls_rjt));
957967
stat.un.b.lsRjtRsnCode = LSRJT_CMD_UNSUPPORTED;
958968
stat.un.b.lsRjtRsnCodeExp = LSEXP_REQ_UNSUPPORTED;

Diff for: drivers/scsi/lpfc/lpfc_nvme.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
950950
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
951951
int cpu;
952952
#endif
953-
int offline = 0;
953+
bool offline = false;
954954

955955
/* Sanity check on return of outstanding command */
956956
if (!lpfc_ncmd) {
@@ -1124,7 +1124,9 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
11241124
nCmd->transferred_length = 0;
11251125
nCmd->rcv_rsplen = 0;
11261126
nCmd->status = NVME_SC_INTERNAL;
1127-
offline = pci_channel_offline(vport->phba->pcidev);
1127+
if (pci_channel_offline(vport->phba->pcidev) ||
1128+
lpfc_ncmd->result == IOERR_SLI_DOWN)
1129+
offline = true;
11281130
}
11291131
}
11301132

Diff for: drivers/scsi/lpfc/lpfc_sli.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -8571,12 +8571,10 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
85718571
* is not fatal as the driver will use generic values.
85728572
*/
85738573
rc = lpfc_parse_vpd(phba, vpd, vpd_size);
8574-
if (unlikely(!rc)) {
8574+
if (unlikely(!rc))
85758575
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
85768576
"0377 Error %d parsing vpd. "
85778577
"Using defaults.\n", rc);
8578-
rc = 0;
8579-
}
85808578
kfree(vpd);
85818579

85828580
/* Save information as VPD data */

Diff for: drivers/scsi/lpfc/lpfc_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* included with this package. *
2121
*******************************************************************/
2222

23-
#define LPFC_DRIVER_VERSION "14.2.0.14"
23+
#define LPFC_DRIVER_VERSION "14.2.0.15"
2424
#define LPFC_DRIVER_NAME "lpfc"
2525

2626
/* Used for SLI 2/3 */

0 commit comments

Comments
 (0)