Skip to content

Commit db856c1

Browse files
arbaz404igaw
authored andcommitted
types,util: Added Enums for missing status codes
Added enums for missing status codes based on NVM Express Base Specification 2.1 Signed-off-by: Arbaz Khan <arbaz.khan@samsung.com> Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
1 parent 3a304c2 commit db856c1

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

src/nvme/types.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7649,6 +7649,14 @@ struct nvme_mi_vpd_hdr {
76497649
* @NVME_SC_ADMIN_CMD_MEDIA_NOT_READY: Admin Command Media Not Ready: The Admin
76507650
* command requires access to media and
76517651
* the media is not ready.
7652+
* @NVME_SC_INVALID_KEY_TAG: The command was aborted due to an invalid KEYTAG
7653+
* field value.
7654+
* @NVME_SC_HOST_DISPERSED_NS_NOT_ENABLED: The command is prohibited while the
7655+
* Host Disperesed Namespace Support (HDISNS) field is not
7656+
* set to 1h in the Host Behavior Support feature.
7657+
* @NVME_SC_HOST_ID_NOT_INITIALIZED: Host Identifier Not Initialized.
7658+
* @NVME_SC_INCORRECT_KEY: The command was aborted due to the key associated
7659+
* with the KEYTAG field being incorrect.
76527660
* @NVME_SC_FDP_DISABLED: Command is not allowed when
76537661
* Flexible Data Placement is disabled.
76547662
* @NVME_SC_INVALID_PLACEMENT_HANDLE_LIST: The Placement Handle List is invalid
@@ -7672,6 +7680,15 @@ struct nvme_mi_vpd_hdr {
76727680
* namespace.
76737681
* @NVME_SC_FORMAT_IN_PROGRESS: Format In Progress: A Format NVM command
76747682
* is in progress on the namespace.
7683+
* @NVME_SC_INVALID_VALUE_SIZE: The value size is not valid.
7684+
* @NVME_SC_INVALID_KEY_SIZE: The KV key size is not valid.
7685+
* @NVME_SC_KV_KEY_NOT_EXISTS: The Store If Key Exists (SIKE) bit is set to
7686+
* '1' in the Store Option field and the KV key does not
7687+
* exists.
7688+
* @NVME_SC_UNRECOVERED_ERROR: There was an unrecovered error when reading
7689+
* from the meidum.
7690+
* @NVME_SC_KEY_EXISTS: The Store If No Key Exists (SINKE) bit is set to '1'
7691+
* in the Store Option field and the KV key exists.
76757692
* @NVME_SC_CQ_INVALID: Completion Queue Invalid: The Completion
76767693
* Queue identifier specified in the command
76777694
* does not exist.
@@ -8029,13 +8046,22 @@ enum nvme_status_field {
80298046
NVME_SC_TRAN_TPORT_ERROR = 0x22,
80308047
NVME_SC_PROHIBITED_BY_CMD_AND_FEAT = 0x23,
80318048
NVME_SC_ADMIN_CMD_MEDIA_NOT_READY = 0x24,
8049+
NVME_SC_INVALID_KEY_TAG = 0x25,
8050+
NVME_SC_HOST_DISPERSED_NS_NOT_ENABLED = 0x26,
8051+
NVME_SC_HOST_ID_NOT_INITIALIZED = 0x27,
8052+
NVME_SC_INCORRECT_KEY = 0x28,
80328053
NVME_SC_FDP_DISABLED = 0x29,
80338054
NVME_SC_INVALID_PLACEMENT_HANDLE_LIST = 0x2A,
80348055
NVME_SC_LBA_RANGE = 0x80,
80358056
NVME_SC_CAP_EXCEEDED = 0x81,
80368057
NVME_SC_NS_NOT_READY = 0x82,
80378058
NVME_SC_RESERVATION_CONFLICT = 0x83,
80388059
NVME_SC_FORMAT_IN_PROGRESS = 0x84,
8060+
NVME_SC_INVALID_VALUE_SIZE = 0x85,
8061+
NVME_SC_INVALID_KEY_SIZE = 0x86,
8062+
NVME_SC_KV_KEY_NOT_EXISTS = 0x87,
8063+
NVME_SC_UNRECOVERED_ERROR = 0x88,
8064+
NVME_SC_KEY_EXISTS = 0x89,
80398065

80408066
/*
80418067
* Command Specific Status Codes:

src/nvme/util.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ static inline __u8 nvme_generic_status_to_errno(__u16 status)
5353
case NVME_SC_PRP_INVALID_OFFSET:
5454
case NVME_SC_CMB_INVALID_USE:
5555
case NVME_SC_KAT_INVALID:
56+
case NVME_SC_INVALID_KEY_TAG:
57+
case NVME_SC_INCORRECT_KEY:
58+
case NVME_SC_INVALID_VALUE_SIZE:
59+
case NVME_SC_INVALID_KEY_SIZE:
5660
return EINVAL;
5761
case NVME_SC_CMDID_CONFLICT:
5862
return EADDRINUSE;
@@ -228,11 +232,20 @@ static const char * const generic_status[] = {
228232
[NVME_SC_TRAN_TPORT_ERROR] = "Transient Transport Error: A transient transport error was detected",
229233
[NVME_SC_PROHIBITED_BY_CMD_AND_FEAT] = "Command Prohibited by Command and Feature Lockdown: The command was aborted due to command execution being prohibited by the Command and Feature Lockdown",
230234
[NVME_SC_ADMIN_CMD_MEDIA_NOT_READY] = "Admin Command Media Not Ready: The Admin command requires access to media and the media is not ready",
235+
[NVME_SC_INVALID_KEY_TAG] = "The command was aborted due to an invalid KEYTAG field value",
236+
[NVME_SC_HOST_DISPERSED_NS_NOT_ENABLED] = "The command is prohibited while the Host Disperesed Namespace Support (HDISNS) field is not set to 1h in the Host Behavior Support feature",
237+
[NVME_SC_HOST_ID_NOT_INITIALIZED] = "Host Identifier Not Initialized",
238+
[NVME_SC_INCORRECT_KEY] = "The command was aborted due to the key associated with the KEYTAG field being incorrect",
231239
[NVME_SC_LBA_RANGE] = "LBA Out of Range: The command references an LBA that exceeds the size of the namespace",
232240
[NVME_SC_CAP_EXCEEDED] = "Capacity Exceeded: Execution of the command has caused the capacity of the namespace to be exceeded",
233241
[NVME_SC_NS_NOT_READY] = "Namespace Not Ready: The namespace is not ready to be accessed",
234242
[NVME_SC_RESERVATION_CONFLICT] = "Reservation Conflict: The command was aborted due to a conflict with a reservation held on the accessed namespace",
235243
[NVME_SC_FORMAT_IN_PROGRESS] = "Format In Progress: A Format NVM command is in progress on the namespace",
244+
[NVME_SC_INVALID_VALUE_SIZE] = "The value size is not valid",
245+
[NVME_SC_INVALID_KEY_SIZE] = "The KV key size is not valid",
246+
[NVME_SC_KV_KEY_NOT_EXISTS] = "The Store If Key Exists (SIKE) bit is set to '1' in the Store Option field and the KV key does not exists",
247+
[NVME_SC_UNRECOVERED_ERROR] = "There was an unrecovered error when reading from the medium",
248+
[NVME_SC_KEY_EXISTS] = "The Store If No Key Exists (SINKE) bit is set to '1' in the Store Option field and the KV key exists",
236249
};
237250

238251
static const char * const cmd_spec_status[] = {

0 commit comments

Comments
 (0)