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

Merge patch series "Update lpfc to revision 14.4.0.6"

Justin Tee <justintee8345@gmail.com> says:

Update lpfc to revision 14.4.0.6

This patch set contains bug fixes related to congestion handling,
accounting for internal remoteport objects, resource release during
HBA unload and reset, and clean up regarding the abuse of a global
spinlock.

The patches were cut against Martin's 6.13/scsi-queue tree.

Link: https://lore.kernel.org/r/20241031223219.152342-1-justintee8345@gmail.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents b795a4a1 5c169625
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -398,7 +398,11 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job)
	/* in case no data is transferred */
	bsg_reply->reply_payload_rcv_len = 0;

	if (ndlp->nlp_flag & NLP_ELS_SND_MASK)
	if (test_bit(NLP_PLOGI_SND, &ndlp->nlp_flag) ||
	    test_bit(NLP_PRLI_SND, &ndlp->nlp_flag) ||
	    test_bit(NLP_ADISC_SND, &ndlp->nlp_flag) ||
	    test_bit(NLP_LOGO_SND, &ndlp->nlp_flag) ||
	    test_bit(NLP_RNID_SND, &ndlp->nlp_flag))
		return -ENODEV;

	/* allocate our bsg tracking structure */
+3 −2
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -571,7 +571,7 @@ int lpfc_issue_reg_vfi(struct lpfc_vport *);
int lpfc_issue_unreg_vfi(struct lpfc_vport *);
int lpfc_selective_reset(struct lpfc_hba *);
int lpfc_sli4_read_config(struct lpfc_hba *);
void lpfc_sli4_node_prep(struct lpfc_hba *);
void lpfc_sli4_node_rpi_restore(struct lpfc_hba *phba);
int lpfc_sli4_els_sgl_update(struct lpfc_hba *phba);
int lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba);
int lpfc_io_buf_flush(struct lpfc_hba *phba, struct list_head *sglist);
@@ -660,6 +660,7 @@ void lpfc_wqe_cmd_template(void);
void lpfc_nvmet_cmd_template(void);
void lpfc_nvme_cancel_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
			   uint32_t stat, uint32_t param);
void lpfc_nvmels_flush_cmd(struct lpfc_hba *phba);
extern int lpfc_enable_nvmet_cnt;
extern unsigned long long lpfc_enable_nvmet[];
extern int lpfc_no_hba_reset_cnt;
+21 −18
Original line number Diff line number Diff line
@@ -735,7 +735,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)

			lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
					 "0238 Process x%06x NameServer Rsp "
					 "Data: x%x x%x x%x x%lx x%x\n", Did,
					 "Data: x%lx x%x x%x x%lx x%x\n", Did,
					 ndlp->nlp_flag, ndlp->nlp_fc4_type,
					 ndlp->nlp_state, vport->fc_flag,
					 vport->fc_rscn_id_cnt);
@@ -744,7 +744,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
			 * state of ndlp hit devloss, change state to
			 * allow rediscovery.
			 */
			if (ndlp->nlp_flag & NLP_NPR_2B_DISC &&
			if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag) &&
			    ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
				lpfc_nlp_set_state(vport, ndlp,
						   NLP_STE_NPR_NODE);
@@ -832,12 +832,10 @@ lpfc_ns_rsp_audit_did(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
			if (ndlp->nlp_type != NLP_NVME_INITIATOR ||
			    ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
				continue;
			spin_lock_irq(&ndlp->lock);
			if (ndlp->nlp_DID == Did)
				ndlp->nlp_flag &= ~NLP_NVMET_RECOV;
				clear_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag);
			else
				ndlp->nlp_flag |= NLP_NVMET_RECOV;
			spin_unlock_irq(&ndlp->lock);
				set_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag);
		}
	}
}
@@ -894,13 +892,11 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint8_t fc4_type,
	 */
	if (vport->phba->nvmet_support) {
		list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
			if (!(ndlp->nlp_flag & NLP_NVMET_RECOV))
			if (!test_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag))
				continue;
			lpfc_disc_state_machine(vport, ndlp, NULL,
						NLP_EVT_DEVICE_RECOVERY);
			spin_lock_irq(&ndlp->lock);
			ndlp->nlp_flag &= ~NLP_NVMET_RECOV;
			spin_unlock_irq(&ndlp->lock);
			clear_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag);
		}
	}

