public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3
@ 2020-08-03 21:02 James Smart
  2020-08-03 21:02 ` [PATCH 1/8] lpfc: Fix FCoE speed reporting James Smart
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart

Update lpfc to revision 12.8.0.3

Patch set contains several small fixes.

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

James Smart (8):
  lpfc: Fix FCoE speed reporting
  lpfc: Fix no message shown for lpfc_hdw_queue out of range value
  lpfc: Fix RSCN timeout due to incorrect gidft counter
  lpfc: Fix oops when unloading driver while running mds diags
  lpfc: Fix retry of PRLI when status indicates its unsupported
  lpfc: Fix validation of bsg reply lengths
  lpfc: Fix lun loss after cable pull
  lpfc: Update lpfc version to 12.8.0.3

 drivers/scsi/lpfc/lpfc_attr.c      | 26 +++++++++++++++++++++++---
 drivers/scsi/lpfc/lpfc_bsg.c       | 21 ++++++++-------------
 drivers/scsi/lpfc/lpfc_ct.c        | 22 ++++++++++++++++------
 drivers/scsi/lpfc/lpfc_els.c       | 10 +++++++---
 drivers/scsi/lpfc/lpfc_init.c      | 18 +++++++++++++++---
 drivers/scsi/lpfc/lpfc_nportdisc.c |  8 +++++++-
 drivers/scsi/lpfc/lpfc_sli.c       | 11 +++++++++--
 drivers/scsi/lpfc/lpfc_version.h   |  2 +-
 8 files changed, 86 insertions(+), 32 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] lpfc: Fix FCoE speed reporting
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 2/8] lpfc: Fix no message shown for lpfc_hdw_queue out of range value James Smart
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

Current Link speed was shown as "unknown" in sysfs for FCoE ports
In this scenario, the port was working in 20G speed, which happens to
not be a speed handled by the driver.

Add support for all possible link speeds that could get reported from
port_speed field in link state ACQE.

Additionally, as supported_speeds can't be manipulated via the fcoe driver
on a converged ethernet port (it must be managed by the nic function),
don't fill out the supported_speeds field for the fc host object in sysfs.

Revise debug logging to report Link speed mgmt valuess.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_attr.c |  6 ++++++
 drivers/scsi/lpfc/lpfc_init.c | 15 +++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index a62c60ca6477..cc2c907777d2 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -6679,9 +6679,15 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
 		}
 	} else if (lpfc_is_link_up(phba) && (phba->hba_flag & HBA_FCOE_MODE)) {
 		switch (phba->fc_linkspeed) {
+		case LPFC_ASYNC_LINK_SPEED_1GBPS:
+			fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
+			break;
 		case LPFC_ASYNC_LINK_SPEED_10GBPS:
 			fc_host_speed(shost) = FC_PORTSPEED_10GBIT;
 			break;
+		case LPFC_ASYNC_LINK_SPEED_20GBPS:
+			fc_host_speed(shost) = FC_PORTSPEED_20GBIT;
+			break;
 		case LPFC_ASYNC_LINK_SPEED_25GBPS:
 			fc_host_speed(shost) = FC_PORTSPEED_25GBIT;
 			break;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index db768e28d3f9..159afadaea2b 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4577,6 +4577,13 @@ static void lpfc_host_supported_speeds_set(struct Scsi_Host *shost)
 	struct lpfc_hba   *phba = vport->phba;
 
 	fc_host_supported_speeds(shost) = 0;
+	/*
+	 * Avoid reporting supported link speed for FCoE as it can't be
+	 * controlled via FCoE.
+	 */
+	if (phba->hba_flag & HBA_FCOE_MODE)
+		return;
+
 	if (phba->lmt & LMT_128Gb)
 		fc_host_supported_speeds(shost) |= FC_PORTSPEED_128GBIT;
 	if (phba->lmt & LMT_64Gb)
@@ -4910,6 +4917,9 @@ lpfc_sli4_port_speed_parse(struct lpfc_hba *phba, uint32_t evt_code,
 		case LPFC_ASYNC_LINK_SPEED_40GBPS:
 			port_speed = 40000;
 			break;
+		case LPFC_ASYNC_LINK_SPEED_100GBPS:
+			port_speed = 100000;
+			break;
 		default:
 			port_speed = 0;
 		}
@@ -8589,7 +8599,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
 				"VPI(B:%d M:%d) "
 				"VFI(B:%d M:%d) "
 				"RPI(B:%d M:%d) "
-				"FCFI:%d EQ:%d CQ:%d WQ:%d RQ:%d\n",
+				"FCFI:%d EQ:%d CQ:%d WQ:%d RQ:%d lmt:x%x\n",
 				phba->sli4_hba.extents_in_use,
 				phba->sli4_hba.max_cfg_param.xri_base,
 				phba->sli4_hba.max_cfg_param.max_xri,
@@ -8603,7 +8613,8 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
 				phba->sli4_hba.max_cfg_param.max_eq,
 				phba->sli4_hba.max_cfg_param.max_cq,
 				phba->sli4_hba.max_cfg_param.max_wq,
-				phba->sli4_hba.max_cfg_param.max_rq);
+				phba->sli4_hba.max_cfg_param.max_rq,
+				phba->lmt);
 
 		/*
 		 * Calculate queue resources based on how
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] lpfc: Fix no message shown for lpfc_hdw_queue out of range value
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
  2020-08-03 21:02 ` [PATCH 1/8] lpfc: Fix FCoE speed reporting James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 3/8] lpfc: Fix RSCN timeout due to incorrect gidft counter James Smart
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

