nvme: remove FC transport status values
Subsystems (5)
cover nvme: remove FC transport status values
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(-)
Signature · 1 line
2.13.1
PATCH 1/5 nvme: remove FC transport-specific error values
The NVM express group recinded the reserved range for the transport. Remove the FC-centric values that had been defined.
--- include/linux/nvme.h | 13 ------------- 1 file changed, 13 deletions(-)
include/linux/nvme.h +0 -13
@@ -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 {
Signature · 1 line
2.13.1
PATCH 1/5 nvme: remove FC transport-specific error values
Doesn't this need to got last in the series?
(we can fix that up when applying)
PATCH 1/5 nvme: remove FC transport-specific error values
Quoted 4 lines · Christoph Hellwig
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
PATCH 2/5 nvme-fc: remove use of FC-specific error codes
In reply to James SmartThe 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).
--- drivers/nvme/host/fc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/nvme/host/fc.c +4 -4
@@ -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; }
Signature · 1 line
2.13.1
PATCH 3/5 nvmet-fc: remove use of FC-specific error codes
In reply to James SmartThe 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).
--- drivers/nvme/target/fc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/nvme/target/fc.c +3 -6
@@ -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 ; }
Signature · 1 line
2.13.1
PATCH 4/5 nvmet-fcloop: remove use of FC-specific error codes
In reply to James SmartThe 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).
--- drivers/nvme/target/fcloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/fcloop.c +1 -1
@@ -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
Signature · 1 line
2.13.1
PATCH 5/5 lpfc: remove use of FC-specific error codes
In reply to James SmartThe 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).
--- drivers/scsi/lpfc/lpfc_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_nvme.c +1 -1
@@ -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 ; } }
Signature · 1 line
2.13.1
cover nvme: remove FC transport status values
In reply to James SmartJust 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?
cover nvme: remove FC transport status values
I'm good, but it's not critical.
-- james
Quoted 11 lines · Christoph Hellwig
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