Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] nvme: remove FC transport status values
@ 2017-09-07 23:27 James Smart
  2017-09-07 23:27 ` [PATCH 1/5] nvme: remove FC transport-specific error values James Smart
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: James Smart @ 2017-09-07 23:27 UTC (permalink / raw)


The NVM express group recinded the reserved range for the transport.
Remove the FC-centric values that had been defined and convert the
FC transport and LLDD to use generic values.

*** BLURB HERE ***

James Smart (5):
  nvme: remove FC transport-specific error values
  nvme-fc: remove use of FC-specific error codes
  nvmet-fc: remove use of FC-specific error codes
  nvmet-fcloop: remove use of FC-specific error codes
  lpfc: remove use of FC-specific error codes

 drivers/nvme/host/fc.c        |  8 ++++----
 drivers/nvme/target/fc.c      |  9 +++------
 drivers/nvme/target/fcloop.c  |  2 +-
 drivers/scsi/lpfc/lpfc_nvme.c |  2 +-
 include/linux/nvme.h          | 13 -------------
 5 files changed, 9 insertions(+), 25 deletions(-)

-- 
2.13.1

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

* [PATCH 1/5] nvme: remove FC transport-specific error values
  2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
@ 2017-09-07 23:27 ` James Smart
  2017-09-08  7:24   ` Christoph Hellwig
  2017-09-07 23:27 ` [PATCH 2/5] nvme-fc: remove use of FC-specific error codes James Smart
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: James Smart @ 2017-09-07 23:27 UTC (permalink / raw)


The NVM express group recinded the reserved range for the transport.
Remove the FC-centric values that had been defined.