If module parameters override the default configuration settings for
hardware queues or irqs, the driver was not notifying the change from
defaults.

Revise such that any changes will result in a kernel log message.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_attr.c | 20 +++++++++++++++++---
 drivers/scsi/lpfc/lpfc_init.c |  3 ++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index cc2c907777d2..ece6c250ebaf 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -7412,12 +7412,26 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
 void
 lpfc_nvme_mod_param_dep(struct lpfc_hba *phba)
 {
-	if (phba->cfg_hdw_queue > phba->sli4_hba.num_present_cpu)
+	int  logit = 0;
+
+	if (phba->cfg_hdw_queue > phba->sli4_hba.num_present_cpu) {
 		phba->cfg_hdw_queue = phba->sli4_hba.num_present_cpu;
-	if (phba->cfg_irq_chann > phba->sli4_hba.num_present_cpu)
+		logit = 1;
+	}
+	if (phba->cfg_irq_chann > phba->sli4_hba.num_present_cpu) {
 		phba->cfg_irq_chann = phba->sli4_hba.num_present_cpu;
-	if (phba->cfg_irq_chann > phba->cfg_hdw_queue)
+		logit = 1;
+	}
+	if (phba->cfg_irq_chann > phba->cfg_hdw_queue) {
 		phba->cfg_irq_chann = phba->cfg_hdw_queue;
+		logit = 1;
+	}
+	if (logit)
+		lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
+				"2006 Reducing Queues - CPU limitation: "
+				"IRQ %d HDWQ %d\n",
+				phba->cfg_irq_chann,
+				phba->cfg_hdw_queue);
 
 	if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME &&
 	    phba->nvmet_support) {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 159afadaea2b..265f2dfa7fb0 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -8637,7 +8637,8 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
 		if ((phba->cfg_irq_chann > qmin) ||
 		    (phba->cfg_hdw_queue > qmin)) {
 			lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
-					"2005 Reducing Queues: "
+					"2005 Reducing Queues - "
+					"FW resource limitation: "
 					"WQ %d CQ %d EQ %d: min %d: "
 					"IRQ %d HDWQ %d\n",
 					phba->sli4_hba.max_cfg_param.max_wq,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] lpfc: Fix RSCN timeout due to incorrect gidft counter
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
  2020-08-03 21:02 ` [PATCH 1/8] lpfc: Fix FCoE speed reporting James Smart
  2020-08-03 21:02 ` [PATCH 2/8] lpfc: Fix no message shown for lpfc_hdw_queue out of range value James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 4/8] lpfc: Fix oops when unloading driver while running mds diags James Smart
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

In configs with a large number of initiators in the same zone (>250),
RSCN timeouts are seen when creating or deleting vports.
   lpfc 0000:07:00.1: 5:(0):0231 RSCN timeout Data: x0 x3

