From: Gollu Appalanaidu Date: Fri, 19 Feb 2021 19:14:49 +0000 (+0530) Subject: nvme: add path related error status codes X-Git-Tag: v1.14~78 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=897b1cbf64857e42ba5d120e2ff60c11da85a833;p=users%2Fsagi%2Fnvme-cli.git nvme: add path related error status codes Signed-off-by: Gollu Appalanaidu --- diff --git a/linux/nvme.h b/linux/nvme.h index e6ead459..3318ea2e 100644 --- a/linux/nvme.h +++ b/linux/nvme.h @@ -1635,10 +1635,22 @@ enum { /* * Path-related Errors: */ + NVME_SC_INTERNAL_PATH_ERROR = 0x300, NVME_SC_ANA_PERSISTENT_LOSS = 0x301, NVME_SC_ANA_INACCESSIBLE = 0x302, NVME_SC_ANA_TRANSITION = 0x303, + /* + * Controller Detected Path errors + */ + NVME_SC_CTRL_PATHING_ERROR = 0x360, + + /* + * Host Detected Path Errors + */ + NVME_SC_HOST_PATHING_ERROR = 0x370, + NVME_SC_HOST_CMD_ABORT = 0x371, + NVME_SC_CRD = 0x1800, NVME_SC_DNR = 0x4000, }; diff --git a/nvme-print.c b/nvme-print.c index a1e63782..fbc34a9e 100755 --- a/nvme-print.c +++ b/nvme-print.c @@ -5017,12 +5017,20 @@ const char *nvme_status_to_string(__u16 status) return "ACCESS_DENIED: Access to the namespace and/or LBA range is denied due to lack of access rights"; case NVME_SC_UNWRITTEN_BLOCK: return "UNWRITTEN_BLOCK: The command failed due to an attempt to read from an LBA range containing a deallocated or unwritten logical block"; + case NVME_SC_INTERNAL_PATH_ERROR: + return "INTERNAL_PATH_ERROT: The command was not completed as the result of a controller internal error"; case NVME_SC_ANA_PERSISTENT_LOSS: return "ASYMMETRIC_NAMESPACE_ACCESS_PERSISTENT_LOSS: The requested function (e.g., command) is not able to be performed as a result of the relationship between the controller and the namespace being in the ANA Persistent Loss state"; case NVME_SC_ANA_INACCESSIBLE: return "ASYMMETRIC_NAMESPACE_ACCESS_INACCESSIBLE: The requested function (e.g., command) is not able to be performed as a result of the relationship between the controller and the namespace being in the ANA Inaccessible state"; case NVME_SC_ANA_TRANSITION: return "ASYMMETRIC_NAMESPACE_ACCESS_TRANSITION: The requested function (e.g., command) is not able to be performed as a result of the relationship between the controller and the namespace transitioning between Asymmetric Namespace Access states"; + case NVME_SC_CTRL_PATHING_ERROR: + return "CONTROLLER_PATHING_ERROR: A pathing error was detected by the controller"; + case NVME_SC_HOST_PATHING_ERROR: + return "HOST_PATHING_ERROR: A pathing error was detected by the host"; + case NVME_SC_HOST_CMD_ABORT: + return "HOST_COMMAND_ABORT: The command was aborted as a result of host action"; case NVME_SC_CMD_INTERRUPTED: return "CMD_INTERRUPTED: Command processing was interrupted and the controller is unable to successfully complete the command. The host should retry the command."; case NVME_SC_PMR_SAN_PROHIBITED: diff --git a/nvme-status.c b/nvme-status.c index 35467512..270eb063 100644 --- a/nvme-status.c +++ b/nvme-status.c @@ -129,9 +129,13 @@ static inline __u8 nvme_fabrics_status_to_errno(__u16 status) static inline __u8 nvme_path_status_to_errno(__u16 status) { switch (status) { + case NVME_SC_INTERNAL_PATH_ERROR: case NVME_SC_ANA_PERSISTENT_LOSS: case NVME_SC_ANA_INACCESSIBLE: case NVME_SC_ANA_TRANSITION: + case NVME_SC_CTRL_PATHING_ERROR: + case NVME_SC_HOST_PATHING_ERROR: + case NVME_SC_HOST_CMD_ABORT: return EACCES; }