lpfc: Update lpfc to revision 14.2.0.15
Subsystems (2)
cover lpfc: Update lpfc to revision 14.2.0.15
From: Justin Tee <[email protected]>
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.
Justin Tee (6):
lpfc: Remove unnecessary zero return code assignment in
lpfc_sli4_hba_setup
lpfc: Treat IOERR_SLI_DOWN I/O completion status the same as pci
offline
lpfc: Reject received PRLIs with only initiator fcn role for NPIV
ports
lpfc: Validate ELS LS_ACC completion payload
lpfc: Introduce LOG_NODE_VERBOSE messaging flag
lpfc: Update lpfc version to 14.2.0.15
drivers/scsi/lpfc/lpfc_els.c | 23 +++++++++++++++++++++++ drivers/scsi/lpfc/lpfc_hbadisc.c | 8 ++++---- drivers/scsi/lpfc/lpfc_logmsg.h | 2 +- drivers/scsi/lpfc/lpfc_nportdisc.c | 18 ++++++++++++++---- drivers/scsi/lpfc/lpfc_nvme.c | 6 ++++-- drivers/scsi/lpfc/lpfc_sli.c | 4 +--- drivers/scsi/lpfc/lpfc_version.h | 2 +- 7 files changed, 48 insertions(+), 15 deletions(-)
Signature · 1 line
2.38.0
PATCH 1/6 lpfc: Remove unnecessary zero return code assignment in lpfc_sli4_hba_setup
In order to enter the !rc if statement block in question, rc had to have been zero to begin with. Thus, the rc = 0 assignment is unnecessary and can be removed.
--- drivers/scsi/lpfc/lpfc_sli.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/lpfc/lpfc_sli.c +1 -3
@@ -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 */
Signature · 1 line
2.38.0
PATCH 2/6 lpfc: Treat IOERR_SLI_DOWN I/O completion status the same as pci offline
In reply to Justin TeeDuring receipt of a hardware error attention ACQE, IOERR_SLI_DOWN status is set by the driver for all outstanding I/Os.
In such hardware error attention cases, we can treat the situation exactly the same as pci_channel_offline. Thus, add IOERR_SLI_DOWN status to the same category as pci_channel_offline handling in lpfc_nvme_io_cmd_cmpl.
--- drivers/scsi/lpfc/lpfc_nvme.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_nvme.c +4 -2
@@ -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 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, 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; } }
Signature · 1 line
2.38.0
PATCH 3/6 lpfc: Reject received PRLIs with only initiator fcn role for NPIV ports
In reply to Justin TeeCurrently, NPIV ports send PRLI_ACC to all received unsolicited PRLI requests. For an NPIV port, there is no point to PRLI_ACC if the received PRLI request has the initiator function bit set and the target function bit unset. Modify the lpfc_rcv_prli_support_check routine to send a PRLI_RJT in such cases. NPIV ports are expected to send PRLI_ACC only if the Target function bit is set.
--- drivers/scsi/lpfc/lpfc_nportdisc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/scsi/lpfc/lpfc_nportdisc.c +14 -4
@@ -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 ;
Signature · 1 line
2.38.0
PATCH 4/6 lpfc: Validate ELS LS_ACC completion payload
In reply to Justin TeeA WCQE success completion status does not guarantee valid LS_ACC receipt for ELS commands. So, introduce a small helper routine that validates ELS LS_ACC frames in ELS cmpl routines.
--- drivers/scsi/lpfc/lpfc_els.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/scsi/lpfc/lpfc_els.c +23 -0
@@ -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 @@ lpfc_cmpl_els_flogi(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 );/* 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,
Signature · 1 line
2.38.0
PATCH 5/6 lpfc: Introduce LOG_NODE_VERBOSE messaging flag
In reply to Justin TeeThe preexisting LOG_NODE message flag frequently spams a subset of the same log messages during normal FC driver operations. When analyzing driver logs, this sometimes leads to difficulty in troubleshooting.
Because LOG_IP log message flag is unused, convert it to a new LOG_NODE_VERBOSE flag. The LOG_NODE_VERBOSE shall specifically be used for diagnosing issues that require precise ndlp tracking detail.
--- drivers/scsi/lpfc/lpfc_hbadisc.c | 8 ++++---- drivers/scsi/lpfc/lpfc_logmsg.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/lpfc/lpfc_hbadisc.c +4 -4
@@ -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",
drivers/scsi/lpfc/lpfc_logmsg.h +1 -1
@@ -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 */
Signature · 1 line
2.38.0
PATCH 6/6 lpfc: Update lpfc version to 14.2.0.15
In reply to Justin TeeUpdate lpfc version to 14.2.0.15
--- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_version.h +1 -1
@@ -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 */
Signature · 1 line
2.38.0
Martin K. Petersen
AppliedJustin,
Quoted 4 lines
Update lpfc to revision 14.2.0.15
This patch set contains error handling fixes, ELS bug fixes, and logging improvements.
Applied to 6.7/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 8 lines · Justin Tee
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.
[...]
Applied to 6.7/scsi-queue, thanks!
[1/6] lpfc: Remove unnecessary zero return code assignment in lpfc_sli4_hba_setup
https://git.kernel.org/mkp/scsi/c/0506814609fb [2/6] lpfc: Treat IOERR_SLI_DOWN I/O completion status the same as pci offline https://git.kernel.org/mkp/scsi/c/d472a76603d8 [3/6] lpfc: Reject received PRLIs with only initiator fcn role for NPIV ports https://git.kernel.org/mkp/scsi/c/12e896c74280 [4/6] lpfc: Validate ELS LS_ACC completion payload https://git.kernel.org/mkp/scsi/c/a3c3c0a806f1 [5/6] lpfc: Introduce LOG_NODE_VERBOSE messaging flag https://git.kernel.org/mkp/scsi/c/41c831bbb0f2 [6/6] lpfc: Update lpfc version to 14.2.0.15 https://git.kernel.org/mkp/scsi/c/8a9a690b5ad5
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering