]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: add path related error status codes
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Fri, 19 Feb 2021 19:14:49 +0000 (00:44 +0530)
committerKeith Busch <kbusch@kernel.org>
Fri, 19 Feb 2021 19:25:40 +0000 (12:25 -0700)
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
linux/nvme.h
nvme-print.c
nvme-status.c

index e6ead4590af3f52c79af3c59c99379ff7121eaa8..3318ea2eb74212cde59be464809669b33874b106 100644 (file)
@@ -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,
 };
index a1e63782b89eb4d7b710c39c61cc941cd2f6c066..fbc34a9e0772fc9c587fb07c05489a9d128217cf 100755 (executable)
@@ -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:
index 35467512ffd46058ce761fadce1535c8c7054f54..270eb06326f4b6d09a2b356f7543f373d3203a95 100644 (file)
@@ -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;
        }