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