Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/netlink: Add defines for local service requests through netlink

This patch adds netlink defines for local service client, local service
group, local service operations, and related attributes.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: John Fleck <john.fleck@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Kaike Wan and committed by
Doug Ledford
6431eb87 bc44bd1d

+82
+82
include/uapi/rdma/rdma_netlink.h
··· 7 7 RDMA_NL_RDMA_CM = 1, 8 8 RDMA_NL_NES, 9 9 RDMA_NL_C4IW, 10 + RDMA_NL_LS, /* RDMA Local Services */ 10 11 RDMA_NL_NUM_CLIENTS 11 12 }; 12 13 13 14 enum { 14 15 RDMA_NL_GROUP_CM = 1, 15 16 RDMA_NL_GROUP_IWPM, 17 + RDMA_NL_GROUP_LS, 16 18 RDMA_NL_NUM_GROUPS 17 19 }; 18 20 ··· 130 128 IWPM_NLA_ERR_MAX 131 129 }; 132 130 131 + /* 132 + * Local service operations: 133 + * RESOLVE - The client requests the local service to resolve a path. 134 + * SET_TIMEOUT - The local service requests the client to set the timeout. 135 + */ 136 + enum { 137 + RDMA_NL_LS_OP_RESOLVE = 0, 138 + RDMA_NL_LS_OP_SET_TIMEOUT, 139 + RDMA_NL_LS_NUM_OPS 140 + }; 141 + 142 + /* Local service netlink message flags */ 143 + #define RDMA_NL_LS_F_ERR 0x0100 /* Failed response */ 144 + 145 + /* 146 + * Local service resolve operation family header. 147 + * The layout for the resolve operation: 148 + * nlmsg header 149 + * family header 150 + * attributes 151 + */ 152 + 153 + /* 154 + * Local service path use: 155 + * Specify how the path(s) will be used. 156 + * ALL - For connected CM operation (6 pathrecords) 157 + * UNIDIRECTIONAL - For unidirectional UD (1 pathrecord) 158 + * GMP - For miscellaneous GMP like operation (at least 1 reversible 159 + * pathrecord) 160 + */ 161 + enum { 162 + LS_RESOLVE_PATH_USE_ALL = 0, 163 + LS_RESOLVE_PATH_USE_UNIDIRECTIONAL, 164 + LS_RESOLVE_PATH_USE_GMP, 165 + LS_RESOLVE_PATH_USE_MAX 166 + }; 167 + 168 + #define LS_DEVICE_NAME_MAX 64 169 + 170 + struct rdma_ls_resolve_header { 171 + __u8 device_name[LS_DEVICE_NAME_MAX]; 172 + __u8 port_num; 173 + __u8 path_use; 174 + }; 175 + 176 + /* Local service attribute type */ 177 + #define RDMA_NLA_F_MANDATORY (1 << 13) 178 + #define RDMA_NLA_TYPE_MASK (~(NLA_F_NESTED | NLA_F_NET_BYTEORDER | \ 179 + RDMA_NLA_F_MANDATORY)) 180 + 181 + /* 182 + * Local service attributes: 183 + * Attr Name Size Byte order 184 + * ----------------------------------------------------- 185 + * PATH_RECORD struct ib_path_rec_data 186 + * TIMEOUT u32 cpu 187 + * SERVICE_ID u64 cpu 188 + * DGID u8[16] BE 189 + * SGID u8[16] BE 190 + * TCLASS u8 191 + * PKEY u16 cpu 192 + * QOS_CLASS u16 cpu 193 + */ 194 + enum { 195 + LS_NLA_TYPE_UNSPEC = 0, 196 + LS_NLA_TYPE_PATH_RECORD, 197 + LS_NLA_TYPE_TIMEOUT, 198 + LS_NLA_TYPE_SERVICE_ID, 199 + LS_NLA_TYPE_DGID, 200 + LS_NLA_TYPE_SGID, 201 + LS_NLA_TYPE_TCLASS, 202 + LS_NLA_TYPE_PKEY, 203 + LS_NLA_TYPE_QOS_CLASS, 204 + LS_NLA_TYPE_MAX 205 + }; 206 + 207 + /* Local service DGID/SGID attribute: big endian */ 208 + struct rdma_nla_ls_gid { 209 + __u8 gid[16]; 210 + }; 133 211 134 212 #endif /* _UAPI_RDMA_NETLINK_H */