0001
0002
0003
0004
0005
0006 #ifndef _LINUX_NVME_RDMA_H
0007 #define _LINUX_NVME_RDMA_H
0008
0009 #define NVME_RDMA_MAX_QUEUE_SIZE 128
0010
0011 enum nvme_rdma_cm_fmt {
0012 NVME_RDMA_CM_FMT_1_0 = 0x0,
0013 };
0014
0015 enum nvme_rdma_cm_status {
0016 NVME_RDMA_CM_INVALID_LEN = 0x01,
0017 NVME_RDMA_CM_INVALID_RECFMT = 0x02,
0018 NVME_RDMA_CM_INVALID_QID = 0x03,
0019 NVME_RDMA_CM_INVALID_HSQSIZE = 0x04,
0020 NVME_RDMA_CM_INVALID_HRQSIZE = 0x05,
0021 NVME_RDMA_CM_NO_RSC = 0x06,
0022 NVME_RDMA_CM_INVALID_IRD = 0x07,
0023 NVME_RDMA_CM_INVALID_ORD = 0x08,
0024 };
0025
0026 static inline const char *nvme_rdma_cm_msg(enum nvme_rdma_cm_status status)
0027 {
0028 switch (status) {
0029 case NVME_RDMA_CM_INVALID_LEN:
0030 return "invalid length";
0031 case NVME_RDMA_CM_INVALID_RECFMT:
0032 return "invalid record format";
0033 case NVME_RDMA_CM_INVALID_QID:
0034 return "invalid queue ID";
0035 case NVME_RDMA_CM_INVALID_HSQSIZE:
0036 return "invalid host SQ size";
0037 case NVME_RDMA_CM_INVALID_HRQSIZE:
0038 return "invalid host RQ size";
0039 case NVME_RDMA_CM_NO_RSC:
0040 return "resource not found";
0041 case NVME_RDMA_CM_INVALID_IRD:
0042 return "invalid IRD";
0043 case NVME_RDMA_CM_INVALID_ORD:
0044 return "Invalid ORD";
0045 default:
0046 return "unrecognized reason";
0047 }
0048 }
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 struct nvme_rdma_cm_req {
0059 __le16 recfmt;
0060 __le16 qid;
0061 __le16 hrqsize;
0062 __le16 hsqsize;
0063 u8 rsvd[24];
0064 };
0065
0066
0067
0068
0069
0070
0071
0072 struct nvme_rdma_cm_rep {
0073 __le16 recfmt;
0074 __le16 crqsize;
0075 u8 rsvd[28];
0076 };
0077
0078
0079
0080
0081
0082
0083
0084 struct nvme_rdma_cm_rej {
0085 __le16 recfmt;
0086 __le16 sts;
0087 };
0088
0089 #endif