During RSCN processing driver issues GID_FT command to nameserver. A
counter for number of simultaneous GID_FT commands is maintained (an
unsigned value). The counter is incremented when the GID_FT is issued.
If the GID_FT command fails for some reason the driver retries the
GID_FT from the completion call back. But the counter was decremented
before the retry was issued.  When the second GID_FT completes, the
callback again tries to decrement the counter, possibly wrapping to a
very large non-zero value, which causes the RSCN cleanup code to not
execute. Thus the RSCN timeout failure.

Do not decrement the counter on a retry. Also add defensive checks to
ensure the counter is not decremented if already zero.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_ct.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index dd9f2bf54edd..ef2015fad2d5 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -713,7 +713,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 		/* This is a GID_FT completing so the gidft_inp counter was
 		 * incremented before the GID_FT was issued to the wire.
 		 */
-		vport->gidft_inp--;
+		if (vport->gidft_inp)
+			vport->gidft_inp--;
 
 		/*
 		 * Skip processing the NS response
@@ -741,11 +742,14 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				goto out;
 
 			/* CT command is being retried */
-			vport->gidft_inp--;
 			rc = lpfc_ns_cmd(vport, SLI_CTNS_GID_FT,
 					 vport->fc_ns_retry, type);
 			if (rc == 0)
 				goto out;
+			else { /* Unable to send NS cmd */
+				if (vport->gidft_inp)
+					vport->gidft_inp--;
+			}
 		}
 		if (vport->fc_flag & FC_RSCN_MODE)
 			lpfc_els_flush_rscn(vport);
@@ -825,7 +829,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				(uint32_t) CTrsp->ReasonCode,
 				(uint32_t) CTrsp->Explanation);
 		}
-		vport->gidft_inp--;
+		if (vport->gidft_inp)
+			vport->gidft_inp--;
 	}
 
 	lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
@@ -918,7 +923,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 		/* This is a GID_PT completing so the gidft_inp counter was
 		 * incremented before the GID_PT was issued to the wire.
 		 */
-		vport->gidft_inp--;
+		if (vport->gidft_inp)
+			vport->gidft_inp--;
 
 		/*
 		 * Skip processing the NS response
@@ -942,11 +948,14 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				vport->fc_ns_retry++;
 
 			/* CT command is being retried */
-			vport->gidft_inp--;
 			rc = lpfc_ns_cmd(vport, SLI_CTNS_GID_PT,
 					 vport->fc_ns_retry, GID_PT_N_PORT);
 			if (rc == 0)
 				goto out;
+			else { /* Unable to send NS cmd */
+				if (vport->gidft_inp)
+					vport->gidft_inp--;
+			}
 		}
 		if (vport->fc_flag & FC_RSCN_MODE)
 			lpfc_els_flush_rscn(vport);
@@ -1027,7 +1036,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				(uint32_t)CTrsp->ReasonCode,
 				(uint32_t)CTrsp->Explanation);
 		}
-		vport->gidft_inp--;
+		if (vport->gidft_inp)
+			vport->gidft_inp--;
 	}
 
 	lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] lpfc: Fix oops when unloading driver while running mds diags
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
                   ` (2 preceding siblings ...)
  2020-08-03 21:02 ` [PATCH 3/8] lpfc: Fix RSCN timeout due to incorrect gidft counter James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 5/8] lpfc: Fix retry of PRLI when status indicates its unsupported James Smart
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

While mds diagnostic tests are running, if the driver is requested to be
unloaded, oops or hangs are observed.  The driver doesn't terminate the
processing of diag frames when the unload is started. As such: oops may
be seen for __lpfc_sli_release_iocbq_s4 because ring memory is referenced
that was already freed; or hangs see in lpfc_nvme_wait_for_io_drain as
ios no longer complete.

If unloading, don't process diag frames. Just clean them up.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 8582b51b0613..4cd7ded656b7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -13650,7 +13650,11 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe)
 		    fc_hdr->fh_r_ctl == FC_RCTL_DD_UNSOL_DATA) {
 			spin_unlock_irqrestore(&phba->hbalock, iflags);
 			/* Handle MDS Loopback frames */
-			lpfc_sli4_handle_mds_loopback(phba->pport, dma_buf);
+			if  (!(phba->pport->load_flag & FC_UNLOADING))
+				lpfc_sli4_handle_mds_loopback(phba->pport,
+							      dma_buf);
+			else
+				lpfc_in_buf_free(phba, &dma_buf->dbuf);
 			break;
 		}
 
