Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_RDMA_NETLINK_H
0003 #define _UAPI_RDMA_NETLINK_H
0004 
0005 #include <linux/types.h>
0006 
0007 enum {
0008     RDMA_NL_IWCM = 2,
0009     RDMA_NL_RSVD,
0010     RDMA_NL_LS, /* RDMA Local Services */
0011     RDMA_NL_NLDEV,  /* RDMA device interface */
0012     RDMA_NL_NUM_CLIENTS
0013 };
0014 
0015 enum {
0016     RDMA_NL_GROUP_IWPM = 2,
0017     RDMA_NL_GROUP_LS,
0018     RDMA_NL_NUM_GROUPS
0019 };
0020 
0021 #define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
0022 #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
0023 #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
0024 
0025 /* The minimum version that the iwpm kernel supports */
0026 #define IWPM_UABI_VERSION_MIN   3
0027 
0028 /* The latest version that the iwpm kernel supports */
0029 #define IWPM_UABI_VERSION   4
0030 
0031 /* iwarp port mapper message flags */
0032 enum {
0033 
0034     /* Do not map the port for this IWPM request */
0035     IWPM_FLAGS_NO_PORT_MAP = (1 << 0),
0036 };
0037 
0038 /* iwarp port mapper op-codes */
0039 enum {
0040     RDMA_NL_IWPM_REG_PID = 0,
0041     RDMA_NL_IWPM_ADD_MAPPING,
0042     RDMA_NL_IWPM_QUERY_MAPPING,
0043     RDMA_NL_IWPM_REMOVE_MAPPING,
0044     RDMA_NL_IWPM_REMOTE_INFO,
0045     RDMA_NL_IWPM_HANDLE_ERR,
0046     RDMA_NL_IWPM_MAPINFO,
0047     RDMA_NL_IWPM_MAPINFO_NUM,
0048     RDMA_NL_IWPM_HELLO,
0049     RDMA_NL_IWPM_NUM_OPS
0050 };
0051 
0052 enum {
0053     IWPM_NLA_REG_PID_UNSPEC = 0,
0054     IWPM_NLA_REG_PID_SEQ,
0055     IWPM_NLA_REG_IF_NAME,
0056     IWPM_NLA_REG_IBDEV_NAME,
0057     IWPM_NLA_REG_ULIB_NAME,
0058     IWPM_NLA_REG_PID_MAX
0059 };
0060 
0061 enum {
0062     IWPM_NLA_RREG_PID_UNSPEC = 0,
0063     IWPM_NLA_RREG_PID_SEQ,
0064     IWPM_NLA_RREG_IBDEV_NAME,
0065     IWPM_NLA_RREG_ULIB_NAME,
0066     IWPM_NLA_RREG_ULIB_VER,
0067     IWPM_NLA_RREG_PID_ERR,
0068     IWPM_NLA_RREG_PID_MAX
0069 
0070 };
0071 
0072 enum {
0073     IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
0074     IWPM_NLA_MANAGE_MAPPING_SEQ,
0075     IWPM_NLA_MANAGE_ADDR,
0076     IWPM_NLA_MANAGE_FLAGS,
0077     IWPM_NLA_MANAGE_MAPPING_MAX
0078 };
0079 
0080 enum {
0081     IWPM_NLA_RMANAGE_MAPPING_UNSPEC = 0,
0082     IWPM_NLA_RMANAGE_MAPPING_SEQ,
0083     IWPM_NLA_RMANAGE_ADDR,
0084     IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
0085     /* The following maintains bisectability of rdma-core */
0086     IWPM_NLA_MANAGE_MAPPED_LOC_ADDR = IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
0087     IWPM_NLA_RMANAGE_MAPPING_ERR,
0088     IWPM_NLA_RMANAGE_MAPPING_MAX
0089 };
0090 
0091 #define IWPM_NLA_MAPINFO_SEND_MAX   3
0092 #define IWPM_NLA_REMOVE_MAPPING_MAX 3
0093 
0094 enum {
0095     IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
0096     IWPM_NLA_QUERY_MAPPING_SEQ,
0097     IWPM_NLA_QUERY_LOCAL_ADDR,
0098     IWPM_NLA_QUERY_REMOTE_ADDR,
0099     IWPM_NLA_QUERY_FLAGS,
0100     IWPM_NLA_QUERY_MAPPING_MAX,
0101 };
0102 
0103 enum {
0104     IWPM_NLA_RQUERY_MAPPING_UNSPEC = 0,
0105     IWPM_NLA_RQUERY_MAPPING_SEQ,
0106     IWPM_NLA_RQUERY_LOCAL_ADDR,
0107     IWPM_NLA_RQUERY_REMOTE_ADDR,
0108     IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
0109     IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
0110     IWPM_NLA_RQUERY_MAPPING_ERR,
0111     IWPM_NLA_RQUERY_MAPPING_MAX
0112 };
0113 
0114 enum {
0115     IWPM_NLA_MAPINFO_REQ_UNSPEC = 0,
0116     IWPM_NLA_MAPINFO_ULIB_NAME,
0117     IWPM_NLA_MAPINFO_ULIB_VER,
0118     IWPM_NLA_MAPINFO_REQ_MAX
0119 };
0120 
0121 enum {
0122     IWPM_NLA_MAPINFO_UNSPEC = 0,
0123     IWPM_NLA_MAPINFO_LOCAL_ADDR,
0124     IWPM_NLA_MAPINFO_MAPPED_ADDR,
0125     IWPM_NLA_MAPINFO_FLAGS,
0126     IWPM_NLA_MAPINFO_MAX
0127 };
0128 
0129 enum {
0130     IWPM_NLA_MAPINFO_NUM_UNSPEC = 0,
0131     IWPM_NLA_MAPINFO_SEQ,
0132     IWPM_NLA_MAPINFO_SEND_NUM,
0133     IWPM_NLA_MAPINFO_ACK_NUM,
0134     IWPM_NLA_MAPINFO_NUM_MAX
0135 };
0136 
0137 enum {
0138     IWPM_NLA_ERR_UNSPEC = 0,
0139     IWPM_NLA_ERR_SEQ,
0140     IWPM_NLA_ERR_CODE,
0141     IWPM_NLA_ERR_MAX
0142 };
0143 
0144 enum {
0145     IWPM_NLA_HELLO_UNSPEC = 0,
0146     IWPM_NLA_HELLO_ABI_VERSION,
0147     IWPM_NLA_HELLO_MAX
0148 };
0149 
0150 /* For RDMA_NLDEV_ATTR_DEV_NODE_TYPE */
0151 enum {
0152     /* IB values map to NodeInfo:NodeType. */
0153     RDMA_NODE_IB_CA = 1,
0154     RDMA_NODE_IB_SWITCH,
0155     RDMA_NODE_IB_ROUTER,
0156     RDMA_NODE_RNIC,
0157     RDMA_NODE_USNIC,
0158     RDMA_NODE_USNIC_UDP,
0159     RDMA_NODE_UNSPECIFIED,
0160 };
0161 
0162 /*
0163  * Local service operations:
0164  *   RESOLVE - The client requests the local service to resolve a path.
0165  *   SET_TIMEOUT - The local service requests the client to set the timeout.
0166  *   IP_RESOLVE - The client requests the local service to resolve an IP to GID.
0167  */
0168 enum {
0169     RDMA_NL_LS_OP_RESOLVE = 0,
0170     RDMA_NL_LS_OP_SET_TIMEOUT,
0171     RDMA_NL_LS_OP_IP_RESOLVE,
0172     RDMA_NL_LS_NUM_OPS
0173 };
0174 
0175 /* Local service netlink message flags */
0176 #define RDMA_NL_LS_F_ERR    0x0100  /* Failed response */
0177 
0178 /*
0179  * Local service resolve operation family header.
0180  * The layout for the resolve operation:
0181  *    nlmsg header
0182  *    family header
0183  *    attributes
0184  */
0185 
0186 /*
0187  * Local service path use:
0188  * Specify how the path(s) will be used.
0189  *   ALL - For connected CM operation (6 pathrecords)
0190  *   UNIDIRECTIONAL - For unidirectional UD (1 pathrecord)
0191  *   GMP - For miscellaneous GMP like operation (at least 1 reversible
0192  *         pathrecord)
0193  */
0194 enum {
0195     LS_RESOLVE_PATH_USE_ALL = 0,
0196     LS_RESOLVE_PATH_USE_UNIDIRECTIONAL,
0197     LS_RESOLVE_PATH_USE_GMP,
0198     LS_RESOLVE_PATH_USE_MAX
0199 };
0200 
0201 #define LS_DEVICE_NAME_MAX 64
0202 
0203 struct rdma_ls_resolve_header {
0204     __u8 device_name[LS_DEVICE_NAME_MAX];
0205     __u8 port_num;
0206     __u8 path_use;
0207 };
0208 
0209 struct rdma_ls_ip_resolve_header {
0210     __u32 ifindex;
0211 };
0212 
0213 /* Local service attribute type */
0214 #define RDMA_NLA_F_MANDATORY    (1 << 13)
0215 #define RDMA_NLA_TYPE_MASK  (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \
0216                   RDMA_NLA_F_MANDATORY))
0217 
0218 /*
0219  * Local service attributes:
0220  *   Attr Name       Size                       Byte order
0221  *   -----------------------------------------------------
0222  *   PATH_RECORD     struct ib_path_rec_data
0223  *   TIMEOUT         u32                        cpu
0224  *   SERVICE_ID      u64                        cpu
0225  *   DGID            u8[16]                     BE
0226  *   SGID            u8[16]                     BE
0227  *   TCLASS          u8
0228  *   PKEY            u16                        cpu
0229  *   QOS_CLASS       u16                        cpu
0230  *   IPV4            u32                        BE
0231  *   IPV6            u8[16]                     BE
0232  */
0233 enum {
0234     LS_NLA_TYPE_UNSPEC = 0,
0235     LS_NLA_TYPE_PATH_RECORD,
0236     LS_NLA_TYPE_TIMEOUT,
0237     LS_NLA_TYPE_SERVICE_ID,
0238     LS_NLA_TYPE_DGID,
0239     LS_NLA_TYPE_SGID,
0240     LS_NLA_TYPE_TCLASS,
0241     LS_NLA_TYPE_PKEY,
0242     LS_NLA_TYPE_QOS_CLASS,
0243     LS_NLA_TYPE_IPV4,
0244     LS_NLA_TYPE_IPV6,
0245     LS_NLA_TYPE_MAX
0246 };
0247 
0248 /* Local service DGID/SGID attribute: big endian */
0249 struct rdma_nla_ls_gid {
0250     __u8        gid[16];
0251 };
0252 
0253 enum rdma_nldev_command {
0254     RDMA_NLDEV_CMD_UNSPEC,
0255 
0256     RDMA_NLDEV_CMD_GET, /* can dump */
0257     RDMA_NLDEV_CMD_SET,
0258 
0259     RDMA_NLDEV_CMD_NEWLINK,
0260 
0261     RDMA_NLDEV_CMD_DELLINK,
0262 
0263     RDMA_NLDEV_CMD_PORT_GET, /* can dump */
0264 
0265     RDMA_NLDEV_CMD_SYS_GET,
0266     RDMA_NLDEV_CMD_SYS_SET,
0267 
0268     /* 8 is free to use */
0269 
0270     RDMA_NLDEV_CMD_RES_GET = 9, /* can dump */
0271 
0272     RDMA_NLDEV_CMD_RES_QP_GET, /* can dump */
0273 
0274     RDMA_NLDEV_CMD_RES_CM_ID_GET, /* can dump */
0275 
0276     RDMA_NLDEV_CMD_RES_CQ_GET, /* can dump */
0277 
0278     RDMA_NLDEV_CMD_RES_MR_GET, /* can dump */
0279 
0280     RDMA_NLDEV_CMD_RES_PD_GET, /* can dump */
0281 
0282     RDMA_NLDEV_CMD_GET_CHARDEV,
0283 
0284     RDMA_NLDEV_CMD_STAT_SET,
0285 
0286     RDMA_NLDEV_CMD_STAT_GET, /* can dump */
0287 
0288     RDMA_NLDEV_CMD_STAT_DEL,
0289 
0290     RDMA_NLDEV_CMD_RES_QP_GET_RAW,
0291 
0292     RDMA_NLDEV_CMD_RES_CQ_GET_RAW,
0293 
0294     RDMA_NLDEV_CMD_RES_MR_GET_RAW,
0295 
0296     RDMA_NLDEV_CMD_RES_CTX_GET, /* can dump */
0297 
0298     RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */
0299 
0300     RDMA_NLDEV_CMD_STAT_GET_STATUS,
0301 
0302     RDMA_NLDEV_NUM_OPS
0303 };
0304 
0305 enum rdma_nldev_print_type {
0306     RDMA_NLDEV_PRINT_TYPE_UNSPEC,
0307     RDMA_NLDEV_PRINT_TYPE_HEX,
0308 };
0309 
0310 enum rdma_nldev_attr {
0311     /* don't change the order or add anything between, this is ABI! */
0312     RDMA_NLDEV_ATTR_UNSPEC,
0313 
0314     /* Pad attribute for 64b alignment */
0315     RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
0316 
0317     /* Identifier for ib_device */
0318     RDMA_NLDEV_ATTR_DEV_INDEX,      /* u32 */
0319 
0320     RDMA_NLDEV_ATTR_DEV_NAME,       /* string */
0321     /*
0322      * Device index together with port index are identifiers
0323      * for port/link properties.
0324      *
0325      * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
0326      * of available ports in ib_device, while for port specific operations,
0327      * it will be real port index as it appears in sysfs. Port index follows
0328      * sysfs notation and starts from 1 for the first port.
0329      */
0330     RDMA_NLDEV_ATTR_PORT_INDEX,     /* u32 */
0331 
0332     /*
0333      * Device and port capabilities
0334      *
0335      * When used for port info, first 32-bits are CapabilityMask followed by
0336      * 16-bit CapabilityMask2.
0337      */
0338     RDMA_NLDEV_ATTR_CAP_FLAGS,      /* u64 */
0339 
0340     /*
0341      * FW version
0342      */
0343     RDMA_NLDEV_ATTR_FW_VERSION,     /* string */
0344 
0345     /*
0346      * Node GUID (in host byte order) associated with the RDMA device.
0347      */
0348     RDMA_NLDEV_ATTR_NODE_GUID,          /* u64 */
0349 
0350     /*
0351      * System image GUID (in host byte order) associated with
0352      * this RDMA device and other devices which are part of a
0353      * single system.
0354      */
0355     RDMA_NLDEV_ATTR_SYS_IMAGE_GUID,     /* u64 */
0356 
0357     /*
0358      * Subnet prefix (in host byte order)
0359      */
0360     RDMA_NLDEV_ATTR_SUBNET_PREFIX,      /* u64 */
0361 
0362     /*
0363      * Local Identifier (LID),
0364      * According to IB specification, It is 16-bit address assigned
0365      * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
0366      */
0367     RDMA_NLDEV_ATTR_LID,            /* u32 */
0368     RDMA_NLDEV_ATTR_SM_LID,         /* u32 */
0369 
0370     /*
0371      * LID mask control (LMC)
0372      */
0373     RDMA_NLDEV_ATTR_LMC,            /* u8 */
0374 
0375     RDMA_NLDEV_ATTR_PORT_STATE,     /* u8 */
0376     RDMA_NLDEV_ATTR_PORT_PHYS_STATE,    /* u8 */
0377 
0378     RDMA_NLDEV_ATTR_DEV_NODE_TYPE,      /* u8 */
0379 
0380     RDMA_NLDEV_ATTR_RES_SUMMARY,        /* nested table */
0381     RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY,  /* nested table */
0382     RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME, /* string */
0383     RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR, /* u64 */
0384 
0385     RDMA_NLDEV_ATTR_RES_QP,         /* nested table */
0386     RDMA_NLDEV_ATTR_RES_QP_ENTRY,       /* nested table */
0387     /*
0388      * Local QPN
0389      */
0390     RDMA_NLDEV_ATTR_RES_LQPN,       /* u32 */
0391     /*
0392      * Remote QPN,
0393      * Applicable for RC and UC only IBTA 11.2.5.3 QUERY QUEUE PAIR
0394      */
0395     RDMA_NLDEV_ATTR_RES_RQPN,       /* u32 */
0396     /*
0397      * Receive Queue PSN,
0398      * Applicable for RC and UC only 11.2.5.3 QUERY QUEUE PAIR
0399      */
0400     RDMA_NLDEV_ATTR_RES_RQ_PSN,     /* u32 */
0401     /*
0402      * Send Queue PSN
0403      */
0404     RDMA_NLDEV_ATTR_RES_SQ_PSN,     /* u32 */
0405     RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE, /* u8 */
0406     /*
0407      * QP types as visible to RDMA/core, the reserved QPT
0408      * are not exported through this interface.
0409      */
0410     RDMA_NLDEV_ATTR_RES_TYPE,       /* u8 */
0411     RDMA_NLDEV_ATTR_RES_STATE,      /* u8 */
0412     /*
0413      * Process ID which created object,
0414      * in case of kernel origin, PID won't exist.
0415      */
0416     RDMA_NLDEV_ATTR_RES_PID,        /* u32 */
0417     /*
0418      * The name of process created following resource.
0419      * It will exist only for kernel objects.
0420      * For user created objects, the user is supposed
0421      * to read /proc/PID/comm file.
0422      */
0423     RDMA_NLDEV_ATTR_RES_KERN_NAME,      /* string */
0424 
0425     RDMA_NLDEV_ATTR_RES_CM_ID,      /* nested table */
0426     RDMA_NLDEV_ATTR_RES_CM_ID_ENTRY,    /* nested table */
0427     /*
0428      * rdma_cm_id port space.
0429      */
0430     RDMA_NLDEV_ATTR_RES_PS,         /* u32 */
0431     /*
0432      * Source and destination socket addresses
0433      */
0434     RDMA_NLDEV_ATTR_RES_SRC_ADDR,       /* __kernel_sockaddr_storage */
0435     RDMA_NLDEV_ATTR_RES_DST_ADDR,       /* __kernel_sockaddr_storage */
0436 
0437     RDMA_NLDEV_ATTR_RES_CQ,         /* nested table */
0438     RDMA_NLDEV_ATTR_RES_CQ_ENTRY,       /* nested table */
0439     RDMA_NLDEV_ATTR_RES_CQE,        /* u32 */
0440     RDMA_NLDEV_ATTR_RES_USECNT,     /* u64 */
0441     RDMA_NLDEV_ATTR_RES_POLL_CTX,       /* u8 */
0442 
0443     RDMA_NLDEV_ATTR_RES_MR,         /* nested table */
0444     RDMA_NLDEV_ATTR_RES_MR_ENTRY,       /* nested table */
0445     RDMA_NLDEV_ATTR_RES_RKEY,       /* u32 */
0446     RDMA_NLDEV_ATTR_RES_LKEY,       /* u32 */
0447     RDMA_NLDEV_ATTR_RES_IOVA,       /* u64 */
0448     RDMA_NLDEV_ATTR_RES_MRLEN,      /* u64 */
0449 
0450     RDMA_NLDEV_ATTR_RES_PD,         /* nested table */
0451     RDMA_NLDEV_ATTR_RES_PD_ENTRY,       /* nested table */
0452     RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
0453     RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
0454     /*
0455      * Provides logical name and index of netdevice which is
0456      * connected to physical port. This information is relevant
0457      * for RoCE and iWARP.
0458      *
0459      * The netdevices which are associated with containers are
0460      * supposed to be exported together with GID table once it
0461      * will be exposed through the netlink. Because the
0462      * associated netdevices are properties of GIDs.
0463      */
0464     RDMA_NLDEV_ATTR_NDEV_INDEX,     /* u32 */
0465     RDMA_NLDEV_ATTR_NDEV_NAME,      /* string */
0466     /*
0467      * driver-specific attributes.
0468      */
0469     RDMA_NLDEV_ATTR_DRIVER,         /* nested table */
0470     RDMA_NLDEV_ATTR_DRIVER_ENTRY,       /* nested table */
0471     RDMA_NLDEV_ATTR_DRIVER_STRING,      /* string */
0472     /*
0473      * u8 values from enum rdma_nldev_print_type
0474      */
0475     RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE,  /* u8 */
0476     RDMA_NLDEV_ATTR_DRIVER_S32,     /* s32 */
0477     RDMA_NLDEV_ATTR_DRIVER_U32,     /* u32 */
0478     RDMA_NLDEV_ATTR_DRIVER_S64,     /* s64 */
0479     RDMA_NLDEV_ATTR_DRIVER_U64,     /* u64 */
0480 
0481     /*
0482      * Indexes to get/set secific entry,
0483      * for QP use RDMA_NLDEV_ATTR_RES_LQPN
0484      */
0485     RDMA_NLDEV_ATTR_RES_PDN,               /* u32 */
0486     RDMA_NLDEV_ATTR_RES_CQN,               /* u32 */
0487     RDMA_NLDEV_ATTR_RES_MRN,               /* u32 */
0488     RDMA_NLDEV_ATTR_RES_CM_IDN,            /* u32 */
0489     RDMA_NLDEV_ATTR_RES_CTXN,          /* u32 */
0490     /*
0491      * Identifies the rdma driver. eg: "rxe" or "siw"
0492      */
0493     RDMA_NLDEV_ATTR_LINK_TYPE,      /* string */
0494 
0495     /*
0496      * net namespace mode for rdma subsystem:
0497      * either shared or exclusive among multiple net namespaces.
0498      */
0499     RDMA_NLDEV_SYS_ATTR_NETNS_MODE,     /* u8 */
0500     /*
0501      * Device protocol, e.g. ib, iw, usnic, roce and opa
0502      */
0503     RDMA_NLDEV_ATTR_DEV_PROTOCOL,       /* string */
0504 
0505     /*
0506      * File descriptor handle of the net namespace object
0507      */
0508     RDMA_NLDEV_NET_NS_FD,           /* u32 */
0509     /*
0510      * Information about a chardev.
0511      * CHARDEV_TYPE is the name of the chardev ABI (ie uverbs, umad, etc)
0512      * CHARDEV_ABI signals the ABI revision (historical)
0513      * CHARDEV_NAME is the kernel name for the /dev/ file (no directory)
0514      * CHARDEV is the 64 bit dev_t for the inode
0515      */
0516     RDMA_NLDEV_ATTR_CHARDEV_TYPE,       /* string */
0517     RDMA_NLDEV_ATTR_CHARDEV_NAME,       /* string */
0518     RDMA_NLDEV_ATTR_CHARDEV_ABI,        /* u64 */
0519     RDMA_NLDEV_ATTR_CHARDEV,        /* u64 */
0520     RDMA_NLDEV_ATTR_UVERBS_DRIVER_ID,       /* u64 */
0521     /*
0522      * Counter-specific attributes.
0523      */
0524     RDMA_NLDEV_ATTR_STAT_MODE,      /* u32 */
0525     RDMA_NLDEV_ATTR_STAT_RES,       /* u32 */
0526     RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK,    /* u32 */
0527     RDMA_NLDEV_ATTR_STAT_COUNTER,       /* nested table */
0528     RDMA_NLDEV_ATTR_STAT_COUNTER_ENTRY, /* nested table */
0529     RDMA_NLDEV_ATTR_STAT_COUNTER_ID,    /* u32 */
0530     RDMA_NLDEV_ATTR_STAT_HWCOUNTERS,    /* nested table */
0531     RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY,   /* nested table */
0532     RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_NAME,  /* string */
0533     RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_VALUE, /* u64 */
0534 
0535     /*
0536      * CQ adaptive moderatio (DIM)
0537      */
0538     RDMA_NLDEV_ATTR_DEV_DIM,                /* u8 */
0539 
0540     RDMA_NLDEV_ATTR_RES_RAW,    /* binary */
0541 
0542     RDMA_NLDEV_ATTR_RES_CTX,        /* nested table */
0543     RDMA_NLDEV_ATTR_RES_CTX_ENTRY,      /* nested table */
0544 
0545     RDMA_NLDEV_ATTR_RES_SRQ,        /* nested table */
0546     RDMA_NLDEV_ATTR_RES_SRQ_ENTRY,      /* nested table */
0547     RDMA_NLDEV_ATTR_RES_SRQN,       /* u32 */
0548 
0549     RDMA_NLDEV_ATTR_MIN_RANGE,      /* u32 */
0550     RDMA_NLDEV_ATTR_MAX_RANGE,      /* u32 */
0551 
0552     RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK,   /* u8 */
0553 
0554     RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX,   /* u32 */
0555     RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC, /* u8 */
0556 
0557     /*
0558      * Always the end
0559      */
0560     RDMA_NLDEV_ATTR_MAX
0561 };
0562 
0563 /*
0564  * Supported counter bind modes. All modes are mutual-exclusive.
0565  */
0566 enum rdma_nl_counter_mode {
0567     RDMA_COUNTER_MODE_NONE,
0568 
0569     /*
0570      * A qp is bound with a counter automatically during initialization
0571      * based on the auto mode (e.g., qp type, ...)
0572      */
0573     RDMA_COUNTER_MODE_AUTO,
0574 
0575     /*
0576      * Which qp are bound with which counter is explicitly specified
0577      * by the user
0578      */
0579     RDMA_COUNTER_MODE_MANUAL,
0580 
0581     /*
0582      * Always the end
0583      */
0584     RDMA_COUNTER_MODE_MAX,
0585 };
0586 
0587 /*
0588  * Supported criteria in counter auto mode.
0589  * Currently only "qp type" is supported
0590  */
0591 enum rdma_nl_counter_mask {
0592     RDMA_COUNTER_MASK_QP_TYPE = 1,
0593     RDMA_COUNTER_MASK_PID = 1 << 1,
0594 };
0595 #endif /* _UAPI_RDMA_NETLINK_H */