rdma_netlink.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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_NUM_OPS
  240. };
  241. enum rdma_nldev_print_type {
  242. RDMA_NLDEV_PRINT_TYPE_UNSPEC,
  243. RDMA_NLDEV_PRINT_TYPE_HEX,
  244. };
  245. enum rdma_nldev_attr {
  246. /* don't change the order or add anything between, this is ABI! */
  247. RDMA_NLDEV_ATTR_UNSPEC,
  248. /* Pad attribute for 64b alignment */
  249. RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
  250. /* Identifier for ib_device */
  251. RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
  252. RDMA_NLDEV_ATTR_DEV_NAME, /* string */
  253. /*
  254. * Device index together with port index are identifiers
  255. * for port/link properties.
  256. *
  257. * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
  258. * of available ports in ib_device, while for port specific operations,
  259. * it will be real port index as it appears in sysfs. Port index follows
  260. * sysfs notation and starts from 1 for the first port.
  261. */
  262. RDMA_NLDEV_ATTR_PORT_INDEX, /* u32 */
  263. /*
  264. * Device and port capabilities
  265. *
  266. * When used for port info, first 32-bits are CapabilityMask followed by
  267. * 16-bit CapabilityMask2.
  268. */
  269. RDMA_NLDEV_ATTR_CAP_FLAGS, /* u64 */
  270. /*
  271. * FW version
  272. */
  273. RDMA_NLDEV_ATTR_FW_VERSION, /* string */
  274. /*
  275. * Node GUID (in host byte order) associated with the RDMA device.
  276. */
  277. RDMA_NLDEV_ATTR_NODE_GUID, /* u64 */
  278. /*
  279. * System image GUID (in host byte order) associated with
  280. * this RDMA device and other devices which are part of a
  281. * single system.
  282. */
  283. RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */
  284. /*
  285. * Subnet prefix (in host byte order)
  286. */
  287. RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
  288. /*
  289. * Local Identifier (LID),
  290. * According to IB specification, It is 16-bit address assigned
  291. * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
  292. */
  293. RDMA_NLDEV_ATTR_LID, /* u32 */
  294. RDMA_NLDEV_ATTR_SM_LID, /* u32 */
  295. /*
  296. * LID mask control (LMC)
  297. */
  298. RDMA_NLDEV_ATTR_LMC, /* u8 */
  299. RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
  300. RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
  301. RDMA_NLDEV_ATTR_DEV_NODE_TYPE, /* u8 */
  302. RDMA_NLDEV_ATTR_RES_SUMMARY, /* nested table */
  303. RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY, /* nested table */
  304. RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME, /* string */
  305. RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR, /* u64 */
  306. RDMA_NLDEV_ATTR_RES_QP, /* nested table */
  307. RDMA_NLDEV_ATTR_RES_QP_ENTRY, /* nested table */
  308. /*
  309. * Local QPN
  310. */
  311. RDMA_NLDEV_ATTR_RES_LQPN, /* u32 */
  312. /*
  313. * Remote QPN,
  314. * Applicable for RC and UC only IBTA 11.2.5.3 QUERY QUEUE PAIR
  315. */
  316. RDMA_NLDEV_ATTR_RES_RQPN, /* u32 */
  317. /*
  318. * Receive Queue PSN,
  319. * Applicable for RC and UC only 11.2.5.3 QUERY QUEUE PAIR
  320. */
  321. RDMA_NLDEV_ATTR_RES_RQ_PSN, /* u32 */
  322. /*
  323. * Send Queue PSN
  324. */
  325. RDMA_NLDEV_ATTR_RES_SQ_PSN, /* u32 */
  326. RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE, /* u8 */
  327. /*
  328. * QP types as visible to RDMA/core, the reserved QPT
  329. * are not exported through this interface.
  330. */
  331. RDMA_NLDEV_ATTR_RES_TYPE, /* u8 */
  332. RDMA_NLDEV_ATTR_RES_STATE, /* u8 */
  333. /*
  334. * Process ID which created object,
  335. * in case of kernel origin, PID won't exist.
  336. */
  337. RDMA_NLDEV_ATTR_RES_PID, /* u32 */
  338. /*
  339. * The name of process created following resource.
  340. * It will exist only for kernel objects.
  341. * For user created objects, the user is supposed
  342. * to read /proc/PID/comm file.
  343. */
  344. RDMA_NLDEV_ATTR_RES_KERN_NAME, /* string */
  345. RDMA_NLDEV_ATTR_RES_CM_ID, /* nested table */
  346. RDMA_NLDEV_ATTR_RES_CM_ID_ENTRY, /* nested table */
  347. /*
  348. * rdma_cm_id port space.
  349. */
  350. RDMA_NLDEV_ATTR_RES_PS, /* u32 */
  351. /*
  352. * Source and destination socket addresses
  353. */
  354. RDMA_NLDEV_ATTR_RES_SRC_ADDR, /* __kernel_sockaddr_storage */
  355. RDMA_NLDEV_ATTR_RES_DST_ADDR, /* __kernel_sockaddr_storage */
  356. RDMA_NLDEV_ATTR_RES_CQ, /* nested table */
  357. RDMA_NLDEV_ATTR_RES_CQ_ENTRY, /* nested table */
  358. RDMA_NLDEV_ATTR_RES_CQE, /* u32 */
  359. RDMA_NLDEV_ATTR_RES_USECNT, /* u64 */
  360. RDMA_NLDEV_ATTR_RES_POLL_CTX, /* u8 */
  361. RDMA_NLDEV_ATTR_RES_MR, /* nested table */
  362. RDMA_NLDEV_ATTR_RES_MR_ENTRY, /* nested table */
  363. RDMA_NLDEV_ATTR_RES_RKEY, /* u32 */
  364. RDMA_NLDEV_ATTR_RES_LKEY, /* u32 */
  365. RDMA_NLDEV_ATTR_RES_IOVA, /* u64 */
  366. RDMA_NLDEV_ATTR_RES_MRLEN, /* u64 */
  367. RDMA_NLDEV_ATTR_RES_PD, /* nested table */
  368. RDMA_NLDEV_ATTR_RES_PD_ENTRY, /* nested table */
  369. RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
  370. RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
  371. /*
  372. * Provides logical name and index of netdevice which is
  373. * connected to physical port. This information is relevant
  374. * for RoCE and iWARP.
  375. *
  376. * The netdevices which are associated with containers are
  377. * supposed to be exported together with GID table once it
  378. * will be exposed through the netlink. Because the
  379. * associated netdevices are properties of GIDs.
  380. */
  381. RDMA_NLDEV_ATTR_NDEV_INDEX, /* u32 */
  382. RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
  383. /*
  384. * driver-specific attributes.
  385. */
  386. RDMA_NLDEV_ATTR_DRIVER, /* nested table */
  387. RDMA_NLDEV_ATTR_DRIVER_ENTRY, /* nested table */
  388. RDMA_NLDEV_ATTR_DRIVER_STRING, /* string */
  389. /*
  390. * u8 values from enum rdma_nldev_print_type
  391. */
  392. RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE, /* u8 */
  393. RDMA_NLDEV_ATTR_DRIVER_S32, /* s32 */
  394. RDMA_NLDEV_ATTR_DRIVER_U32, /* u32 */
  395. RDMA_NLDEV_ATTR_DRIVER_S64, /* s64 */
  396. RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */
  397. /*
  398. * Indexes to get/set secific entry,
  399. * for QP use RDMA_NLDEV_ATTR_RES_LQPN
  400. */
  401. RDMA_NLDEV_ATTR_RES_PDN, /* u32 */
  402. RDMA_NLDEV_ATTR_RES_CQN, /* u32 */
  403. RDMA_NLDEV_ATTR_RES_MRN, /* u32 */
  404. RDMA_NLDEV_ATTR_RES_CM_IDN, /* u32 */
  405. RDMA_NLDEV_ATTR_RES_CTXN, /* u32 */
  406. /*
  407. * Identifies the rdma driver. eg: "rxe" or "siw"
  408. */
  409. RDMA_NLDEV_ATTR_LINK_TYPE, /* string */
  410. /*
  411. * net namespace mode for rdma subsystem:
  412. * either shared or exclusive among multiple net namespaces.
  413. */
  414. RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */
  415. /*
  416. * Device protocol, e.g. ib, iw, usnic, roce and opa
  417. */
  418. RDMA_NLDEV_ATTR_DEV_PROTOCOL, /* string */
  419. /*
  420. * File descriptor handle of the net namespace object
  421. */
  422. RDMA_NLDEV_NET_NS_FD, /* u32 */
  423. /*
  424. * Information about a chardev.
  425. * CHARDEV_TYPE is the name of the chardev ABI (ie uverbs, umad, etc)
  426. * CHARDEV_ABI signals the ABI revision (historical)
  427. * CHARDEV_NAME is the kernel name for the /dev/ file (no directory)
  428. * CHARDEV is the 64 bit dev_t for the inode
  429. */
  430. RDMA_NLDEV_ATTR_CHARDEV_TYPE, /* string */
  431. RDMA_NLDEV_ATTR_CHARDEV_NAME, /* string */
  432. RDMA_NLDEV_ATTR_CHARDEV_ABI, /* u64 */
  433. RDMA_NLDEV_ATTR_CHARDEV, /* u64 */
  434. RDMA_NLDEV_ATTR_UVERBS_DRIVER_ID, /* u64 */
  435. /*
  436. * Counter-specific attributes.
  437. */
  438. RDMA_NLDEV_ATTR_STAT_MODE, /* u32 */
  439. RDMA_NLDEV_ATTR_STAT_RES, /* u32 */
  440. RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK, /* u32 */
  441. RDMA_NLDEV_ATTR_STAT_COUNTER, /* nested table */
  442. RDMA_NLDEV_ATTR_STAT_COUNTER_ENTRY, /* nested table */
  443. RDMA_NLDEV_ATTR_STAT_COUNTER_ID, /* u32 */
  444. RDMA_NLDEV_ATTR_STAT_HWCOUNTERS, /* nested table */
  445. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY, /* nested table */
  446. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_NAME, /* string */
  447. RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_VALUE, /* u64 */
  448. /*
  449. * CQ adaptive moderatio (DIM)
  450. */
  451. RDMA_NLDEV_ATTR_DEV_DIM, /* u8 */
  452. /*
  453. * Always the end
  454. */
  455. RDMA_NLDEV_ATTR_MAX
  456. };
  457. /*
  458. * Supported counter bind modes. All modes are mutual-exclusive.
  459. */
  460. enum rdma_nl_counter_mode {
  461. RDMA_COUNTER_MODE_NONE,
  462. /*
  463. * A qp is bound with a counter automatically during initialization
  464. * based on the auto mode (e.g., qp type, ...)
  465. */
  466. RDMA_COUNTER_MODE_AUTO,
  467. /*
  468. * Which qp are bound with which counter is explicitly specified
  469. * by the user
  470. */
  471. RDMA_COUNTER_MODE_MANUAL,
  472. /*
  473. * Always the end
  474. */
  475. RDMA_COUNTER_MODE_MAX,
  476. };
  477. /*
  478. * Supported criteria in counter auto mode.
  479. * Currently only "qp type" is supported
  480. */
  481. enum rdma_nl_counter_mask {
  482. RDMA_COUNTER_MASK_QP_TYPE = 1,
  483. };
  484. #endif /* _RDMA_NETLINK_H */