@@ -1440,7 +1436,7 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
	if (ndlp) {
		lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
				 "0242 Process x%x GFF "
				 "NameServer Rsp Data: x%x x%lx x%x\n",
				 "NameServer Rsp Data: x%lx x%lx x%x\n",
				 did, ndlp->nlp_flag, vport->fc_flag,
				 vport->fc_rscn_id_cnt);
	} else {
@@ -2226,6 +2222,11 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
		ulp_status, ulp_word4, latt);

	if (latt || ulp_status) {
		lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY,
				 "0229 FDMI cmd %04x failed, latt = %d "
				 "ulp_status: (x%x/x%x), sli_flag x%x\n",
				 be16_to_cpu(fdmi_cmd), latt, ulp_status,
				 ulp_word4, phba->sli.sli_flag);

		/* Look for a retryable error */
		if (ulp_status == IOSTAT_LOCAL_REJECT) {
@@ -2234,8 +2235,16 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
			case IOERR_SLI_DOWN:
				/* Driver aborted this IO.  No retry as error
				 * is likely Offline->Online or some adapter
				 * error.  Recovery will try again.
				 * error.  Recovery will try again, but if port
				 * is not active there's no point to continue
				 * issuing follow up FDMI commands.
				 */
				if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) {
					free_ndlp = cmdiocb->ndlp;
					lpfc_ct_free_iocb(phba, cmdiocb);
					lpfc_nlp_put(free_ndlp);
					return;
				}
				break;
			case IOERR_ABORT_IN_PROGRESS:
			case IOERR_SEQUENCE_TIMEOUT:
@@ -2256,12 +2265,6 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
				break;
			}
		}

		lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
				 "0229 FDMI cmd %04x latt = %d "
				 "ulp_status: x%x, rid x%x\n",
				 be16_to_cpu(fdmi_cmd), latt, ulp_status,
				 ulp_word4);
	}

	free_ndlp = cmdiocb->ndlp;
