Commit af46076d authored by Martin K. Petersen's avatar Martin K. Petersen

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.comSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents 949189a5 8a9a690b
...@@ -131,6 +131,15 @@ lpfc_els_chk_latt(struct lpfc_vport *vport) ...@@ -131,6 +131,15 @@ lpfc_els_chk_latt(struct lpfc_vport *vport)
return 1; 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 * lpfc_prep_els_iocb - Allocate and prepare a lpfc iocb data structure
* @vport: pointer to a host virtual N_Port 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, ...@@ -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); prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
if (!prsp) if (!prsp)
goto out; goto out;
if (!lpfc_is_els_acc_rsp(prsp))
goto out;
sp = prsp->virt + sizeof(uint32_t); sp = prsp->virt + sizeof(uint32_t);
/* FLOGI completes successfully */ /* FLOGI completes successfully */
...@@ -2119,6 +2130,10 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -2119,6 +2130,10 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
/* Good status, call state machine */ /* Good status, call state machine */
prsp = list_entry(cmdiocb->cmd_dmabuf->list.next, prsp = list_entry(cmdiocb->cmd_dmabuf->list.next,
struct lpfc_dmabuf, list); 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); ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp);
sp = (struct serv_parm *)((u8 *)prsp->virt + sp = (struct serv_parm *)((u8 *)prsp->virt +
...@@ -3445,6 +3460,8 @@ lpfc_cmpl_els_disc_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -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; prdf = (struct lpfc_els_rdf_rsp *)prsp->virt;
if (!prdf) if (!prdf)
goto out; goto out;
if (!lpfc_is_els_acc_rsp(prsp))
goto out;
for (i = 0; i < ELS_RDF_REG_TAG_CNT && for (i = 0; i < ELS_RDF_REG_TAG_CNT &&
i < be32_to_cpu(prdf->reg_d1.reg_desc.count); i++) 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, ...@@ -4043,6 +4060,9 @@ lpfc_cmpl_els_edc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
edc_rsp->acc_hdr.la_cmd, edc_rsp->acc_hdr.la_cmd,
be32_to_cpu(edc_rsp->desc_list_len)); 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 * Payload length in bytes is the response descriptor list
* length minus the 12 bytes of Link Service Request * 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, ...@@ -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); prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
if (!prsp) if (!prsp)
goto out; goto out;
if (!lpfc_is_els_acc_rsp(prsp))
goto out;
sp = prsp->virt + sizeof(uint32_t); sp = prsp->virt + sizeof(uint32_t);
fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp); fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp);
memcpy(&vport->fabric_portname, &sp->portName, memcpy(&vport->fabric_portname, &sp->portName,
......
...@@ -5654,7 +5654,7 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) ...@@ -5654,7 +5654,7 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
((uint32_t)ndlp->nlp_xri << 16) | ((uint32_t)ndlp->nlp_xri << 16) |
((uint32_t)ndlp->nlp_type << 8) ((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 " "0929 FIND node DID "
"Data: x%px x%x x%x x%x x%x x%px\n", "Data: x%px x%x x%x x%x x%x x%px\n",
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
...@@ -5701,8 +5701,8 @@ lpfc_findnode_mapped(struct lpfc_vport *vport) ...@@ -5701,8 +5701,8 @@ lpfc_findnode_mapped(struct lpfc_vport *vport)
((uint32_t)ndlp->nlp_type << 8) | ((uint32_t)ndlp->nlp_type << 8) |
((uint32_t)ndlp->nlp_rpi & 0xff)); ((uint32_t)ndlp->nlp_rpi & 0xff));
spin_unlock_irqrestore(shost->host_lock, iflags); spin_unlock_irqrestore(shost->host_lock, iflags);
lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE,
"2025 FIND node DID " "2025 FIND node DID MAPPED "
"Data: x%px x%x x%x x%x x%px\n", "Data: x%px x%x x%x x%x x%px\n",
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1, ndlp->nlp_flag, data1,
...@@ -6468,7 +6468,7 @@ __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) ...@@ -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) { list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
if (filter(ndlp, param)) { 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 " "3185 FIND node filter %ps DID "
"ndlp x%px did x%x flg x%x st x%x " "ndlp x%px did x%x flg x%x st x%x "
"xri x%x type x%x rpi x%x\n", "xri x%x type x%x rpi x%x\n",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define LOG_MBOX 0x00000004 /* Mailbox events */ #define LOG_MBOX 0x00000004 /* Mailbox events */
#define LOG_INIT 0x00000008 /* Initialization events */ #define LOG_INIT 0x00000008 /* Initialization events */
#define LOG_LINK_EVENT 0x00000010 /* Link 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_FCP 0x00000040 /* FCP traffic history */
#define LOG_NODE 0x00000080 /* Node table events */ #define LOG_NODE 0x00000080 /* Node table events */
#define LOG_TEMP 0x00000100 /* Temperature sensor events */ #define LOG_TEMP 0x00000100 /* Temperature sensor events */
......
...@@ -934,25 +934,35 @@ lpfc_rcv_prli_support_check(struct lpfc_vport *vport, ...@@ -934,25 +934,35 @@ lpfc_rcv_prli_support_check(struct lpfc_vport *vport,
struct ls_rjt stat; struct ls_rjt stat;
uint32_t *payload; uint32_t *payload;
uint32_t cmd; uint32_t cmd;
PRLI *npr;
payload = cmdiocb->cmd_dmabuf->virt; payload = cmdiocb->cmd_dmabuf->virt;
cmd = *payload; cmd = *payload;
npr = (PRLI *)((uint8_t *)payload + sizeof(uint32_t));
if (vport->phba->nvmet_support) { if (vport->phba->nvmet_support) {
/* Must be a NVME PRLI */ /* Must be a NVME PRLI */
if (cmd == ELS_CMD_PRLI) if (cmd == ELS_CMD_PRLI)
goto out; goto out;
} else { } else {
/* Initiator mode. */ /* Initiator mode. */
if (!vport->nvmei_support && (cmd == ELS_CMD_NVMEPRLI)) if (!vport->nvmei_support && (cmd == ELS_CMD_NVMEPRLI))
goto out; goto out;
/* NPIV ports will RJT initiator only functions */
if (vport->port_type == LPFC_NPIV_PORT &&
npr->initiatorFunc && !npr->targetFunc)
goto out;
} }
return 1; return 1;
out: 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 " "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, 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)); memset(&stat, 0, sizeof(struct ls_rjt));
stat.un.b.lsRjtRsnCode = LSRJT_CMD_UNSUPPORTED; stat.un.b.lsRjtRsnCode = LSRJT_CMD_UNSUPPORTED;
stat.un.b.lsRjtRsnCodeExp = LSEXP_REQ_UNSUPPORTED; stat.un.b.lsRjtRsnCodeExp = LSEXP_REQ_UNSUPPORTED;
......
...@@ -950,7 +950,7 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, ...@@ -950,7 +950,7 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
int cpu; int cpu;
#endif #endif
int offline = 0; bool offline = false;
/* Sanity check on return of outstanding command */ /* Sanity check on return of outstanding command */
if (!lpfc_ncmd) { if (!lpfc_ncmd) {
...@@ -1124,7 +1124,9 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, ...@@ -1124,7 +1124,9 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
nCmd->transferred_length = 0; nCmd->transferred_length = 0;
nCmd->rcv_rsplen = 0; nCmd->rcv_rsplen = 0;
nCmd->status = NVME_SC_INTERNAL; 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;
} }
} }
......
...@@ -8571,12 +8571,10 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) ...@@ -8571,12 +8571,10 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
* is not fatal as the driver will use generic values. * is not fatal as the driver will use generic values.
*/ */
rc = lpfc_parse_vpd(phba, vpd, vpd_size); rc = lpfc_parse_vpd(phba, vpd, vpd_size);
if (unlikely(!rc)) { if (unlikely(!rc))
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"0377 Error %d parsing vpd. " "0377 Error %d parsing vpd. "
"Using defaults.\n", rc); "Using defaults.\n", rc);
rc = 0;
}
kfree(vpd); kfree(vpd);
/* Save information as VPD data */ /* Save information as VPD data */
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* included with this package. * * 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" #define LPFC_DRIVER_NAME "lpfc"
/* Used for SLI 2/3 */ /* Used for SLI 2/3 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment