rdma_netlink.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _RDMA_NETLINK_H
  3. #define _RDMA_NETLINK_H
  4. #include <linux/types.h>
  5. enum {
  6. RDMA_NL_IWCM = 2,
  7. RDMA_NL_RSVD,
  8. RDMA_NL_LS, /* RDMA Local Services */
  9. RDMA_NL_NLDEV, /* RDMA device interface */
  10. RDMA_NL_NUM_CLIENTS
  11. };
  12. enum {
  13. RDMA_NL_GROUP_IWPM = 2,
  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. /* The minimum version that the iwpm kernel supports */
  21. #define IWPM_UABI_VERSION_MIN 3
  22. /* The latest version that the iwpm kernel supports */
  23. #define IWPM_UABI_VERSION 4
  24. /* iwarp port mapper message flags */
  25. enum {
  26. /* Do not map the port for this IWPM request */
  27. IWPM_FLAGS_NO_PORT_MAP = (1 << 0),
  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_HELLO,
  40. RDMA_NL_IWPM_NUM_OPS
  41. };
  42. enum {
  43. IWPM_NLA_REG_PID_UNSPEC = 0,
  44. IWPM_NLA_REG_PID_SEQ,
  45. IWPM_NLA_REG_IF_NAME,
  46. IWPM_NLA_REG_IBDEV_NAME,
  47. IWPM_NLA_REG_ULIB_NAME,
  48. IWPM_NLA_REG_PID_MAX
  49. };
  50. enum {
  51. IWPM_NLA_RREG_PID_UNSPEC = 0,
  52. IWPM_NLA_RREG_PID_SEQ,
  53. IWPM_NLA_RREG_IBDEV_NAME,
  54. IWPM_NLA_RREG_ULIB_NAME,
  55. IWPM_NLA_RREG_ULIB_VER,
  56. IWPM_NLA_RREG_PID_ERR,
  57. IWPM_NLA_RREG_PID_MAX
  58. };
  59. enum {
  60. IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
  61. IWPM_NLA_MANAGE_MAPPING_SEQ,
  62. IWPM_NLA_MANAGE_ADDR,
  63. IWPM_NLA_MANAGE_FLAGS,
  64. IWPM_NLA_MANAGE_MAPPING_MAX
  65. };
  66. enum {
  67. IWPM_NLA_RMANAGE_MAPPING_UNSPEC = 0,
  68. IWPM_NLA_RMANAGE_MAPPING_SEQ,
  69. IWPM_NLA_RMANAGE_ADDR,
  70. IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
  71. /* The following maintains bisectability of rdma-core */
  72. IWPM_NLA_MANAGE_MAPPED_LOC_ADDR = IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
  73. IWPM_NLA_RMANAGE_MAPPING_ERR,
  74. IWPM_NLA_RMANAGE_MAPPING_MAX
  75. };
  76. #define IWPM_NLA_MAPINFO_SEND_MAX 3
  77. #define IWPM_NLA_REMOVE_MAPPING_MAX 3
  78. enum {
  79. IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
  80. IWPM_NLA_QUERY_MAPPING_SEQ,
  81. IWPM_NLA_QUERY_LOCAL_ADDR,
  82. IWPM_NLA_QUERY_REMOTE_ADDR,
  83. IWPM_NLA_QUERY_FLAGS,
  84. IWPM_NLA_QUERY_MAPPING_MAX,
  85. };
  86. enum {
  87. IWPM_NLA_RQUERY_MAPPING_UNSPEC = 0,
  88. IWPM_NLA_RQUERY_MAPPING_SEQ,
  89. IWPM_NLA_RQUERY_LOCAL_ADDR,
  90. IWPM_NLA_RQUERY_REMOTE_ADDR,
  91. IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
  92. IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
  93. IWPM_NLA_RQUERY_MAPPING_ERR,
  94. IWPM_NLA_RQUERY_MAPPING_MAX
  95. };
  96. enum {
  97. IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
  98. IWPM_NLA_MAPINFO_ULIB_NAME,
  99. IWPM_NLA_MAPINFO_ULIB_VER,
  100. IWPM_NLA_MAPINFO_REQ_MAX
  101. };
  102. enum {
  103. IWPM_NLA_MAPINFO_UNSPEC = 0,
  104. IWPM_NLA_MAPINFO_LOCAL_ADDR,
  105. IWPM_NLA_MAPINFO_MAPPED_ADDR,
  106. IWPM_NLA_MAPINFO_FLAGS,
  107. IWPM_NLA_MAPINFO_MAX
  108. };
  109. enum {
  110. IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
  111. IWPM_NLA_MAPINFO_SEQ,
  112. IWPM_NLA_MAPINFO_SEND_NUM,
  113. IWPM_NLA_MAPINFO_ACK_NUM,
  114. IWPM_NLA_MAPINFO_NUM_MAX
  115. };
  116. enum {
  117. IWPM_NLA_ERR_UNSPEC = 0,
  118. IWPM_NLA_ERR_SEQ,
  119. IWPM_NLA_ERR_CODE,
  120. IWPM_NLA_ERR_MAX
  121. };
  122. enum {
  123. IWPM_NLA_HELLO_UNSPEC = 0,
  124. IWPM_NLA_HELLO_ABI_VERSION,
  125. IWPM_NLA_HELLO_MAX
  126. };
  127. /* For RDMA_NLDEV_ATTR_DEV_NODE_TYPE */
  128. enum {
  129. /* IB values map to NodeInfo:NodeType. */
  130. RDMA_NODE_IB_CA = 1,
  131. RDMA_NODE_IB_SWITCH,
  132. RDMA_NODE_IB_ROUTER,
  133. RDMA_NODE_RNIC,
  134. RDMA_NODE_USNIC,
  135. RDMA_NODE_USNIC_UDP,
  136. RDMA_NODE_UNSPECIFIED,
  137. };
  138. /*
  139. * Local service operations:
  140. * RESOLVE - The client requests the local service to resolve a path.
  141. * SET_TIMEOUT - The local service requests the client to set the timeout.
  142. * IP_RESOLVE - The client requests the local service to resolve an IP to GID.
  143. */
  144. enum {
  145. RDMA_NL_LS_OP_RESOLVE = 0,
  146. RDMA_NL_LS_OP_SET_TIMEOUT,
  147. RDMA_NL_LS_OP_IP_RESOLVE,
  148. RDMA_NL_LS_NUM_OPS
  149. };
  150. /* Local service netlink message flags */
  151. #define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */
  152. /*
  153. * Local service resolve operation family header.
  154. * The layout for the resolve operation:
  155. * nlmsg header
  156. * family header
  157. * attributes
  158. */
  159. /*
  160. * Local service path use:
  161. * Specify how the path(s) will be used.
  162. * ALL - For connected CM operation (6 pathrecords)
  163. * UNIDIRECTIONAL - For unidirectional UD (1 pathrecord)
  164. * GMP - For miscellaneous GMP like operation (at least 1 reversible
  165. * pathrecord)
  166. */
  167. enum {
  168. LS_RESOLVE_PATH_USE_ALL = 0,
  169. LS_RESOLVE_PATH_USE_UNIDIRECTIONAL,
  170. LS_RESOLVE_PATH_USE_GMP,
  171. LS_RESOLVE_PATH_USE_MAX
  172. };
  173. #define LS_DEVICE_NAME_MAX 64
  174. struct rdma_ls_resolve_header {
  175. __u8 device_name[LS_DEVICE_NAME_MAX];
  176. __u8 port_num;
  177. __u8 path_use;
  178. };
  179. struct rdma_ls_ip_resolve_header {
  180. __u32 ifindex;
  181. };
  182. /* Local service attribute type */
  183. #define RDMA_NLA_F_MANDATORY (1 << 13)
  184. #define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
  185. RDMA_NLA_F_MANDATORY))
  186. /*
  187. * Local service attributes:
  188. * Attr Name Size Byte order
  189. * -----------------------------------------------------
  190. * PATH_RECORD struct ib_path_rec_data
  191. * TIMEOUT u32 cpu
  192. * SERVICE_ID u64 cpu
  193. * DGID u8[16] BE
  194. * SGID u8[16] BE
  195. * TCLASS u8
  196. * PKEY u16 cpu
  197. * QOS_CLASS u16 cpu
  198. * IPV4 u32 BE
  199. * IPV6 u8[16] BE
  200. */
  201. enum {
  202. LS_NLA_TYPE_UNSPEC = 0,
  203. LS_NLA_TYPE_PATH_RECORD,
  204. LS_NLA_TYPE_TIMEOUT,
  205. LS_NLA_TYPE_SERVICE_ID,
  206. LS_NLA_TYPE_DGID,
  207. LS_NLA_TYPE_SGID,
  208. LS_NLA_TYPE_TCLASS,
  209. LS_NLA_TYPE_PKEY,
  210. LS_NLA_TYPE_QOS_CLASS,
  211. LS_NLA_TYPE_IPV4,
  212. LS_NLA_TYPE_IPV6,
  213. LS_NLA_TYPE_MAX
  214. };
  215. /* Local service DGID/SGID attribute: big endian */
  216. struct rdma_nla_ls_gid {
  217. __u8 gid[16];
  218. };
  219. enum rdma_nldev_command {
  220. RDMA_NLDEV_CMD_UNSPEC,
  221. RDMA_NLDEV_CMD_GET, /* can dump */
  222. RDMA_NLDEV_CMD_SET,
  223. RDMA_NLDEV_CMD_NEWLINK,
  224. RDMA_NLDEV_CMD_DELLINK,
  225. RDMA_NLDEV_CMD_PORT_GET, /* can dump */
  226. RDMA_NLDEV_CMD_SYS_GET,
  227. RDMA_NLDEV_CMD_SYS_SET,
  228. /* 8 is free to use */
  229. RDMA_NLDEV_CMD_RES_GET = 9, /* can dump */
  230. RDMA_NLDEV_CMD_RES_QP_GET, /* can dump */
  231. RDMA_NLDEV_CMD_RES_CM_ID_GET, /* can dump */
  232. RDMA_NLDEV_CMD_RES_CQ_GET, /* can dump */
  233. RDMA_NLDEV_CMD_RES_MR_GET, /* can dump */
  234. RDMA_NLDEV_CMD_RES_PD_GET, /* can dump */
  235. RDMA_NLDEV_CMD_GET_CHARDEV,
  236. RDMA_NLDEV_CMD_STAT_SET,
  237. RDMA_NLDEV_CMD_STAT_GET, /* can dump */
  238. RDMA_NLDEV_CMD_STAT_DEL,
  239. RDMA_NLDEV_CMD_RES_QP_GET_RAW,
  240. RDMA_NLDEV_CMD_RES_CQ_GET_RAW,
  241. RDMA_NLDEV_CMD_RES_MR_GET_RAW,
  242. RDMA_NLDEV_CMD_RES_CTX_GET, /* can dump */
  243. RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */
  244. RDMA_NLDEV_CMD_STAT_GET_STATUS,
  245. RDMA_NLDEV_NUM_OPS
  246. };
  247. enum rdma_nldev_print_type {
  248. RDMA_NLDEV_PRINT_TYPE_UNSPEC,
  249. RDMA_NLDEV_PRINT_TYPE_HEX,
  250. };
  251. enum rdma_nldev_attr {
  252. /* don't change the order or add anything between, this is ABI! */
  253. RDMA_NLDEV_ATTR_UNSPEC,
  254. /* Pad attribute for 64b alignment */
  255. RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
  256. /* Identifier for ib_device */
  257. RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
  258. RDMA_NLDEV_ATTR_DEV_NAME, /* string */
  259. /*
  260. * Device index together with port index are identifiers
  261. * for port/link properties.
  262. *
  263. * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
  264. * of available ports in ib_device, while for port specific operations,
  265. * it will be real port index as it appears in sysfs. Port index follows
  266. * sysfs notation and starts from 1 for the first port.
  267. */
  268. RDMA_NLDEV_ATTR_PORT_INDEX, /* u32 */
  269. /*
  270. * Device and port capabilities
  271. *
  272. * When used for port info, first 32-bits are CapabilityMask followed by
  273. * 16-bit CapabilityMask2.
  274. */
  275. RDMA_NLDEV_ATTR_CAP_FLAGS, /* u64 */
  276. /*
  277. * FW version
  278. */
  279. RDMA_NLDEV_ATTR_FW_VERSION, /* string */
  280. /*
  281. * Node GUID (in host byte order) associated with the RDMA device.
  282. */
  283. RDMA_NLDEV_ATTR_NODE_GUID, /* u64 */
  284. /*
  285. * System image GUID (in host byte order) associated with
  286. * this RDMA device and other devices which are part of a
  287. * single system.
  288. */
  289. RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */
  290. /*
  291. * Subnet prefix (in host byte order)
  292. */
  293. RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
  294. /*
  295. * Local Identifier (LID),
  296. * According to IB specification, It is 16-bit address assigned
  297. * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
  298. */
  299. RDMA_NLDEV_ATTR_LID, /* u32 */
  300. RDMA_NLDEV_ATTR_SM_LID, /* u32 */
  301. /*
  302. * LID mask control (LMC)
  303. */
  304. RDMA_NLDEV_ATTR_LMC, /* u8 */
  305. RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
  306. RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
  307. RDMA_NLDEV_ATTR_DEV_NODE_TYPE, /* u8 */
  308. RDMA_NLDEV_ATTR_RES_SUMMARY, /* nested table */
  309. RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY, /* nested table */
  310. RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME, /* string */
  311. RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR, /* u64 */
  312. RDMA_NLDEV_ATTR_RES_QP, /* nested table */
  313. RDMA_NLDEV_ATTR_RES_QP_ENTRY, /* nested table */
  314. /*
  315. * Local QPN
  316. */
  317. RDMA_NLDEV_ATTR_RES_LQPN, /* u32 */
  318. /*
  319. * Remote QPN,
  320. * Applicable for RC and UC only IBTA 11.2.5.3 QUERY QUEUE PAIR
  321. */
  322. RDMA_NLDEV_ATTR_RES_RQPN, /* u32 */
  323. /*
  324. * Receive Queue PSN,
  325. * Applicable for RC and UC only 11.2.5.3 QUERY QUEUE PAIR
  326. */
  327. RDMA_NLDEV_ATTR_RES_RQ_PSN, /* u32 */
  328. /*
  329. * Send Queue PSN
  330. */
  331. RDMA_NLDEV_ATTR_RES_SQ_PSN, /* u32 */
  332. RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE, /* u8 */
  333. /*
  334. * QP types as visible to RDMA/core, the reserved QPT
  335. * are not exported through this interface.
  336. */
  337. RDMA_NLDEV_ATTR_RES_TYPE, /* u8 */
  338. RDMA_NLDEV_ATTR_RES_STATE, /* u8 */
  339. /*
  340. * Process ID which created object,
  341. * in case of kernel origin, PID won't exist.
  342. */
  343. RDMA_NLDEV_ATTR_RES_PID, /* u32 */
  344. /*
  345. * The name of process created following resource.
  346. * It will exist only for kernel objects.
  347. * For user created objects, the user is supposed
  348. * to read /proc/PID/comm file.
  349. */
  350. RDMA_NLDEV_ATTR_RES_KERN_NAME, /* string */
  351. RDMA_NLDEV_ATTR_RES_CM_ID, /* nested table */
  352. RDMA_NLDEV_ATTR_RES_CM_ID_ENTRY, /* nested table */
  353. /*
  354. * rdma_cm_id port space.
  355. */
  356. RDMA_NLDEV_ATTR_RES_PS, /* u32 */
  357. /*
  358. * Source and destination socket addresses
  359. */
  360. RDMA_NLDEV_ATTR_RES_SRC_ADDR, /* __kernel_sockaddr_storage */
  361. RDMA_NLDEV_ATTR_RES_DST_ADDR, /* __kernel_sockaddr_storage */
  362. RDMA_NLDEV_ATTR_RES_CQ, /* nested table */
  363. RDMA_NLDEV_ATTR_RES_CQ_ENTRY, /* nested table */
  364. RDMA_NLDEV_ATTR_RES_CQE, /* u32 */
  365. RDMA_NLDEV_ATTR_RES_USECNT, /* u64 */
  366. RDMA_NLDEV_ATTR_RES_POLL_CTX, /* u8 */
  367. RDMA_NLDEV_ATTR_RES_MR, /* nested table */
  368. RDMA_NLDEV_ATTR_RES_MR_ENTRY, /* nested table */
  369. RDMA_NLDEV_ATTR_RES_RKEY, /* u32 */
  370. RDMA_NLDEV_ATTR_RES_LKEY, /* u32 */
  371. RDMA_NLDEV_ATTR_RES_IOVA, /* u64 */
  372. RDMA_NLDEV_ATTR_RES_MRLEN, /* u64 */
  373. RDMA_NLDEV_ATTR_RES_PD, /* nested table */
  374. RDMA_NLDEV_ATTR_RES_PD_ENTRY, /* nested table */
  375. RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
  376. RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
  377. /*
  378. * Provides logical name and index of netdevice which is
  379. * connected to physical port. This information is relevant
  380. * for RoCE and iWARP.
  381. *
  382. * The netdevices which are associated with containers are
  383. * supposed to be exported together with GID table once it
  384. * will be exposed through the netlink. Because the
  385. * associated netdevices are properties of GIDs.
  386. */
  387. RDMA_NLDEV_ATTR_NDEV_INDEX, /* u32 */
  388. RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
  389. /*
  390. * driver-specific attributes.
  391. */
  392. RDMA_NLDEV_ATTR_DRIVER, /* nested table */
  393. RDMA_NLDEV_ATTR_DRIVER_ENTRY, /* nested table */
  394. RDMA_NLDEV_ATTR_DRIVER_STRING, /* string */
  395. /*
  396. * u8 values from enum rdma_nldev_print_type
  397. */
  398. RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE, /* u8 */
  399. RDMA_NLDEV_ATTR_DRIVER_S32, /* s32 */
  400. RDMA_NLDEV_ATTR_DRIVER_U32, /* u32 */
  401. RDMA_NLDEV_ATTR_DRIVER_S64, /* s64 */
  402. RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */
  403. /*
  404. * Indexes to get/set secific entry,
  405. * for QP use RDMA_NLDEV_ATTR_RES_LQPN
  406. */
  407. RDMA_NLDEV_ATTR_RES_PDN, /* u32 */
  408. RDMA_NLDEV_ATTR_RES_CQN, /* u32 */
  409. RDMA_NLDEV_ATTR_RES_MRN, /* u32 */
  410. RDMA_NLDEV_ATTR_RES_CM_IDN, /* u32 */
  411. RDMA_NLDEV_ATTR_RES_CTXN, /* u32 */
  412. /*
  413. * Identifies the rdma driver. eg: "rxe" or "siw"
  414. */
  415. RDMA_NLDEV_ATTR_LINK_TYPE, /* string */
  416. /*
  417. * net namespace mode for rdma subsystem:
  418. * either shared or exclusive among multiple net namespaces.
  419. */
  420. RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */
  421. /*
  422. * Device protocol, e.g. ib, iw, usnic, roce and opa
  423. */
  424. RDMA_NLDEV_ATTR_DEV_PROTOCOL, /* string */
  425. /*
  426. * File descriptor handle of the net namespace object
  427. */
  428. RDMA_NLDEV_NET_NS_FD, /* u32 */
  429. /*
  430. * Information about a chardev.
  431. * CHARDEV_TYPE is the name of the chardev ABI (ie uverbs, umad, etc)
  432. * CHARDEV_ABI signals the ABI revision (historical)
  433. * CHARDEV_NAME is the kernel name for the /dev/ file (no directory)
  434. * CHARDEV is the 64 bit dev_t for the inode
  435. */
  436. RDMA_NLDEV_ATTR_CHARDEV_TYPE, /* string */
  437. RDMA_NLDEV_ATTR_CHARDEV_NAME, /* string */
  438. RDMA_NLDEV_ATTR_CHARDEV_ABI, /* u64 */
  439. RDMA_NLDEV_ATTR_CHARDEV, /* u64 */
  440. RDMA_NLDEV_ATTR_UVERBS_DRIVER_ID, /* u64 */
  441. /*
  442. * Counter-specific attributes.
  443. */
  444. RDMA_NLDEV_ATTR_STAT_MODE, /* u32 */
  445. RDMA_NLDEV_ATTR_STAT_RES, /* u32 */
  446. RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK, /* u32 */
  447. RDMA_NLDEV_ATTR_STAT_COUNTER, /* nested table */
  448. RDMA_NLDEV_ATTR_STAT_COUNTER_ENTRY, /* nested table */
  449. RDMA_NLDEV_ATTR_STAT_COUNTER_ID, /* u32 */
  450. RDMA_NLDEV_ATTR_STAT_HWCOUNTERS, /* nested table */
  451. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY, /* nested table */
  452. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_NAME, /* string */
  453. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_VALUE, /* u64 */
  454. /*
  455. * CQ adaptive moderatio (DIM)
  456. */
  457. RDMA_NLDEV_ATTR_DEV_DIM, /* u8 */
  458. RDMA_NLDEV_ATTR_RES_RAW, /* binary */
  459. RDMA_NLDEV_ATTR_RES_CTX, /* nested table */
  460. RDMA_NLDEV_ATTR_RES_CTX_ENTRY, /* nested table */
  461. RDMA_NLDEV_ATTR_RES_SRQ, /* nested table */
  462. RDMA_NLDEV_ATTR_RES_SRQ_ENTRY, /* nested table */
  463. RDMA_NLDEV_ATTR_RES_SRQN, /* u32 */
  464. RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */
  465. RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */
  466. RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK, /* u8 */
  467. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX, /* u32 */
  468. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC, /* u8 */
  469. /*
  470. * Always the end
  471. */
  472. RDMA_NLDEV_ATTR_MAX
  473. };
  474. /*
  475. * Supported counter bind modes. All modes are mutual-exclusive.
  476. */
  477. enum rdma_nl_counter_mode {
  478. RDMA_COUNTER_MODE_NONE,
  479. /*
  480. * A qp is bound with a counter automatically during initialization
  481. * based on the auto mode (e.g., qp type, ...)
  482. */
  483. RDMA_COUNTER_MODE_AUTO,
  484. /*
  485. * Which qp are bound with which counter is explicitly specified
  486. * by the user
  487. */
  488. RDMA_COUNTER_MODE_MANUAL,
  489. /*
  490. * Always the end
  491. */
  492. RDMA_COUNTER_MODE_MAX,
  493. };
  494. /*
  495. * Supported criteria in counter auto mode.
  496. * Currently only "qp type" is supported
  497. */
  498. enum rdma_nl_counter_mask {
  499. RDMA_COUNTER_MASK_QP_TYPE = 1,
  500. RDMA_COUNTER_MASK_PID = 1 << 1,
  501. };
  502. #endif /* _RDMA_NETLINK_H */