diff options
-rw-r--r-- | drivers/nvme/host/rdma.c | 22 | ||||
-rw-r--r-- | include/linux/nvme-rdma.h | 24 |
2 files changed, 24 insertions, 22 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index aedac6e28c6f..ee789b38bae5 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c | |||
@@ -42,28 +42,6 @@ | |||
42 | 42 | ||
43 | #define NVME_RDMA_MAX_INLINE_SEGMENTS 1 | 43 | #define NVME_RDMA_MAX_INLINE_SEGMENTS 1 |
44 | 44 | ||
45 | static const char *const nvme_rdma_cm_status_strs[] = { | ||
46 | [NVME_RDMA_CM_INVALID_LEN] = "invalid length", | ||
47 | [NVME_RDMA_CM_INVALID_RECFMT] = "invalid record format", | ||
48 | [NVME_RDMA_CM_INVALID_QID] = "invalid queue ID", | ||
49 | [NVME_RDMA_CM_INVALID_HSQSIZE] = "invalid host SQ size", | ||
50 | [NVME_RDMA_CM_INVALID_HRQSIZE] = "invalid host RQ size", | ||
51 | [NVME_RDMA_CM_NO_RSC] = "resource not found", | ||
52 | [NVME_RDMA_CM_INVALID_IRD] = "invalid IRD", | ||
53 | [NVME_RDMA_CM_INVALID_ORD] = "Invalid ORD", | ||
54 | }; | ||
55 | |||
56 | static const char *nvme_rdma_cm_msg(enum nvme_rdma_cm_status status) | ||
57 | { | ||
58 | size_t index = status; | ||
59 | |||
60 | if (index < ARRAY_SIZE(nvme_rdma_cm_status_strs) && | ||
61 | nvme_rdma_cm_status_strs[index]) | ||
62 | return nvme_rdma_cm_status_strs[index]; | ||
63 | else | ||
64 | return "unrecognized reason"; | ||
65 | }; | ||
66 | |||
67 | /* | 45 | /* |
68 | * We handle AEN commands ourselves and don't even let the | 46 | * We handle AEN commands ourselves and don't even let the |
69 | * block layer know about them. | 47 | * block layer know about them. |
diff --git a/include/linux/nvme-rdma.h b/include/linux/nvme-rdma.h index bf240a3cbf99..a72fd04aa5e1 100644 --- a/include/linux/nvme-rdma.h +++ b/include/linux/nvme-rdma.h | |||
@@ -29,6 +29,30 @@ enum nvme_rdma_cm_status { | |||
29 | NVME_RDMA_CM_INVALID_ORD = 0x08, | 29 | NVME_RDMA_CM_INVALID_ORD = 0x08, |
30 | }; | 30 | }; |
31 | 31 | ||
32 | static inline const char *nvme_rdma_cm_msg(enum nvme_rdma_cm_status status) | ||
33 | { | ||
34 | switch (status) { | ||
35 | case NVME_RDMA_CM_INVALID_LEN: | ||
36 | return "invalid length"; | ||
37 | case NVME_RDMA_CM_INVALID_RECFMT: | ||
38 | return "invalid record format"; | ||
39 | case NVME_RDMA_CM_INVALID_QID: | ||
40 | return "invalid queue ID"; | ||
41 | case NVME_RDMA_CM_INVALID_HSQSIZE: | ||
42 | return "invalid host SQ size"; | ||
43 | case NVME_RDMA_CM_INVALID_HRQSIZE: | ||
44 | return "invalid host RQ size"; | ||
45 | case NVME_RDMA_CM_NO_RSC: | ||
46 | return "resource not found"; | ||
47 | case NVME_RDMA_CM_INVALID_IRD: | ||
48 | return "invalid IRD"; | ||
49 | case NVME_RDMA_CM_INVALID_ORD: | ||
50 | return "Invalid ORD"; | ||
51 | default: | ||
52 | return "unrecognized reason"; | ||
53 | } | ||
54 | } | ||
55 | |||
32 | /** | 56 | /** |
33 | * struct nvme_rdma_cm_req - rdma connect request | 57 | * struct nvme_rdma_cm_req - rdma connect request |
34 | * | 58 | * |