Signed-off-by: James Smart <james.smart at broadcom.com>
---
 include/linux/nvme.h | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 823bf6f80dae..3aedd930b988 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1133,19 +1133,6 @@ enum {
 	NVME_SC_UNWRITTEN_BLOCK		= 0x287,
 
 	NVME_SC_DNR			= 0x4000,
-
-
-	/*
-	 * FC Transport-specific error status values for NVME commands
-	 *
-	 * Transport-specific status code values must be in the range 0xB0..0xBF
-	 */
-
-	/* Generic FC failure - catchall */
-	NVME_SC_FC_TRANSPORT_ERROR	= 0x00B0,
-
-	/* I/O failure due to FC ABTS'd */
-	NVME_SC_FC_TRANSPORT_ABORTED	= 0x00B1,
 };
 
 struct nvme_completion {
-- 
2.13.1

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

* [PATCH 2/5] nvme-fc: remove use of FC-specific error codes
  2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
  2017-09-07 23:27 ` [PATCH 1/5] nvme: remove FC transport-specific error values James Smart
@ 2017-09-07 23:27 ` James Smart
  2017-09-07 23:27 ` [PATCH 3/5] nvmet-fc: " James Smart
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2017-09-07 23:27 UTC (permalink / raw)


The FC-NVME transport used the FC-specific error codes in cases where
it had to fabricate an error to go back up stack. Instead of using the
FC-specific values, now use a generic value (NVME_SC_INTERNAL).

Signed-off-by: James Smart <james.smart at broadcom.com>
---
 drivers/nvme/host/fc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 6e436987baae..af075e998944 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1376,7 +1376,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
 	if (atomic_read(&op->state) == FCPOP_STATE_ABORTED)
 		status = cpu_to_le16((NVME_SC_ABORT_REQ | NVME_SC_DNR) << 1);
 	else if (freq->status)
-		status = cpu_to_le16(NVME_SC_FC_TRANSPORT_ERROR << 1);
+		status = cpu_to_le16(NVME_SC_INTERNAL << 1);
 
 	/*
 	 * For the linux implementation, if we have an unsuccesful
@@ -1404,7 +1404,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
 		 */
 		if (freq->transferred_length !=
 			be32_to_cpu(op->cmd_iu.data_len)) {
-			status = cpu_to_le16(NVME_SC_FC_TRANSPORT_ERROR << 1);
+			status = cpu_to_le16(NVME_SC_INTERNAL << 1);
 			goto done;
 		}
 		result.u64 = 0;
@@ -1421,7 +1421,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
 					freq->transferred_length ||
 			     op->rsp_iu.status_code ||
 			     sqe->common.command_id != cqe->command_id)) {
-			status = cpu_to_le16(NVME_SC_FC_TRANSPORT_ERROR << 1);
+			status = cpu_to_le16(NVME_SC_INTERNAL << 1);
 			goto done;
 		}
 		result = cqe->result;
@@ -1429,7 +1429,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
 		break;
 
 	default:
-		status = cpu_to_le16(NVME_SC_FC_TRANSPORT_ERROR << 1);
+		status = cpu_to_le16(NVME_SC_INTERNAL << 1);
 		goto done;
 	}
 
-- 
2.13.1

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

* [PATCH 3/5] nvmet-fc: remove use of FC-specific error codes
  2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
  2017-09-07 23:27 ` [PATCH 1/5] nvme: remove FC transport-specific error values James Smart
  2017-09-07 23:27 ` [PATCH 2/5] nvme-fc: remove use of FC-specific error codes James Smart
@ 2017-09-07 23:27 ` James Smart
  2017-09-07 23:27 ` [PATCH 4/5] nvmet-fcloop: " James Smart
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2017-09-07 23:27 UTC (permalink / raw)


The FC-NVME target transport used the FC-specific error codes in
return codes when the transport or lldd failed. Instead of using the
FC-specific values, now use a generic value (NVME_SC_INTERNAL).

Signed-off-by: James Smart <james.smart at broadcom.com>
---
 drivers/nvme/target/fc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 421e43bf1dd7..088f07250d76 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1910,8 +1910,7 @@ nvmet_fc_transfer_fcp_data(struct nvmet_fc_tgtport *tgtport,
 			spin_lock_irqsave(&fod->flock, flags);
 			fod->writedataactive = false;
 			spin_unlock_irqrestore(&fod->flock, flags);
-			nvmet_req_complete(&fod->req,
-					NVME_SC_FC_TRANSPORT_ERROR);
+			nvmet_req_complete(&fod->req, NVME_SC_INTERNAL);
 		} else /* NVMET_FCOP_READDATA or NVMET_FCOP_READDATA_RSP */ {
 			fcpreq->fcp_error = ret;
 			fcpreq->transferred_length = 0;
@@ -1929,8 +1928,7 @@ __nvmet_fc_fod_op_abort(struct nvmet_fc_fcp_iod *fod, bool abort)
 	/* if in the middle of an io and we need to tear down */
 	if (abort) {
 		if (fcpreq->op == NVMET_FCOP_WRITEDATA) {
-			nvmet_req_complete(&fod->req,
-					NVME_SC_FC_TRANSPORT_ERROR);
+			nvmet_req_complete(&fod->req, NVME_SC_INTERNAL);
 			return true;
 		}
 
@@ -1968,8 +1966,7 @@ nvmet_fc_fod_op_done(struct nvmet_fc_fcp_iod *fod)
 			fod->abort = true;
 			spin_unlock(&fod->flock);
 
-			nvmet_req_complete(&fod->req,
-					NVME_SC_FC_TRANSPORT_ERROR);
+			nvmet_req_complete(&fod->req, NVME_SC_INTERNAL);
 			return;
 		}
 
-- 
2.13.1

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

* [PATCH 4/5] nvmet-fcloop: remove use of FC-specific error codes
  2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
                   ` (2 preceding siblings ...)
  2017-09-07 23:27 ` [PATCH 3/5] nvmet-fc: " James Smart
@ 2017-09-07 23:27 ` James Smart
  2017-09-07 23:27 ` [PATCH 5/5] lpfc: " James Smart
  2017-09-14 16:55 ` [PATCH 0/5] nvme: remove FC transport status values Christoph Hellwig
  5 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2017-09-07 23:27 UTC (permalink / raw)


The FC-NVME transport loopback test module used the FC-specific error
codes in cases where it emulated a transport abort case. Instead of
using the FC-specific values, now use a generic value (NVME_SC_INTERNAL).

Signed-off-by: James Smart <james.smart at broadcom.com>
---
 drivers/nvme/target/fcloop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
index 1cb9847ec261..1fd1afbb8b2a 100644
--- a/drivers/nvme/target/fcloop.c
+++ b/drivers/nvme/target/fcloop.c
@@ -576,7 +576,7 @@ fcloop_tgt_fcp_abort(struct nvmet_fc_target_port *tgtport,
 	tfcp_req->aborted = true;
 	spin_unlock(&tfcp_req->reqlock);
 
-	tfcp_req->status = NVME_SC_FC_TRANSPORT_ABORTED;
+	tfcp_req->status = NVME_SC_INTERNAL;
 
 	/*
 	 * nothing more to do. If io wasn't active, the transport should
-- 
2.13.1

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

* [PATCH 5/5] lpfc: remove use of FC-specific error codes
  2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
                   ` (3 preceding siblings ...)
  2017-09-07 23:27 ` [PATCH 4/5] nvmet-fcloop: " James Smart
@ 2017-09-07 23:27 ` James Smart
  2017-09-14 16:55 ` [PATCH 0/5] nvme: remove FC transport status values Christoph Hellwig
  5 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2017-09-07 23:27 UTC (permalink / raw)


The lpfc driver used the FC-specific error when it needed to return
an error to the FC-NVME transport. Convert to use a generic value
(NVME_SC_INTERNAL).

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

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 0a0a1b92d01d..d05af618e63f 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -884,7 +884,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
 					 wcqe->total_data_placed);
 			nCmd->transferred_length = 0;
 			nCmd->rcv_rsplen = 0;
-			nCmd->status = NVME_SC_FC_TRANSPORT_ERROR;
+			nCmd->status = NVME_SC_INTERNAL;
 		}
 	}
 
-- 
2.13.1

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

* [PATCH 1/5] nvme: remove FC transport-specific error values
  2017-09-07 23:27 ` [PATCH 1/5] nvme: remove FC transport-specific error values James Smart
@ 2017-09-08  7:24   ` Christoph Hellwig
  2017-09-08 15:23     ` James Smart
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2017-09-08  7:24 UTC (permalink / raw)


Doesn't this need to got last in the series?

(we can fix that up when applying)

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

* [PATCH 1/5] nvme: remove FC transport-specific error values
  2017-09-08  7:24   ` Christoph Hellwig
@ 2017-09-08 15:23     ` James Smart
  0 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2017-09-08 15:23 UTC (permalink / raw)


On 9/8/2017 12:24 AM, Christoph Hellwig wrote:
> Doesn't this need to got last in the series?
> 
> (we can fix that up when applying)
> 

yeah - I guess so - I assumed the set was a unit so order within didn't 
matter. But makes sense that ordering does matter.

-- james

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

* [PATCH 0/5] nvme: remove FC transport status values
  2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
                   ` (4 preceding siblings ...)
  2017-09-07 23:27 ` [PATCH 5/5] lpfc: " James Smart
@ 2017-09-14 16:55 ` Christoph Hellwig
  2017-09-14 17:25   ` James Smart
  5 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2017-09-14 16:55 UTC (permalink / raw)


Just trying to check in:

I'm tempted to add this and the transport SGL patch into the for 4.14
tree given that it's mostly trivial and a spec compliance fix.

Do you (and Jens) agree with that?

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

* [PATCH 0/5] nvme: remove FC transport status values
  2017-09-14 16:55 ` [PATCH 0/5] nvme: remove FC transport status values Christoph Hellwig
@ 2017-09-14 17:25   ` James Smart
  0 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2017-09-14 17:25 UTC (permalink / raw)


I'm good, but it's not critical.

-- james


On 9/14/2017 9:55 AM, Christoph Hellwig wrote:
> Just trying to check in:
>
> I'm tempted to add this and the transport SGL patch into the for 4.14
> tree given that it's mostly trivial and a spec compliance fix.
>
> Do you (and Jens) agree with that?
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2017-09-14 17:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07 23:27 [PATCH 0/5] nvme: remove FC transport status values James Smart
2017-09-07 23:27 ` [PATCH 1/5] nvme: remove FC transport-specific error values James Smart
2017-09-08  7:24   ` Christoph Hellwig
2017-09-08 15:23     ` James Smart
2017-09-07 23:27 ` [PATCH 2/5] nvme-fc: remove use of FC-specific error codes James Smart
2017-09-07 23:27 ` [PATCH 3/5] nvmet-fc: " James Smart
2017-09-07 23:27 ` [PATCH 4/5] nvmet-fcloop: " James Smart
2017-09-07 23:27 ` [PATCH 5/5] lpfc: " James Smart
2017-09-14 16:55 ` [PATCH 0/5] nvme: remove FC transport status values Christoph Hellwig
2017-09-14 17:25   ` James Smart

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