rdma_netlink.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. #ifndef _UAPI_RDMA_NETLINK_H
  2. #define _UAPI_RDMA_NETLINK_H
  3. #include <linux/types.h>
  4. enum {
  5. RDMA_NL_RDMA_CM = 1,
  6. RDMA_NL_NES,
  7. RDMA_NL_C4IW,
  8. RDMA_NL_LS, /* RDMA Local Services */
  9. RDMA_NL_NUM_CLIENTS
  10. };
  11. enum {
  12. RDMA_NL_GROUP_CM = 1,
  13. RDMA_NL_GROUP_IWPM,
  14. RDMA_NL_GROUP_LS,
  15. RDMA_NL_NUM_GROUPS
  16. };
  17. #define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
  18. #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
  19. #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
  20. enum {
  21. RDMA_NL_RDMA_CM_ID_STATS = 0,
  22. RDMA_NL_RDMA_CM_NUM_OPS
  23. };
  24. enum {
  25. RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
  26. RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
  27. RDMA_NL_RDMA_CM_NUM_ATTR,
  28. };
  29. /* iwarp port mapper op-codes */
  30. enum {
  31. RDMA_NL_IWPM_REG_PID = 0,
  32. RDMA_NL_IWPM_ADD_MAPPING,
  33. RDMA_NL_IWPM_QUERY_MAPPING,
  34. RDMA_NL_IWPM_REMOVE_MAPPING,
  35. RDMA_NL_IWPM_REMOTE_INFO,
  36. RDMA_NL_IWPM_HANDLE_ERR,
  37. RDMA_NL_IWPM_MAPINFO,
  38. RDMA_NL_IWPM_MAPINFO_NUM,
  39. RDMA_NL_IWPM_NUM_OPS
  40. };
  41. struct rdma_cm_id_stats {
  42. __u32 qp_num;
  43. __u32 bound_dev_if;
  44. __u32 port_space;
  45. __s32 pid;
  46. __u8 cm_state;
  47. __u8 node_type;
  48. __u8 port_num;
  49. __u8 qp_type;
  50. };
  51. enum {
  52. IWPM_NLA_REG_PID_UNSPEC = 0,
  53. IWPM_NLA_REG_PID_SEQ,
  54. IWPM_NLA_REG_IF_NAME,
  55. IWPM_NLA_REG_IBDEV_NAME,
  56. IWPM_NLA_REG_ULIB_NAME,
  57. IWPM_NLA_REG_PID_MAX
  58. };
  59. enum {
  60. IWPM_NLA_RREG_PID_UNSPEC = 0,
  61. IWPM_NLA_RREG_PID_SEQ,
  62. IWPM_NLA_RREG_IBDEV_NAME,
  63. IWPM_NLA_RREG_ULIB_NAME,
  64. IWPM_NLA_RREG_ULIB_VER,
  65. IWPM_NLA_RREG_PID_ERR,
  66. IWPM_NLA_RREG_PID_MAX
  67. };
  68. enum {
  69. IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
  70. IWPM_NLA_MANAGE_MAPPING_SEQ,
  71. IWPM_NLA_MANAGE_ADDR,
  72. IWPM_NLA_MANAGE_MAPPED_LOC_ADDR,
  73. IWPM_NLA_RMANAGE_MAPPING_ERR,
  74. IWPM_NLA_RMANAGE_MAPPING_MAX
  75. };
  76. #define IWPM_NLA_MANAGE_MAPPING_MAX 3
  77. #define IWPM_NLA_QUERY_MAPPING_MAX 4
  78. #define IWPM_NLA_MAPINFO_SEND_MAX 3
  79. enum {
  80. IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
  81. IWPM_NLA_QUERY_MAPPING_SEQ,
  82. IWPM_NLA_QUERY_LOCAL_ADDR,
  83. IWPM_NLA_QUERY_REMOTE_ADDR,
  84. IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
  85. IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
  86. IWPM_NLA_RQUERY_MAPPING_ERR,
  87. IWPM_NLA_RQUERY_MAPPING_MAX
  88. };
  89. enum {
  90. IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
  91. IWPM_NLA_MAPINFO_ULIB_NAME,
  92. IWPM_NLA_MAPINFO_ULIB_VER,
  93. IWPM_NLA_MAPINFO_REQ_MAX
  94. };
  95. enum {
  96. IWPM_NLA_MAPINFO_UNSPEC = 0,
  97. IWPM_NLA_MAPINFO_LOCAL_ADDR,
  98. IWPM_NLA_MAPINFO_MAPPED_ADDR,
  99. IWPM_NLA_MAPINFO_MAX
  100. };
  101. enum {
  102. IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
  103. IWPM_NLA_MAPINFO_SEQ,
  104. IWPM_NLA_MAPINFO_SEND_NUM,
  105. IWPM_NLA_MAPINFO_ACK_NUM,
  106. IWPM_NLA_MAPINFO_NUM_MAX
  107. };
  108. enum {
  109. IWPM_NLA_ERR_UNSPEC = 0,
  110. IWPM_NLA_ERR_SEQ,
  111. IWPM_NLA_ERR_CODE,
  112. IWPM_NLA_ERR_MAX
  113. };
  114. /*
  115. * Local service operations:
  116. * RESOLVE - The client requests the local service to resolve a path.
  117. * SET_TIMEOUT - The local service requests the client to set the timeout.
  118. */
  119. enum {
  120. RDMA_NL_LS_OP_RESOLVE = 0,
  121. RDMA_NL_LS_OP_SET_TIMEOUT,
  122. RDMA_NL_LS_NUM_OPS
  123. };
  124. /* Local service netlink message flags */
  125. #define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */
  126. /*
  127. * Local service resolve operation family header.
  128. * The layout for the resolve operation:
  129. * nlmsg header
  130. * family header
  131. * attributes
  132. */
  133. /*
  134. * Local service path use:
  135. * Specify how the path(s) will be used.
  136. * ALL - For connected CM operation (6 pathrecords)
  137. * UNIDIRECTIONAL - For unidirectional UD (1 pathrecord)
  138. * GMP - For miscellaneous GMP like operation (at least 1 reversible
  139. * pathrecord)
  140. */
  141. enum {
  142. LS_RESOLVE_PATH_USE_ALL = 0,
  143. LS_RESOLVE_PATH_USE_UNIDIRECTIONAL,
  144. LS_RESOLVE_PATH_USE_GMP,
  145. LS_RESOLVE_PATH_USE_MAX
  146. };
  147. #define LS_DEVICE_NAME_MAX 64
  148. struct rdma_ls_resolve_header {
  149. __u8 device_name[LS_DEVICE_NAME_MAX];
  150. __u8 port_num;
  151. __u8 path_use;
  152. };
  153. /* Local service attribute type */
  154. #define RDMA_NLA_F_MANDATORY (1 << 13)
  155. #define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
  156. RDMA_NLA_F_MANDATORY))
  157. /*
  158. * Local service attributes:
  159. * Attr Name Size Byte order
  160. * -----------------------------------------------------
  161. * PATH_RECORD struct ib_path_rec_data
  162. * TIMEOUT u32 cpu
  163. * SERVICE_ID u64 cpu
  164. * DGID u8[16] BE
  165. * SGID u8[16] BE
  166. * TCLASS u8
  167. * PKEY u16 cpu
  168. * QOS_CLASS u16 cpu
  169. */
  170. enum {
  171. LS_NLA_TYPE_UNSPEC = 0,
  172. LS_NLA_TYPE_PATH_RECORD,
  173. LS_NLA_TYPE_TIMEOUT,
  174. LS_NLA_TYPE_SERVICE_ID,
  175. LS_NLA_TYPE_DGID,
  176. LS_NLA_TYPE_SGID,
  177. LS_NLA_TYPE_TCLASS,
  178. LS_NLA_TYPE_PKEY,
  179. LS_NLA_TYPE_QOS_CLASS,
  180. LS_NLA_TYPE_MAX
  181. };
  182. /* Local service DGID/SGID attribute: big endian */
  183. struct rdma_nla_ls_gid {
  184. __u8 gid[16];
  185. };
  186. #endif /* _UAPI_RDMA_NETLINK_H */