diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2023-10-14 00:00:47 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-10-14 00:00:47 +0300 |
commit | af46076d6640a5404ed65e1160df810fed54e7ac (patch) | |
tree | d09d2b4dd3dea71595a93578943433aedbf21672 /drivers/scsi | |
parent | 949189a567f2b1b47aba494f08215ca9dfd6a9a5 (diff) | |
parent | 8a9a690b5ad50aba9456f4853dca18ff4974cb55 (diff) | |
download | linux-af46076d6640a5404ed65e1160df810fed54e7ac.tar.xz |
Merge patch series "lpfc: Update lpfc to revision 14.2.0.15"
Justin Tee <justintee8345@gmail.com> 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/20231009161812.97232-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 23 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 8 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_logmsg.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nportdisc.c | 18 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nvme.c | 6 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_version.h | 2 |
7 files changed, 48 insertions, 15 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 54e47f268235..f9627eddab08 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -131,6 +131,15 @@ lpfc_els_chk_latt(struct lpfc_vport *vport) return 1; } +static bool lpfc_is_els_acc_rsp(struct lpfc_dmabuf *buf) +{ + struct fc_els_ls_acc *rsp = buf->virt; + + if (rsp && rsp->la_cmd == ELS_LS_ACC) + return true; + return false; +} + /** * lpfc_prep_els_iocb - Allocate and prepare a lpfc iocb data structure * @vport: pointer to a host virtual N_Port data structure. @@ -1107,6 +1116,8 @@ stop_rr_fcf_flogi: prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list); if (!prsp) goto out; + if (!lpfc_is_els_acc_rsp(prsp)) + goto out; sp = prsp->virt + sizeof(uint32_t); /* FLOGI completes successfully */ @@ -2119,6 +2130,10 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /* Good status, call state machine */ prsp = list_entry(cmdiocb->cmd_dmabuf->list.next, struct lpfc_dmabuf, list); + if (!prsp) + goto out; + if (!lpfc_is_els_acc_rsp(prsp)) + goto out; ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp); sp = (struct serv_parm *)((u8 *)prsp->virt + @@ -3445,6 +3460,8 @@ lpfc_cmpl_els_disc_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, prdf = (struct lpfc_els_rdf_rsp *)prsp->virt; if (!prdf) goto out; + if (!lpfc_is_els_acc_rsp(prsp)) + goto out; for (i = 0; i < ELS_RDF_REG_TAG_CNT && 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, edc_rsp->acc_hdr.la_cmd, be32_to_cpu(edc_rsp->desc_list_len)); + if (!lpfc_is_els_acc_rsp(prsp)) + goto out; + /* * Payload length in bytes is the response descriptor list * 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, prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list); if (!prsp) goto out; + if (!lpfc_is_els_acc_rsp(prsp)) + goto out; + sp = prsp->virt + sizeof(uint32_t); fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp); memcpy(&vport->fabric_portname, &sp->portName, diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 5154eeaee0ec..7ef9841f0728 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -5654,7 +5654,7 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) ((uint32_t)ndlp->nlp_xri << 16) | ((uint32_t)ndlp->nlp_type << 8) ); - lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, "0929 FIND node DID " "Data: x%px x%x x%x x%x x%x x%px\n", ndlp, ndlp->nlp_DID, @@ -5701,8 +5701,8 @@ lpfc_findnode_mapped(struct lpfc_vport *vport) ((uint32_t)ndlp->nlp_type << 8) | ((uint32_t)ndlp->nlp_rpi & 0xff)); spin_unlock_irqrestore(shost->host_lock, iflags); - lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, - "2025 FIND node DID " + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, + "2025 FIND node DID MAPPED " "Data: x%px x%x x%x x%x x%px\n", ndlp, ndlp->nlp_DID, ndlp->nlp_flag, data1, @@ -6468,7 +6468,7 @@ __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { if (filter(ndlp, param)) { - lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, + lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, "3185 FIND node filter %ps DID " "ndlp x%px did x%x flg x%x st x%x " "xri x%x type x%x rpi x%x\n", diff --git a/drivers/scsi/lpfc/lpfc_logmsg.h b/drivers/scsi/lpfc/lpfc_logmsg.h index f896ec610433..59bd2bafc73f 100644 --- a/drivers/scsi/lpfc/lpfc_logmsg.h +++ b/drivers/scsi/lpfc/lpfc_logmsg.h @@ -25,7 +25,7 @@ #define LOG_MBOX 0x00000004 /* Mailbox events */ #define LOG_INIT 0x00000008 /* Initialization events */ #define LOG_LINK_EVENT 0x00000010 /* Link events */ -#define LOG_IP 0x00000020 /* IP traffic history */ +#define LOG_NODE_VERBOSE 0x00000020 /* Node verbose events */ #define LOG_FCP 0x00000040 /* FCP traffic history */ #define LOG_NODE 0x00000080 /* Node table events */ #define LOG_TEMP 0x00000100 /* Temperature sensor events */ diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 1eb7f7e60bba..d9074929fbab 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -934,25 +934,35 @@ lpfc_rcv_prli_support_check(struct lpfc_vport *vport, struct ls_rjt stat; uint32_t *payload; uint32_t cmd; + PRLI *npr; payload = cmdiocb->cmd_dmabuf->virt; cmd = *payload; + npr = (PRLI *)((uint8_t *)payload + sizeof(uint32_t)); + if (vport->phba->nvmet_support) { /* Must be a NVME PRLI */ - if (cmd == ELS_CMD_PRLI) + if (cmd == ELS_CMD_PRLI) goto out; } else { /* Initiator mode. */ if (!vport->nvmei_support && (cmd == ELS_CMD_NVMEPRLI)) goto out; + + /* NPIV ports will RJT initiator only functions */ + if (vport->port_type == LPFC_NPIV_PORT && + npr->initiatorFunc && !npr->targetFunc) + goto out; } return 1; out: - lpfc_printf_vlog(vport, KERN_WARNING, LOG_NVME_DISC, + lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, "6115 Rcv PRLI (%x) check failed: ndlp rpi %d " - "state x%x flags x%x\n", + "state x%x flags x%x port_type: x%x " + "npr->initfcn: x%x npr->tgtfcn: x%x\n", cmd, ndlp->nlp_rpi, ndlp->nlp_state, - ndlp->nlp_flag); + ndlp->nlp_flag, vport->port_type, + npr->initiatorFunc, npr->targetFunc); memset(&stat, 0, sizeof(struct ls_rjt)); stat.un.b.lsRjtRsnCode = LSRJT_CMD_UNSUPPORTED; stat.un.b.lsRjtRsnCodeExp = LSEXP_REQ_UNSUPPORTED; diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 96e11a26c297..128fc1bab586 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -950,7 +950,7 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, #ifdef CONFIG_SCSI_LPFC_DEBUG_FS int cpu; #endif - int offline = 0; + bool offline = false; /* Sanity check on return of outstanding command */ if (!lpfc_ncmd) { @@ -1124,7 +1124,9 @@ out_err: nCmd->transferred_length = 0; nCmd->rcv_rsplen = 0; nCmd->status = NVME_SC_INTERNAL; - offline = pci_channel_offline(vport->phba->pcidev); + if (pci_channel_offline(vport->phba->pcidev) || + lpfc_ncmd->result == IOERR_SLI_DOWN) + offline = true; } } diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 4dfadf254a72..9386e7b44750 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -8571,12 +8571,10 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) * is not fatal as the driver will use generic values. */ rc = lpfc_parse_vpd(phba, vpd, vpd_size); - if (unlikely(!rc)) { + if (unlikely(!rc)) lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "0377 Error %d parsing vpd. " "Using defaults.\n", rc); - rc = 0; - } kfree(vpd); /* Save information as VPD data */ diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 13a547277f97..88068834cab9 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.2.0.14" +#define LPFC_DRIVER_VERSION "14.2.0.15" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ |