nvme-rdma.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2015 Mellanox Technologies. All rights reserved.
  4. */
  5. #ifndef _LINUX_NVME_RDMA_H
  6. #define _LINUX_NVME_RDMA_H
  7. enum nvme_rdma_cm_fmt {
  8. NVME_RDMA_CM_FMT_1_0 = 0x0,
  9. };
  10. enum nvme_rdma_cm_status {
  11. NVME_RDMA_CM_INVALID_LEN = 0x01,
  12. NVME_RDMA_CM_INVALID_RECFMT = 0x02,
  13. NVME_RDMA_CM_INVALID_QID = 0x03,
  14. NVME_RDMA_CM_INVALID_HSQSIZE = 0x04,
  15. NVME_RDMA_CM_INVALID_HRQSIZE = 0x05,
  16. NVME_RDMA_CM_NO_RSC = 0x06,
  17. NVME_RDMA_CM_INVALID_IRD = 0x07,
  18. NVME_RDMA_CM_INVALID_ORD = 0x08,
  19. };
  20. static inline const char *nvme_rdma_cm_msg(enum nvme_rdma_cm_status status)
  21. {
  22. switch (status) {
  23. case NVME_RDMA_CM_INVALID_LEN:
  24. return "invalid length";
  25. case NVME_RDMA_CM_INVALID_RECFMT:
  26. return "invalid record format";
  27. case NVME_RDMA_CM_INVALID_QID:
  28. return "invalid queue ID";
  29. case NVME_RDMA_CM_INVALID_HSQSIZE:
  30. return "invalid host SQ size";
  31. case NVME_RDMA_CM_INVALID_HRQSIZE:
  32. return "invalid host RQ size";
  33. case NVME_RDMA_CM_NO_RSC:
  34. return "resource not found";
  35. case NVME_RDMA_CM_INVALID_IRD:
  36. return "invalid IRD";
  37. case NVME_RDMA_CM_INVALID_ORD:
  38. return "Invalid ORD";
  39. default:
  40. return "unrecognized reason";
  41. }
  42. }
  43. /**
  44. * struct nvme_rdma_cm_req - rdma connect request
  45. *
  46. * @recfmt: format of the RDMA Private Data
  47. * @qid: queue Identifier for the Admin or I/O Queue
  48. * @hrqsize: host receive queue size to be created
  49. * @hsqsize: host send queue size to be created
  50. */
  51. struct nvme_rdma_cm_req {
  52. __le16 recfmt;
  53. __le16 qid;
  54. __le16 hrqsize;
  55. __le16 hsqsize;
  56. u8 rsvd[24];
  57. };
  58. /**
  59. * struct nvme_rdma_cm_rep - rdma connect reply
  60. *
  61. * @recfmt: format of the RDMA Private Data
  62. * @crqsize: controller receive queue size
  63. */
  64. struct nvme_rdma_cm_rep {
  65. __le16 recfmt;
  66. __le16 crqsize;
  67. u8 rsvd[28];
  68. };
  69. /**
  70. * struct nvme_rdma_cm_rej - rdma connect reject
  71. *
  72. * @recfmt: format of the RDMA Private Data
  73. * @sts: error status for the associated connect request
  74. */
  75. struct nvme_rdma_cm_rej {
  76. __le16 recfmt;
  77. __le16 sts;
  78. };
  79. #endif /* _LINUX_NVME_RDMA_H */