1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_RDMA_NETLINK_H
3 #define _UAPI_RDMA_NETLINK_H
5 #include <linux/types.h>
11 RDMA_NL_LS
, /* RDMA Local Services */
12 RDMA_NL_NLDEV
, /* RDMA device interface */
23 #define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
24 #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
25 #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
28 RDMA_NL_RDMA_CM_ID_STATS
= 0,
29 RDMA_NL_RDMA_CM_NUM_OPS
33 RDMA_NL_RDMA_CM_ATTR_SRC_ADDR
= 1,
34 RDMA_NL_RDMA_CM_ATTR_DST_ADDR
,
35 RDMA_NL_RDMA_CM_NUM_ATTR
,
38 /* iwarp port mapper op-codes */
40 RDMA_NL_IWPM_REG_PID
= 0,
41 RDMA_NL_IWPM_ADD_MAPPING
,
42 RDMA_NL_IWPM_QUERY_MAPPING
,
43 RDMA_NL_IWPM_REMOVE_MAPPING
,
44 RDMA_NL_IWPM_REMOTE_INFO
,
45 RDMA_NL_IWPM_HANDLE_ERR
,
47 RDMA_NL_IWPM_MAPINFO_NUM
,
51 struct rdma_cm_id_stats
{
63 IWPM_NLA_REG_PID_UNSPEC
= 0,
66 IWPM_NLA_REG_IBDEV_NAME
,
67 IWPM_NLA_REG_ULIB_NAME
,
72 IWPM_NLA_RREG_PID_UNSPEC
= 0,
73 IWPM_NLA_RREG_PID_SEQ
,
74 IWPM_NLA_RREG_IBDEV_NAME
,
75 IWPM_NLA_RREG_ULIB_NAME
,
76 IWPM_NLA_RREG_ULIB_VER
,
77 IWPM_NLA_RREG_PID_ERR
,
83 IWPM_NLA_MANAGE_MAPPING_UNSPEC
= 0,
84 IWPM_NLA_MANAGE_MAPPING_SEQ
,
86 IWPM_NLA_MANAGE_MAPPED_LOC_ADDR
,
87 IWPM_NLA_RMANAGE_MAPPING_ERR
,
88 IWPM_NLA_RMANAGE_MAPPING_MAX
91 #define IWPM_NLA_MANAGE_MAPPING_MAX 3
92 #define IWPM_NLA_QUERY_MAPPING_MAX 4
93 #define IWPM_NLA_MAPINFO_SEND_MAX 3
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_RQUERY_MAPPED_LOC_ADDR
,
101 IWPM_NLA_RQUERY_MAPPED_REM_ADDR
,
102 IWPM_NLA_RQUERY_MAPPING_ERR
,
103 IWPM_NLA_RQUERY_MAPPING_MAX
107 IWPM_NLA_MAPINFO_REQ_UNSPEC
= 0,
108 IWPM_NLA_MAPINFO_ULIB_NAME
,
109 IWPM_NLA_MAPINFO_ULIB_VER
,
110 IWPM_NLA_MAPINFO_REQ_MAX
114 IWPM_NLA_MAPINFO_UNSPEC
= 0,
115 IWPM_NLA_MAPINFO_LOCAL_ADDR
,
116 IWPM_NLA_MAPINFO_MAPPED_ADDR
,
121 IWPM_NLA_MAPINFO_NUM_UNSPEC
= 0,
122 IWPM_NLA_MAPINFO_SEQ
,
123 IWPM_NLA_MAPINFO_SEND_NUM
,
124 IWPM_NLA_MAPINFO_ACK_NUM
,
125 IWPM_NLA_MAPINFO_NUM_MAX
129 IWPM_NLA_ERR_UNSPEC
= 0,
136 * Local service operations:
137 * RESOLVE - The client requests the local service to resolve a path.
138 * SET_TIMEOUT - The local service requests the client to set the timeout.
139 * IP_RESOLVE - The client requests the local service to resolve an IP to GID.
142 RDMA_NL_LS_OP_RESOLVE
= 0,
143 RDMA_NL_LS_OP_SET_TIMEOUT
,
144 RDMA_NL_LS_OP_IP_RESOLVE
,
148 /* Local service netlink message flags */
149 #define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */
152 * Local service resolve operation family header.
153 * The layout for the resolve operation:
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
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
174 #define LS_DEVICE_NAME_MAX 64
176 struct rdma_ls_resolve_header
{
177 __u8 device_name
[LS_DEVICE_NAME_MAX
];
182 struct rdma_ls_ip_resolve_header
{
186 /* Local service attribute type */
187 #define RDMA_NLA_F_MANDATORY (1 << 13)
188 #define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
189 RDMA_NLA_F_MANDATORY))
192 * Local service attributes:
193 * Attr Name Size Byte order
194 * -----------------------------------------------------
195 * PATH_RECORD struct ib_path_rec_data
207 LS_NLA_TYPE_UNSPEC
= 0,
208 LS_NLA_TYPE_PATH_RECORD
,
210 LS_NLA_TYPE_SERVICE_ID
,
215 LS_NLA_TYPE_QOS_CLASS
,
221 /* Local service DGID/SGID attribute: big endian */
222 struct rdma_nla_ls_gid
{
226 enum rdma_nldev_command
{
227 RDMA_NLDEV_CMD_UNSPEC
,
229 RDMA_NLDEV_CMD_GET
, /* can dump */
231 /* 2 - 4 are free to use */
233 RDMA_NLDEV_CMD_PORT_GET
= 5, /* can dump */
235 /* 6 - 8 are free to use */
237 RDMA_NLDEV_CMD_RES_GET
= 9, /* can dump */
239 RDMA_NLDEV_CMD_RES_QP_GET
, /* can dump */
244 enum rdma_nldev_attr
{
245 /* don't change the order or add anything between, this is ABI! */
246 RDMA_NLDEV_ATTR_UNSPEC
,
248 /* Identifier for ib_device */
249 RDMA_NLDEV_ATTR_DEV_INDEX
, /* u32 */
251 RDMA_NLDEV_ATTR_DEV_NAME
, /* string */
253 * Device index together with port index are identifiers
254 * for port/link properties.
256 * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
257 * of available ports in ib_device, while for port specific operations,
258 * it will be real port index as it appears in sysfs. Port index follows
259 * sysfs notation and starts from 1 for the first port.
261 RDMA_NLDEV_ATTR_PORT_INDEX
, /* u32 */
264 * Device and port capabilities
266 RDMA_NLDEV_ATTR_CAP_FLAGS
, /* u64 */
271 RDMA_NLDEV_ATTR_FW_VERSION
, /* string */
274 * Node GUID (in host byte order) associated with the RDMA device.
276 RDMA_NLDEV_ATTR_NODE_GUID
, /* u64 */
279 * System image GUID (in host byte order) associated with
280 * this RDMA device and other devices which are part of a
283 RDMA_NLDEV_ATTR_SYS_IMAGE_GUID
, /* u64 */
286 * Subnet prefix (in host byte order)
288 RDMA_NLDEV_ATTR_SUBNET_PREFIX
, /* u64 */
291 * Local Identifier (LID),
292 * According to IB specification, It is 16-bit address assigned
293 * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
295 RDMA_NLDEV_ATTR_LID
, /* u32 */
296 RDMA_NLDEV_ATTR_SM_LID
, /* u32 */
299 * LID mask control (LMC)
301 RDMA_NLDEV_ATTR_LMC
, /* u8 */
303 RDMA_NLDEV_ATTR_PORT_STATE
, /* u8 */
304 RDMA_NLDEV_ATTR_PORT_PHYS_STATE
, /* u8 */
306 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 */
313 RDMA_NLDEV_ATTR_RES_QP
, /* nested table */
314 RDMA_NLDEV_ATTR_RES_QP_ENTRY
, /* nested table */
318 RDMA_NLDEV_ATTR_RES_LQPN
, /* u32 */
321 * Applicable for RC and UC only IBTA 11.2.5.3 QUERY QUEUE PAIR
323 RDMA_NLDEV_ATTR_RES_RQPN
, /* u32 */
326 * Applicable for RC and UC only 11.2.5.3 QUERY QUEUE PAIR
328 RDMA_NLDEV_ATTR_RES_RQ_PSN
, /* u32 */
332 RDMA_NLDEV_ATTR_RES_SQ_PSN
, /* u32 */
333 RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE
, /* u8 */
335 * QP types as visible to RDMA/core, the reserved QPT
336 * are not exported through this interface.
338 RDMA_NLDEV_ATTR_RES_TYPE
, /* u8 */
339 RDMA_NLDEV_ATTR_RES_STATE
, /* u8 */
341 * Process ID which created object,
342 * in case of kernel origin, PID won't exist.
344 RDMA_NLDEV_ATTR_RES_PID
, /* u32 */
346 * The name of process created following resource.
347 * It will exist only for kernel objects.
348 * For user created objects, the user is supposed
349 * to read /proc/PID/comm file.
351 RDMA_NLDEV_ATTR_RES_KERN_NAME
, /* string */
355 #endif /* _UAPI_RDMA_NETLINK_H */