@@ -18363,7 +18367,10 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba,
 	    fc_hdr->fh_r_ctl == FC_RCTL_DD_UNSOL_DATA) {
 		vport = phba->pport;
 		/* Handle MDS Loopback frames */
-		lpfc_sli4_handle_mds_loopback(vport, dmabuf);
+		if  (!(phba->pport->load_flag & FC_UNLOADING))
+			lpfc_sli4_handle_mds_loopback(vport, dmabuf);
+		else
+			lpfc_in_buf_free(phba, &dmabuf->dbuf);
 		return;
 	}
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] lpfc: Fix retry of PRLI when status indicates its unsupported
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
                   ` (3 preceding siblings ...)
  2020-08-03 21:02 ` [PATCH 4/8] lpfc: Fix oops when unloading driver while running mds diags James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 6/8] lpfc: Fix validation of bsg reply lengths James Smart
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

With port bounce/address swaps and timing between initiator GID queries
vs remote port FC4 support registrations, the driver may be in a situation
where it sends PRLIs for both FCP and NVME even though the target may not
support one of the protocols. In this case, the remote port will reject
the PRLI and usually indicate it does not support the request. However,
the driver currently ignores the status of the failure and immediately
retries the PRLI, which is pointless. In the case of this one remote port,
the reception of the PRLI retry caused it to decide to send a LOGO.
The LOGO restarted the process and the same results happened. It made
the remote port undiscoverable to either protocol.

Add logic to detect the non-support status and not attempt the retry
of the PRLI.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_els.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 85d4e4000c25..48dc63f22cca 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -3937,10 +3937,14 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 		case LSRJT_UNABLE_TPC:
 			/* The driver has a VALID PLOGI but the rport has
 			 * rejected the PRLI - can't do it now.  Delay
-			 * for 1 second and try again - don't care about
-			 * the explanation.
+			 * for 1 second and try again.
+			 *
+			 * However, if explanation is REQ_UNSUPPORTED there's
+			 * no point to retry PRLI.
 			 */
-			if (cmd == ELS_CMD_PRLI || cmd == ELS_CMD_NVMEPRLI) {
+			if ((cmd == ELS_CMD_PRLI || cmd == ELS_CMD_NVMEPRLI) &&
+			    stat.un.b.lsRjtRsnCodeExp !=
+			    LSEXP_REQ_UNSUPPORTED) {
 				delay = 1000;
 				maxretry = lpfc_max_els_tries + 1;
 				retry = 1;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] lpfc: Fix validation of bsg reply lengths
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
                   ` (4 preceding siblings ...)
  2020-08-03 21:02 ` [PATCH 5/8] lpfc: Fix retry of PRLI when status indicates its unsupported James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 7/8] lpfc: Fix lun loss after cable pull James Smart
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

There are a couple of code areas which validate sufficient reply buffer
length, but the checks are using the request elements rather than
the reply elements.

Rework to validate using the reply structures.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_bsg.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index 1d88fedaf3f0..6f9d648a9b9c 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -2494,13 +2494,12 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)
 	diag_status_reply = (struct diag_status *)
 			    bsg_reply->reply_data.vendor_reply.vendor_rsp;
 
-	if (job->reply_len <
-	    sizeof(struct fc_bsg_request) + sizeof(struct diag_status)) {
+	if (job->reply_len < sizeof(*bsg_reply) + sizeof(*diag_status_reply)) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC,
 				"3012 Received Run link diag test reply "
 				"below minimum size (%d): reply_len:%d\n",
-				(int)(sizeof(struct fc_bsg_request) +
-				sizeof(struct diag_status)),
+				(int)(sizeof(*bsg_reply) +
+				sizeof(*diag_status_reply)),
 				job->reply_len);
 		rc = -EINVAL;
 		goto job_error;
