All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lpfc: Fix nvme io stoppage after link bounce
@ 2017-06-21 17:37 James Smart
  2017-06-22  7:41 ` Johannes Thumshirn
  2017-06-26 17:12 ` Martin K. Petersen
  0 siblings, 2 replies; 5+ messages in thread
From: James Smart @ 2017-06-21 17:37 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, James Smart

On link down, transport is calling driver to abort outstanding ios.
Driver erroneously rejects the abort if the port indicates it isn't
logged in - which will be the case after the link down. Thus, the
io can't clean up. This prevents reconnection at the transport level.

Fix by allowing abort to proceed.

Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_nvme.c | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 8206aa5493e3..0a0a1b92d01d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1427,7 +1427,6 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
 	struct lpfc_nvme_lport *lport;
 	struct lpfc_vport *vport;
 	struct lpfc_hba *phba;
-	struct lpfc_nodelist *ndlp;
 	struct lpfc_nvme_rport *rport;
 	struct lpfc_nvme_buf *lpfc_nbuf;
 	struct lpfc_iocbq *abts_buf;
@@ -1449,38 +1448,6 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
 			 pnvme_rport->port_id,
 			 pnvme_fcreq);
 
-	/*
-	 * Catch race where our node has transitioned, but the
-	 * transport is still transitioning.
-	 */
-	ndlp = rport->ndlp;
-	if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
-		lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE | LOG_NVME_ABTS,
-				 "6054 rport %p, ndlp %p, DID x%06x ndlp "
-				 " not ready.\n",
-				 rport, ndlp, pnvme_rport->port_id);
-
-		ndlp = lpfc_findnode_did(vport, pnvme_rport->port_id);
-		if (!ndlp) {
-			lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
-					 "6055 Could not find node for "
-					 "DID %x\n",
-					 pnvme_rport->port_id);
-			return;
-		}
-	}
-
-	/* The remote node has to be ready to send an abort. */
-	if ((ndlp->nlp_state != NLP_STE_MAPPED_NODE) &&
-	    (ndlp->nlp_type & NLP_NVME_TARGET)) {
-		lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
-				 "6048 rport %p, DID x%06x not ready for "
-				 "IO. State x%x, Type x%x\n",
-				 rport, pnvme_rport->port_id,
-				 ndlp->nlp_state, ndlp->nlp_type);
-		return;
-	}
-
 	/* If the hba is getting reset, this flag is set.  It is
 	 * cleared when the reset is complete and rings reestablished.
 	 */
@@ -1541,7 +1508,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
 
 	lpfc_nvmeio_data(phba, "NVME FCP ABORT: xri x%x idx %d to %06x\n",
 			 nvmereq_wqe->sli4_xritag,
-			 nvmereq_wqe->hba_wqidx, ndlp->nlp_DID);
+			 nvmereq_wqe->hba_wqidx, pnvme_rport->port_id);
 
 	/* Outstanding abort is in progress */
 	if (nvmereq_wqe->iocb_flag & LPFC_DRIVER_ABORTED) {
-- 
2.11.0

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

* Re: [PATCH] lpfc: Fix nvme io stoppage after link bounce
  2017-06-21 17:37 [PATCH] lpfc: Fix nvme io stoppage after link bounce James Smart
@ 2017-06-22  7:41 ` Johannes Thumshirn
  2017-06-22 15:52   ` James Smart
  2017-06-26 17:12 ` Martin K. Petersen
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Thumshirn @ 2017-06-22  7:41 UTC (permalink / raw)
  To: James Smart; +Cc: linux-scsi, James Smart

On Wed, Jun 21, 2017 at 10:37:58AM -0700, James Smart wrote:
[...]
> -	/*
> -	 * Catch race where our node has transitioned, but the
> -	 * transport is still transitioning.
> -	 */


The patch looks fine but can you please explain why the above race can't
happen anymore?

Thanks,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

* Re: [PATCH] lpfc: Fix nvme io stoppage after link bounce
  2017-06-22  7:41 ` Johannes Thumshirn
@ 2017-06-22 15:52   ` James Smart
  2017-06-22 18:50     ` Johannes Thumshirn
  0 siblings, 1 reply; 5+ messages in thread
From: James Smart @ 2017-06-22 15:52 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: linux-scsi, James Smart

On 6/22/2017 12:41 AM, Johannes Thumshirn wrote:
> On Wed, Jun 21, 2017 at 10:37:58AM -0700, James Smart wrote:
> [...]
>> -	/*
>> -	 * Catch race where our node has transitioned, but the
>> -	 * transport is still transitioning.
>> -	 */
> 
> 
> The patch looks fine but can you please explain why the above race can't
> happen anymore?
> 
> Thanks,
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> 

well, the primary reason is the code that was removed was bogus to begin 
with. Abort of an io/exchange, if its active, needs to occur on the link 
regardless of the ndlp state. This it simply needed to occur. As not 
checks on ndlp state are needed, there is no race.

-- james

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

* Re: [PATCH] lpfc: Fix nvme io stoppage after link bounce
  2017-06-22 15:52   ` James Smart
@ 2017-06-22 18:50     ` Johannes Thumshirn
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2017-06-22 18:50 UTC (permalink / raw)
  To: James Smart; +Cc: linux-scsi, James Smart

On Thu, Jun 22, 2017 at 08:52:14AM -0700, James Smart wrote:
> well, the primary reason is the code that was removed was bogus to begin
> with. Abort of an io/exchange, if its active, needs to occur on the link
> regardless of the ndlp state. This it simply needed to occur. As not checks
> on ndlp state are needed, there is no race.

Thanks for the explanation

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

* Re: [PATCH] lpfc: Fix nvme io stoppage after link bounce
  2017-06-21 17:37 [PATCH] lpfc: Fix nvme io stoppage after link bounce James Smart
  2017-06-22  7:41 ` Johannes Thumshirn
@ 2017-06-26 17:12 ` Martin K. Petersen
  1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2017-06-26 17:12 UTC (permalink / raw)
  To: James Smart; +Cc: linux-scsi, James Smart


James,

> On link down, transport is calling driver to abort outstanding ios.
> Driver erroneously rejects the abort if the port indicates it isn't
> logged in - which will be the case after the link down. Thus, the io
> can't clean up. This prevents reconnection at the transport level.
>
> Fix by allowing abort to proceed.

Applied to 4.13/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2017-06-26 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21 17:37 [PATCH] lpfc: Fix nvme io stoppage after link bounce James Smart
2017-06-22  7:41 ` Johannes Thumshirn
2017-06-22 15:52   ` James Smart
2017-06-22 18:50     ` Johannes Thumshirn
2017-06-26 17:12 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.