Skip to content

Commit 3febb1a

Browse files
sc108-leekeithbusch
authored andcommitted
nvme status code updates based nvme spec v1.4
1 parent 74d5070 commit 3febb1a

2 files changed

Lines changed: 63 additions & 2 deletions

File tree

linux/nvme.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,20 +1299,28 @@ enum {
12991299
NVME_SC_SGL_INVALID_DATA = 0xf,
13001300
NVME_SC_SGL_INVALID_METADATA = 0x10,
13011301
NVME_SC_SGL_INVALID_TYPE = 0x11,
1302-
1302+
NVME_SC_CMB_INVALID_USE = 0x12,
1303+
NVME_SC_PRP_INVALID_OFFSET = 0x13,
1304+
NVME_SC_ATOMIC_WRITE_UNIT_EXCEEDED= 0x14,
1305+
NVME_SC_OPERATION_DENIED = 0x15,
13031306
NVME_SC_SGL_INVALID_OFFSET = 0x16,
1304-
NVME_SC_SGL_INVALID_SUBTYPE = 0x17,
13051307

1308+
NVME_SC_INCONSISTENT_HOST_ID= 0x18,
1309+
NVME_SC_KEEP_ALIVE_EXPIRED = 0x19,
1310+
NVME_SC_KEEP_ALIVE_INVALID = 0x1A,
1311+
NVME_SC_PREEMPT_ABORT = 0x1B,
13061312
NVME_SC_SANITIZE_FAILED = 0x1C,
13071313
NVME_SC_SANITIZE_IN_PROGRESS = 0x1D,
13081314

13091315
NVME_SC_NS_WRITE_PROTECTED = 0x20,
13101316
NVME_SC_CMD_INTERRUPTED = 0x21,
1317+
NVME_SC_TRANSIENT_TRANSPORT = 0x22,
13111318

13121319
NVME_SC_LBA_RANGE = 0x80,
13131320
NVME_SC_CAP_EXCEEDED = 0x81,
13141321
NVME_SC_NS_NOT_READY = 0x82,
13151322
NVME_SC_RESERVATION_CONFLICT = 0x83,
1323+
NVME_SC_FORMAT_IN_PROGRESS = 0x84,
13161324

13171325
/*
13181326
* Command Specific Status:
@@ -1345,8 +1353,15 @@ enum {
13451353
NVME_SC_NS_NOT_ATTACHED = 0x11a,
13461354
NVME_SC_THIN_PROV_NOT_SUPP = 0x11b,
13471355
NVME_SC_CTRL_LIST_INVALID = 0x11c,
1356+
NVME_SC_DEVICE_SELF_TEST_IN_PROGRESS= 0x11d,
13481357
NVME_SC_BP_WRITE_PROHIBITED = 0x11e,
1358+
NVME_SC_INVALID_CTRL_ID = 0x11f,
1359+
NVME_SC_INVALID_SECONDARY_CTRL_STATE= 0x120,
1360+
NVME_SC_INVALID_NUM_CTRL_RESOURCE = 0x121,
1361+
NVME_SC_INVALID_RESOURCE_ID = 0x122,
13491362
NVME_SC_PMR_SAN_PROHIBITED = 0x123,
1363+
NVME_SC_ANA_INVALID_GROUP_ID= 0x124,
1364+
NVME_SC_ANA_ATTACH_FAIL = 0x125,
13501365

13511366
/*
13521367
* I/O Command Set Specific - NVM commands:

nvme-print.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,6 +3807,34 @@ const char *nvme_status_to_string(__u32 status)
38073807
return "INVALID_NS: The namespace or the format of that namespace is invalid";
38083808
case NVME_SC_CMD_SEQ_ERROR:
38093809
return "CMD_SEQ_ERROR: The command was aborted due to a protocol violation in a multicommand sequence";
3810+
case NVME_SC_SGL_INVALID_LAST:
3811+
return "SGL_INVALID_LAST: The command includes an invalid SGL Last Segment or SGL Segment descriptor.";
3812+
case NVME_SC_SGL_INVALID_COUNT:
3813+
return "SGL_INVALID_COUNT: There is an SGL Last Segment descriptor or an SGL Segment descriptor in a location other than the last descriptor of a segment based on the length indicated.";
3814+
case NVME_SC_SGL_INVALID_DATA:
3815+
return "SGL_INVALID_DATA: This may occur if the length of a Data SGL is too short.";
3816+
case NVME_SC_SGL_INVALID_METADATA:
3817+
return "SGL_INVALID_METADATA: This may occur if the length of a Metadata SGL is too short";
3818+
case NVME_SC_SGL_INVALID_TYPE:
3819+
return "SGL_INVALID_TYPE: The type of an SGL Descriptor is a type that is not supported by the controller.";
3820+
case NVME_SC_CMB_INVALID_USE:
3821+
return "CMB_INVALID_USE: The attempted use of the Controller Memory Buffer is not supported by the controller.";
3822+
case NVME_SC_PRP_INVALID_OFFSET:
3823+
return "PRP_INVALID_OFFSET: The Offset field for a PRP entry is invalid.";
3824+
case NVME_SC_ATOMIC_WRITE_UNIT_EXCEEDED:
3825+
return "ATOMIC_WRITE_UNIT_EXCEEDED: The length specified exceeds the atomic write unit size.";
3826+
case NVME_SC_OPERATION_DENIED:
3827+
return "OPERATION_DENIED: The command was denied due to lack of access rights.";
3828+
case NVME_SC_SGL_INVALID_OFFSET:
3829+
return "SGL_INVALID_OFFSET: The offset specified in a descriptor is invalid.";
3830+
case NVME_SC_INCONSISTENT_HOST_ID:
3831+
return "INCONSISTENT_HOST_ID: The NVM subsystem detected the simultaneous use of 64-bit and 128-bit Host Identifier values on different controllers.";
3832+
case NVME_SC_KEEP_ALIVE_EXPIRED:
3833+
return "KEEP_ALIVE_EXPIRED: The Keep Alive Timer expired.";
3834+
case NVME_SC_KEEP_ALIVE_INVALID:
3835+
return "KEEP_ALIVE_INVALID: The Keep Alive Timeout value specified is invalid.";
3836+
case NVME_SC_PREEMPT_ABORT:
3837+
return "PREEMPT_ABORT: The command was aborted due to a Reservation Acquire command with the Reservation Acquire Action (RACQA) set to 010b (Preempt and Abort).";
38103838
case NVME_SC_SANITIZE_FAILED:
38113839
return "SANITIZE_FAILED: The most recent sanitize operation failed and no recovery actions has been successfully completed";
38123840
case NVME_SC_SANITIZE_IN_PROGRESS:
@@ -3815,12 +3843,16 @@ const char *nvme_status_to_string(__u32 status)
38153843
return "LBA_RANGE: The command references a LBA that exceeds the size of the namespace";
38163844
case NVME_SC_NS_WRITE_PROTECTED:
38173845
return "NS_WRITE_PROTECTED: The command is prohibited while the namespace is write protected by the host.";
3846+
case NVME_SC_TRANSIENT_TRANSPORT:
3847+
return "TRANSIENT_TRANSPORT: A transient transport error was detected.";
38183848
case NVME_SC_CAP_EXCEEDED:
38193849
return "CAP_EXCEEDED: The execution of the command has caused the capacity of the namespace to be exceeded";
38203850
case NVME_SC_NS_NOT_READY:
38213851
return "NS_NOT_READY: The namespace is not ready to be accessed as a result of a condition other than a condition that is reported as an Asymmetric Namespace Access condition";
38223852
case NVME_SC_RESERVATION_CONFLICT:
38233853
return "RESERVATION_CONFLICT: The command was aborted due to a conflict with a reservation held on the accessed namespace";
3854+
case NVME_SC_FORMAT_IN_PROGRESS:
3855+
return "FORMAT_IN_PROGRESS: A Format NVM command is in progress on the namespace.";
38243856
case NVME_SC_CQ_INVALID:
38253857
return "CQ_INVALID: The Completion Queue identifier specified in the command does not exist";
38263858
case NVME_SC_QID_INVALID:
@@ -3877,8 +3909,22 @@ const char *nvme_status_to_string(__u32 status)
38773909
return "THIN_PROVISIONING_NOT_SUPPORTED: Thin provisioning is not supported by the controller";
38783910
case NVME_SC_CTRL_LIST_INVALID:
38793911
return "CONTROLLER_LIST_INVALID: The controller list provided is invalid";
3912+
case NVME_SC_DEVICE_SELF_TEST_IN_PROGRESS:
3913+
return "DEVICE_SELF_TEST_IN_PROGRESS: The controller or NVM subsystem already has a device self-test operation in process.";
38803914
case NVME_SC_BP_WRITE_PROHIBITED:
38813915
return "BOOT PARTITION WRITE PROHIBITED: The command is trying to modify a Boot Partition while it is locked";
3916+
case NVME_SC_INVALID_CTRL_ID:
3917+
return "INVALID_CTRL_ID: An invalid Controller Identifier was specified.";
3918+
case NVME_SC_INVALID_SECONDARY_CTRL_STATE:
3919+
return "INVALID_SECONDARY_CTRL_STATE: The action requested for the secondary controller is invalid based on the current state of the secondary controller and its primary controller.";
3920+
case NVME_SC_INVALID_NUM_CTRL_RESOURCE:
3921+
return "INVALID_NUM_CTRL_RESOURCE: The specified number of Flexible Resources is invalid";
3922+
case NVME_SC_INVALID_RESOURCE_ID:
3923+
return "INVALID_RESOURCE_ID: At least one of the specified resource identifiers was invalid";
3924+
case NVME_SC_ANA_INVALID_GROUP_ID:
3925+
return "ANA_INVALID_GROUP_ID: The specified ANA Group Identifier (ANAGRPID) is not supported in the submitted command.";
3926+
case NVME_SC_ANA_ATTACH_FAIL:
3927+
return "ANA_ATTACH_FAIL: The controller is not attached to the namespace as a result of an ANA condition";
38823928
case NVME_SC_BAD_ATTRIBUTES:
38833929
return "BAD_ATTRIBUTES: Bad attributes were given";
38843930
case NVME_SC_WRITE_FAULT:

0 commit comments

Comments
 (0)