Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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