+2 −2
Original line number Diff line number Diff line
@@ -870,7 +870,7 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size)
				wwn_to_u64(ndlp->nlp_nodename.u.wwn));
		len += scnprintf(buf+len, size-len, "RPI:x%04x ",
				 ndlp->nlp_rpi);
		len +=  scnprintf(buf+len, size-len, "flag:x%08x ",
		len += scnprintf(buf+len, size-len, "flag:x%08lx ",
				 ndlp->nlp_flag);
		if (!ndlp->nlp_type)
			len += scnprintf(buf+len, size-len, "UNKNOWN_TYPE ");
+31 −31
Original line number Diff line number Diff line
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2004-2013 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
@@ -102,7 +102,7 @@ struct lpfc_nodelist {

	spinlock_t	lock;			/* Node management lock */

	uint32_t         nlp_flag;		/* entry flags */
	unsigned long    nlp_flag;		/* entry flags */
	uint32_t         nlp_DID;		/* FC D_ID of entry */
	uint32_t         nlp_last_elscmd;	/* Last ELS cmd sent */
	uint16_t         nlp_type;
@@ -182,37 +182,37 @@ struct lpfc_node_rrq {
#define lpfc_ndlp_check_qdepth(phba, ndlp) \
	(ndlp->cmd_qdepth < phba->sli4_hba.max_cfg_param.max_xri)

/* Defines for nlp_flag (uint32) */
#define NLP_IGNR_REG_CMPL  0x00000001 /* Rcvd rscn before we cmpl reg login */
#define NLP_REG_LOGIN_SEND 0x00000002   /* sent reglogin to adapter */
#define NLP_RELEASE_RPI    0x00000004   /* Release RPI to free pool */
#define NLP_SUPPRESS_RSP   0x00000010	/* Remote NPort supports suppress rsp */
#define NLP_PLOGI_SND      0x00000020	/* sent PLOGI request for this entry */
#define NLP_PRLI_SND       0x00000040	/* sent PRLI request for this entry */
#define NLP_ADISC_SND      0x00000080	/* sent ADISC request for this entry */
#define NLP_LOGO_SND       0x00000100	/* sent LOGO request for this entry */
#define NLP_RNID_SND       0x00000400	/* sent RNID request for this entry */
#define NLP_ELS_SND_MASK   0x000007e0	/* sent ELS request for this entry */
#define NLP_NVMET_RECOV    0x00001000   /* NVMET auditing node for recovery. */
#define NLP_UNREG_INP      0x00008000	/* UNREG_RPI cmd is in progress */
#define NLP_DROPPED        0x00010000	/* Init ref count has been dropped */
#define NLP_DELAY_TMO      0x00020000	/* delay timeout is running for node */
#define NLP_NPR_2B_DISC    0x00040000	/* node is included in num_disc_nodes */
#define NLP_RCV_PLOGI      0x00080000	/* Rcv'ed PLOGI from remote system */
#define NLP_LOGO_ACC       0x00100000	/* Process LOGO after ACC completes */
#define NLP_TGT_NO_SCSIID  0x00200000	/* good PRLI but no binding for scsid */
#define NLP_ISSUE_LOGO     0x00400000	/* waiting to issue a LOGO */
#define NLP_IN_DEV_LOSS    0x00800000	/* devloss in progress */
#define NLP_ACC_REGLOGIN   0x01000000	/* Issue Reg Login after successful
/* nlp_flag mask bits */
enum lpfc_nlp_flag {
	NLP_IGNR_REG_CMPL  = 0,         /* Rcvd rscn before we cmpl reg login */
	NLP_REG_LOGIN_SEND = 1,         /* sent reglogin to adapter */
	NLP_SUPPRESS_RSP   = 4,         /* Remote NPort supports suppress rsp */
	NLP_PLOGI_SND      = 5,         /* sent PLOGI request for this entry */
	NLP_PRLI_SND       = 6,         /* sent PRLI request for this entry */
	NLP_ADISC_SND      = 7,         /* sent ADISC request for this entry */
	NLP_LOGO_SND       = 8,         /* sent LOGO request for this entry */
	NLP_RNID_SND       = 10,        /* sent RNID request for this entry */
	NLP_NVMET_RECOV    = 12,        /* NVMET auditing node for recovery. */
	NLP_UNREG_INP      = 15,        /* UNREG_RPI cmd is in progress */
	NLP_DROPPED        = 16,        /* Init ref count has been dropped */
	NLP_DELAY_TMO      = 17,        /* delay timeout is running for node */
	NLP_NPR_2B_DISC    = 18,        /* node is included in num_disc_nodes */
	NLP_RCV_PLOGI      = 19,        /* Rcv'ed PLOGI from remote system */
	NLP_LOGO_ACC       = 20,        /* Process LOGO after ACC completes */
	NLP_TGT_NO_SCSIID  = 21,        /* good PRLI but no binding for scsid */
	NLP_ISSUE_LOGO     = 22,        /* waiting to issue a LOGO */
	NLP_IN_DEV_LOSS    = 23,        /* devloss in progress */
	NLP_ACC_REGLOGIN   = 24,        /* Issue Reg Login after successful
					   ACC */
#define NLP_NPR_ADISC      0x02000000	/* Issue ADISC when dq'ed from
	NLP_NPR_ADISC      = 25,        /* Issue ADISC when dq'ed from
					   NPR list */
#define NLP_RM_DFLT_RPI    0x04000000	/* need to remove leftover dflt RPI */
#define NLP_NODEV_REMOVE   0x08000000	/* Defer removal till discovery ends */
#define NLP_TARGET_REMOVE  0x10000000   /* Target remove in process */
#define NLP_SC_REQ         0x20000000	/* Target requires authentication */
#define NLP_FIRSTBURST     0x40000000	/* Target supports FirstBurst */
#define NLP_RPI_REGISTERED 0x80000000	/* nlp_rpi is valid */
	NLP_RM_DFLT_RPI    = 26,        /* need to remove leftover dflt RPI */
	NLP_NODEV_REMOVE   = 27,        /* Defer removal till discovery ends */
	NLP_TARGET_REMOVE  = 28,        /* Target remove in process */
	NLP_SC_REQ         = 29,        /* Target requires authentication */
	NLP_FIRSTBURST     = 30,        /* Target supports FirstBurst */
	NLP_RPI_REGISTERED = 31         /* nlp_rpi is valid */
};

/* There are 4 different double linked lists nodelist entries can reside on.
 * The Port Login (PLOGI) list and Address Discovery (ADISC) list are used
Loading