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

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: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents 949189a5 8a9a690b
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -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,
+4 −4
Original line number Diff line number Diff line
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -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 */
+14 −4
Original line number Diff line number Diff line
@@ -934,9 +934,12 @@ 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)
@@ -945,14 +948,21 @@ lpfc_rcv_prli_support_check(struct lpfc_vport *vport,
		/* 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;
+4 −2
Original line number Diff line number Diff line
@@ -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;
		}
	}

Loading