Skip to content

Commit 635e278

Browse files
committed
Merge: lpfc updates for cs10/rh10 to 14_4_0_6
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/44 JIRA: https://issues.redhat.com/browse/RHEL-61740 Signed-off-by: Dick Kennedy <dkennedy@redhat.com> Approved-by: Ewan D. Milne <emilne@redhat.com> Approved-by: John Meneghini <jmeneghi@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents efdc660 + 08287de commit 635e278

File tree

15 files changed

+667
-816
lines changed

15 files changed

+667
-816
lines changed

drivers/scsi/lpfc/lpfc_bsg.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,11 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job)
398398
/* in case no data is transferred */
399399
bsg_reply->reply_payload_rcv_len = 0;
400400

401-
if (ndlp->nlp_flag & NLP_ELS_SND_MASK)
401+
if (test_bit(NLP_PLOGI_SND, &ndlp->nlp_flag) ||
402+
test_bit(NLP_PRLI_SND, &ndlp->nlp_flag) ||
403+
test_bit(NLP_ADISC_SND, &ndlp->nlp_flag) ||
404+
test_bit(NLP_LOGO_SND, &ndlp->nlp_flag) ||
405+
test_bit(NLP_RNID_SND, &ndlp->nlp_flag))
402406
return -ENODEV;
403407

404408
/* allocate our bsg tracking structure */

drivers/scsi/lpfc/lpfc_crtn.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -571,7 +571,7 @@ int lpfc_issue_reg_vfi(struct lpfc_vport *);
571571
int lpfc_issue_unreg_vfi(struct lpfc_vport *);
572572
int lpfc_selective_reset(struct lpfc_hba *);
573573
int lpfc_sli4_read_config(struct lpfc_hba *);
574-
void lpfc_sli4_node_prep(struct lpfc_hba *);
574+
void lpfc_sli4_node_rpi_restore(struct lpfc_hba *phba);
575575
int lpfc_sli4_els_sgl_update(struct lpfc_hba *phba);
576576
int lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba);
577577
int lpfc_io_buf_flush(struct lpfc_hba *phba, struct list_head *sglist);
@@ -660,6 +660,7 @@ void lpfc_wqe_cmd_template(void);
660660
void lpfc_nvmet_cmd_template(void);
661661
void lpfc_nvme_cancel_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
662662
uint32_t stat, uint32_t param);
663+
void lpfc_nvmels_flush_cmd(struct lpfc_hba *phba);
663664
extern int lpfc_enable_nvmet_cnt;
664665
extern unsigned long long lpfc_enable_nvmet[];
665666
extern int lpfc_no_hba_reset_cnt;

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
735735

736736
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
737737
"0238 Process x%06x NameServer Rsp "
738-
"Data: x%x x%x x%x x%lx x%x\n", Did,
738+
"Data: x%lx x%x x%x x%lx x%x\n", Did,
739739
ndlp->nlp_flag, ndlp->nlp_fc4_type,
740740
ndlp->nlp_state, vport->fc_flag,
741741
vport->fc_rscn_id_cnt);
@@ -744,7 +744,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
744744
* state of ndlp hit devloss, change state to
745745
* allow rediscovery.
746746
*/
747-
if (ndlp->nlp_flag & NLP_NPR_2B_DISC &&
747+
if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag) &&
748748
ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
749749
lpfc_nlp_set_state(vport, ndlp,
750750
NLP_STE_NPR_NODE);
@@ -832,12 +832,10 @@ lpfc_ns_rsp_audit_did(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
832832
if (ndlp->nlp_type != NLP_NVME_INITIATOR ||
833833
ndlp->nlp_state != NLP_STE_UNMAPPED_NODE)
834834
continue;
835-
spin_lock_irq(&ndlp->lock);
836835
if (ndlp->nlp_DID == Did)
837-
ndlp->nlp_flag &= ~NLP_NVMET_RECOV;
836+
clear_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag);
838837
else
839-
ndlp->nlp_flag |= NLP_NVMET_RECOV;
840-
spin_unlock_irq(&ndlp->lock);
838+
set_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag);
841839
}
842840
}
843841
}
@@ -894,13 +892,11 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint8_t fc4_type,
894892
*/
895893
if (vport->phba->nvmet_support) {
896894
list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
897-
if (!(ndlp->nlp_flag & NLP_NVMET_RECOV))
895+
if (!test_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag))
898896
continue;
899897
lpfc_disc_state_machine(vport, ndlp, NULL,
900898
NLP_EVT_DEVICE_RECOVERY);
901-
spin_lock_irq(&ndlp->lock);
902-
ndlp->nlp_flag &= ~NLP_NVMET_RECOV;
903-
spin_unlock_irq(&ndlp->lock);
899+
clear_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag);
904900
}
905901
}
906902

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

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

22302231
/* Look for a retryable error */
22312232
if (ulp_status == IOSTAT_LOCAL_REJECT) {
@@ -2234,8 +2235,16 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22342235
case IOERR_SLI_DOWN:
22352236
/* Driver aborted this IO. No retry as error
22362237
* is likely Offline->Online or some adapter
2237-
* error. Recovery will try again.
2238+
* error. Recovery will try again, but if port
2239+
* is not active there's no point to continue
2240+
* issuing follow up FDMI commands.
22382241
*/
2242+
if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) {
2243+
free_ndlp = cmdiocb->ndlp;
2244+
lpfc_ct_free_iocb(phba, cmdiocb);
2245+
lpfc_nlp_put(free_ndlp);
2246+
return;
2247+
}
22392248
break;
22402249
case IOERR_ABORT_IN_PROGRESS:
22412250
case IOERR_SEQUENCE_TIMEOUT:
@@ -2256,12 +2265,6 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
22562265
break;
22572266
}
22582267
}
2259-
2260-
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2261-
"0229 FDMI cmd %04x latt = %d "
2262-
"ulp_status: x%x, rid x%x\n",
2263-
be16_to_cpu(fdmi_cmd), latt, ulp_status,
2264-
ulp_word4);
22652268
}
22662269

22672270
free_ndlp = cmdiocb->ndlp;

drivers/scsi/lpfc/lpfc_debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,8 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size)
870870
wwn_to_u64(ndlp->nlp_nodename.u.wwn));
871871
len += scnprintf(buf+len, size-len, "RPI:x%04x ",
872872
ndlp->nlp_rpi);
873-
len += scnprintf(buf+len, size-len, "flag:x%08x ",
874-
ndlp->nlp_flag);
873+
len += scnprintf(buf+len, size-len, "flag:x%08lx ",
874+
ndlp->nlp_flag);
875875
if (!ndlp->nlp_type)
876876
len += scnprintf(buf+len, size-len, "UNKNOWN_TYPE ");
877877
if (ndlp->nlp_type & NLP_FC_NODE)

drivers/scsi/lpfc/lpfc_disc.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2013 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -102,7 +102,7 @@ struct lpfc_nodelist {
102102

103103
spinlock_t lock; /* Node management lock */
104104

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

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

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

0 commit comments

Comments
 (0)