@@ -3418,8 +3417,7 @@ lpfc_bsg_get_dfc_rev(struct bsg_job *job)
 	event_reply = (struct get_mgmt_rev_reply *)
 		bsg_reply->reply_data.vendor_reply.vendor_rsp;
 
-	if (job->reply_len <
-	    sizeof(struct fc_bsg_request) + sizeof(struct get_mgmt_rev_reply)) {
+	if (job->reply_len < sizeof(*bsg_reply) + sizeof(*event_reply)) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC,
 				"2741 Received GET_DFC_REV reply below "
 				"minimum size\n");
@@ -5202,8 +5200,8 @@ lpfc_menlo_cmd(struct bsg_job *job)
 		goto no_dd_data;
 	}
 
-	if (job->reply_len <
-	    sizeof(struct fc_bsg_request) + sizeof(struct menlo_response)) {
+	if (job->reply_len < sizeof(*bsg_reply) +
+				sizeof(struct menlo_response)) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC,
 				"2785 Received MENLO_CMD reply below "
 				"minimum size\n");
@@ -5359,9 +5357,7 @@ lpfc_forced_link_speed(struct bsg_job *job)
 	forced_reply = (struct forced_link_speed_support_reply *)
 		bsg_reply->reply_data.vendor_reply.vendor_rsp;
 
-	if (job->reply_len <
-	    sizeof(struct fc_bsg_request) +
-	    sizeof(struct forced_link_speed_support_reply)) {
+	if (job->reply_len < sizeof(*bsg_reply) + sizeof(*forced_reply)) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC,
 				"0049 Received FORCED_LINK_SPEED reply below "
 				"minimum size\n");
@@ -5715,8 +5711,7 @@ lpfc_get_trunk_info(struct bsg_job *job)
 	event_reply = (struct lpfc_trunk_info *)
 		bsg_reply->reply_data.vendor_reply.vendor_rsp;
 
-	if (job->reply_len <
-	    sizeof(struct fc_bsg_request) + sizeof(struct lpfc_trunk_info)) {
+	if (job->reply_len < sizeof(*bsg_reply) + sizeof(*event_reply)) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_LIBDFC,
 				"2728 Received GET TRUNK _INFO reply below "
 				"minimum size\n");
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] lpfc: Fix lun loss after cable pull
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
                   ` (5 preceding siblings ...)
  2020-08-03 21:02 ` [PATCH 6/8] lpfc: Fix validation of bsg reply lengths James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-03 21:02 ` [PATCH 8/8] lpfc: Update lpfc version to 12.8.0.3 James Smart
  2020-08-05  1:17 ` [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 Martin K. Petersen
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

On devices that support FCP sequence error recovery, which attempts to
preserve the devices login across link bounce, adisc is used for device
validation. Turns out the device fc4 type is cleared as part of the link
bounce, but the ADISC handling doesn't restore the FC4 support as it
normally would with a PRLI. This caused situations where the device wasn't
reregistered with the transport thus scan logic and lun discovery never
kicked in.

In the ADISC completion handling, reset the fc4 type so that transport
port reregistration occurs with the remote port.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_nportdisc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index e4c710fe0245..cad53d19cb25 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -1745,7 +1745,13 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport,
 		}
 	}
 
-	if (ndlp->nlp_type & NLP_FCP_TARGET) {
+	if (ndlp->nlp_type & NLP_FCP_TARGET)
+		ndlp->nlp_fc4_type |= NLP_FC4_FCP;
+
+	if (ndlp->nlp_type & NLP_NVME_TARGET)
+		ndlp->nlp_fc4_type |= NLP_FC4_NVME;
+
+	if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) {
 		ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE;
 		lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE);
 	} else {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] lpfc: Update lpfc version to 12.8.0.3
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
                   ` (6 preceding siblings ...)
  2020-08-03 21:02 ` [PATCH 7/8] lpfc: Fix lun loss after cable pull James Smart
@ 2020-08-03 21:02 ` James Smart
  2020-08-05  1:17 ` [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 Martin K. Petersen
  8 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2020-08-03 21:02 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

Update lpfc version to 12.8.0.3

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
---
 drivers/scsi/lpfc/lpfc_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
index 1987c6666279..20adec4387f0 100644
--- a/drivers/scsi/lpfc/lpfc_version.h
+++ b/drivers/scsi/lpfc/lpfc_version.h
@@ -20,7 +20,7 @@
  * included with this package.                                     *
  *******************************************************************/
 
-#define LPFC_DRIVER_VERSION "12.8.0.2"
+#define LPFC_DRIVER_VERSION "12.8.0.3"
 #define LPFC_DRIVER_NAME		"lpfc"
 
 /* Used for SLI 2/3 */
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3
  2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
                   ` (7 preceding siblings ...)
  2020-08-03 21:02 ` [PATCH 8/8] lpfc: Update lpfc version to 12.8.0.3 James Smart
@ 2020-08-05  1:17 ` Martin K. Petersen
  8 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2020-08-05  1:17 UTC (permalink / raw)
  To: James Smart, linux-scsi; +Cc: Martin K . Petersen

On Mon, 3 Aug 2020 14:02:21 -0700, James Smart wrote:

> Update lpfc to revision 12.8.0.3
> 
> Patch set contains several small fixes.
> 
> The patches were cut against Martin's 5.9/scsi-queue tree
> 
> James Smart (8):
>   lpfc: Fix FCoE speed reporting
>   lpfc: Fix no message shown for lpfc_hdw_queue out of range value
>   lpfc: Fix RSCN timeout due to incorrect gidft counter
>   lpfc: Fix oops when unloading driver while running mds diags
>   lpfc: Fix retry of PRLI when status indicates its unsupported
>   lpfc: Fix validation of bsg reply lengths
>   lpfc: Fix lun loss after cable pull
>   lpfc: Update lpfc version to 12.8.0.3
> 
> [...]

Applied to 5.9/scsi-queue, thanks!

[1/8] scsi: lpfc: Fix FCoE speed reporting
      https://git.kernel.org/mkp/scsi/c/a1e4d3d8aef9
[2/8] scsi: lpfc: Fix no message shown for lpfc_hdw_queue out of range value
      https://git.kernel.org/mkp/scsi/c/9e3e365a92d3
[3/8] scsi: lpfc: Fix RSCN timeout due to incorrect gidft counter
      https://git.kernel.org/mkp/scsi/c/8ccd6926db7d
[4/8] scsi: lpfc: Fix oops when unloading driver while running mds diags
      https://git.kernel.org/mkp/scsi/c/24411fcd6fe7
[5/8] scsi: lpfc: Fix retry of PRLI when status indicates its unsupported
      https://git.kernel.org/mkp/scsi/c/678768da9880
[6/8] scsi: lpfc: Fix validation of bsg reply lengths
      https://git.kernel.org/mkp/scsi/c/feb3cc57fb63
[7/8] scsi: lpfc: Fix LUN loss after cable pull
      https://git.kernel.org/mkp/scsi/c/00081c5ca4d5
[8/8] scsi: lpfc: Update lpfc version to 12.8.0.3
      https://git.kernel.org/mkp/scsi/c/7e0e8be3a1fd

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-05  1:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03 21:02 [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 James Smart
2020-08-03 21:02 ` [PATCH 1/8] lpfc: Fix FCoE speed reporting James Smart
2020-08-03 21:02 ` [PATCH 2/8] lpfc: Fix no message shown for lpfc_hdw_queue out of range value James Smart
2020-08-03 21:02 ` [PATCH 3/8] lpfc: Fix RSCN timeout due to incorrect gidft counter James Smart
2020-08-03 21:02 ` [PATCH 4/8] lpfc: Fix oops when unloading driver while running mds diags James Smart
2020-08-03 21:02 ` [PATCH 5/8] lpfc: Fix retry of PRLI when status indicates its unsupported James Smart
2020-08-03 21:02 ` [PATCH 6/8] lpfc: Fix validation of bsg reply lengths James Smart
2020-08-03 21:02 ` [PATCH 7/8] lpfc: Fix lun loss after cable pull James Smart
2020-08-03 21:02 ` [PATCH 8/8] lpfc: Update lpfc version to 12.8.0.3 James Smart
2020-08-05  1:17 ` [PATCH 0/8] lpfc: Update lpfc to revision 12.8.0.3 Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox