1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI_LINUX_DEVLINK_H_ 20 #define _UAPI_LINUX_DEVLINK_H_ 21 #define DEVLINK_GENL_NAME "devlink" 22 #define DEVLINK_GENL_VERSION 0x1 23 #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config" 24 enum devlink_command { 25 DEVLINK_CMD_UNSPEC, 26 DEVLINK_CMD_GET, 27 DEVLINK_CMD_SET, 28 DEVLINK_CMD_NEW, 29 DEVLINK_CMD_DEL, 30 DEVLINK_CMD_PORT_GET, 31 DEVLINK_CMD_PORT_SET, 32 DEVLINK_CMD_PORT_NEW, 33 DEVLINK_CMD_PORT_DEL, 34 DEVLINK_CMD_PORT_SPLIT, 35 DEVLINK_CMD_PORT_UNSPLIT, 36 DEVLINK_CMD_SB_GET, 37 DEVLINK_CMD_SB_SET, 38 DEVLINK_CMD_SB_NEW, 39 DEVLINK_CMD_SB_DEL, 40 DEVLINK_CMD_SB_POOL_GET, 41 DEVLINK_CMD_SB_POOL_SET, 42 DEVLINK_CMD_SB_POOL_NEW, 43 DEVLINK_CMD_SB_POOL_DEL, 44 DEVLINK_CMD_SB_PORT_POOL_GET, 45 DEVLINK_CMD_SB_PORT_POOL_SET, 46 DEVLINK_CMD_SB_PORT_POOL_NEW, 47 DEVLINK_CMD_SB_PORT_POOL_DEL, 48 DEVLINK_CMD_SB_TC_POOL_BIND_GET, 49 DEVLINK_CMD_SB_TC_POOL_BIND_SET, 50 DEVLINK_CMD_SB_TC_POOL_BIND_NEW, 51 DEVLINK_CMD_SB_TC_POOL_BIND_DEL, 52 DEVLINK_CMD_SB_OCC_SNAPSHOT, 53 DEVLINK_CMD_SB_OCC_MAX_CLEAR, 54 DEVLINK_CMD_ESWITCH_GET, 55 #define DEVLINK_CMD_ESWITCH_MODE_GET DEVLINK_CMD_ESWITCH_GET 56 DEVLINK_CMD_ESWITCH_SET, 57 #define DEVLINK_CMD_ESWITCH_MODE_SET DEVLINK_CMD_ESWITCH_SET 58 DEVLINK_CMD_DPIPE_TABLE_GET, 59 DEVLINK_CMD_DPIPE_ENTRIES_GET, 60 DEVLINK_CMD_DPIPE_HEADERS_GET, 61 DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, 62 DEVLINK_CMD_RESOURCE_SET, 63 DEVLINK_CMD_RESOURCE_DUMP, 64 DEVLINK_CMD_RELOAD, 65 DEVLINK_CMD_PARAM_GET, 66 DEVLINK_CMD_PARAM_SET, 67 DEVLINK_CMD_PARAM_NEW, 68 DEVLINK_CMD_PARAM_DEL, 69 DEVLINK_CMD_REGION_GET, 70 DEVLINK_CMD_REGION_SET, 71 DEVLINK_CMD_REGION_NEW, 72 DEVLINK_CMD_REGION_DEL, 73 DEVLINK_CMD_REGION_READ, 74 DEVLINK_CMD_PORT_PARAM_GET, 75 DEVLINK_CMD_PORT_PARAM_SET, 76 DEVLINK_CMD_PORT_PARAM_NEW, 77 DEVLINK_CMD_PORT_PARAM_DEL, 78 DEVLINK_CMD_INFO_GET, 79 DEVLINK_CMD_HEALTH_REPORTER_GET, 80 DEVLINK_CMD_HEALTH_REPORTER_SET, 81 DEVLINK_CMD_HEALTH_REPORTER_RECOVER, 82 DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE, 83 DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, 84 DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR, 85 DEVLINK_CMD_FLASH_UPDATE, 86 DEVLINK_CMD_FLASH_UPDATE_END, 87 DEVLINK_CMD_FLASH_UPDATE_STATUS, 88 DEVLINK_CMD_TRAP_GET, 89 DEVLINK_CMD_TRAP_SET, 90 DEVLINK_CMD_TRAP_NEW, 91 DEVLINK_CMD_TRAP_DEL, 92 DEVLINK_CMD_TRAP_GROUP_GET, 93 DEVLINK_CMD_TRAP_GROUP_SET, 94 DEVLINK_CMD_TRAP_GROUP_NEW, 95 DEVLINK_CMD_TRAP_GROUP_DEL, 96 DEVLINK_CMD_TRAP_POLICER_GET, 97 DEVLINK_CMD_TRAP_POLICER_SET, 98 DEVLINK_CMD_TRAP_POLICER_NEW, 99 DEVLINK_CMD_TRAP_POLICER_DEL, 100 __DEVLINK_CMD_MAX, 101 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 102 }; 103 enum devlink_port_type { 104 DEVLINK_PORT_TYPE_NOTSET, 105 DEVLINK_PORT_TYPE_AUTO, 106 DEVLINK_PORT_TYPE_ETH, 107 DEVLINK_PORT_TYPE_IB, 108 }; 109 enum devlink_sb_pool_type { 110 DEVLINK_SB_POOL_TYPE_INGRESS, 111 DEVLINK_SB_POOL_TYPE_EGRESS, 112 }; 113 enum devlink_sb_threshold_type { 114 DEVLINK_SB_THRESHOLD_TYPE_STATIC, 115 DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC, 116 }; 117 #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20 118 enum devlink_eswitch_mode { 119 DEVLINK_ESWITCH_MODE_LEGACY, 120 DEVLINK_ESWITCH_MODE_SWITCHDEV, 121 }; 122 enum devlink_eswitch_inline_mode { 123 DEVLINK_ESWITCH_INLINE_MODE_NONE, 124 DEVLINK_ESWITCH_INLINE_MODE_LINK, 125 DEVLINK_ESWITCH_INLINE_MODE_NETWORK, 126 DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT, 127 }; 128 enum devlink_eswitch_encap_mode { 129 DEVLINK_ESWITCH_ENCAP_MODE_NONE, 130 DEVLINK_ESWITCH_ENCAP_MODE_BASIC, 131 }; 132 enum devlink_port_flavour { 133 DEVLINK_PORT_FLAVOUR_PHYSICAL, 134 DEVLINK_PORT_FLAVOUR_CPU, 135 DEVLINK_PORT_FLAVOUR_DSA, 136 DEVLINK_PORT_FLAVOUR_PCI_PF, 137 DEVLINK_PORT_FLAVOUR_PCI_VF, 138 DEVLINK_PORT_FLAVOUR_VIRTUAL, 139 }; 140 enum devlink_param_cmode { 141 DEVLINK_PARAM_CMODE_RUNTIME, 142 DEVLINK_PARAM_CMODE_DRIVERINIT, 143 DEVLINK_PARAM_CMODE_PERMANENT, 144 __DEVLINK_PARAM_CMODE_MAX, 145 DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1 146 }; 147 enum devlink_param_fw_load_policy_value { 148 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER, 149 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH, 150 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK, 151 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNKNOWN, 152 }; 153 enum devlink_param_reset_dev_on_drv_probe_value { 154 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN, 155 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS, 156 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER, 157 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK, 158 }; 159 enum { 160 DEVLINK_ATTR_STATS_RX_PACKETS, 161 DEVLINK_ATTR_STATS_RX_BYTES, 162 DEVLINK_ATTR_STATS_RX_DROPPED, 163 __DEVLINK_ATTR_STATS_MAX, 164 DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1 165 }; 166 enum devlink_trap_action { 167 DEVLINK_TRAP_ACTION_DROP, 168 DEVLINK_TRAP_ACTION_TRAP, 169 }; 170 enum devlink_trap_type { 171 DEVLINK_TRAP_TYPE_DROP, 172 DEVLINK_TRAP_TYPE_EXCEPTION, 173 }; 174 enum { 175 DEVLINK_ATTR_TRAP_METADATA_TYPE_IN_PORT, 176 DEVLINK_ATTR_TRAP_METADATA_TYPE_FA_COOKIE, 177 }; 178 enum devlink_attr { 179 DEVLINK_ATTR_UNSPEC, 180 DEVLINK_ATTR_BUS_NAME, 181 DEVLINK_ATTR_DEV_NAME, 182 DEVLINK_ATTR_PORT_INDEX, 183 DEVLINK_ATTR_PORT_TYPE, 184 DEVLINK_ATTR_PORT_DESIRED_TYPE, 185 DEVLINK_ATTR_PORT_NETDEV_IFINDEX, 186 DEVLINK_ATTR_PORT_NETDEV_NAME, 187 DEVLINK_ATTR_PORT_IBDEV_NAME, 188 DEVLINK_ATTR_PORT_SPLIT_COUNT, 189 DEVLINK_ATTR_PORT_SPLIT_GROUP, 190 DEVLINK_ATTR_SB_INDEX, 191 DEVLINK_ATTR_SB_SIZE, 192 DEVLINK_ATTR_SB_INGRESS_POOL_COUNT, 193 DEVLINK_ATTR_SB_EGRESS_POOL_COUNT, 194 DEVLINK_ATTR_SB_INGRESS_TC_COUNT, 195 DEVLINK_ATTR_SB_EGRESS_TC_COUNT, 196 DEVLINK_ATTR_SB_POOL_INDEX, 197 DEVLINK_ATTR_SB_POOL_TYPE, 198 DEVLINK_ATTR_SB_POOL_SIZE, 199 DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE, 200 DEVLINK_ATTR_SB_THRESHOLD, 201 DEVLINK_ATTR_SB_TC_INDEX, 202 DEVLINK_ATTR_SB_OCC_CUR, 203 DEVLINK_ATTR_SB_OCC_MAX, 204 DEVLINK_ATTR_ESWITCH_MODE, 205 DEVLINK_ATTR_ESWITCH_INLINE_MODE, 206 DEVLINK_ATTR_DPIPE_TABLES, 207 DEVLINK_ATTR_DPIPE_TABLE, 208 DEVLINK_ATTR_DPIPE_TABLE_NAME, 209 DEVLINK_ATTR_DPIPE_TABLE_SIZE, 210 DEVLINK_ATTR_DPIPE_TABLE_MATCHES, 211 DEVLINK_ATTR_DPIPE_TABLE_ACTIONS, 212 DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED, 213 DEVLINK_ATTR_DPIPE_ENTRIES, 214 DEVLINK_ATTR_DPIPE_ENTRY, 215 DEVLINK_ATTR_DPIPE_ENTRY_INDEX, 216 DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES, 217 DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES, 218 DEVLINK_ATTR_DPIPE_ENTRY_COUNTER, 219 DEVLINK_ATTR_DPIPE_MATCH, 220 DEVLINK_ATTR_DPIPE_MATCH_VALUE, 221 DEVLINK_ATTR_DPIPE_MATCH_TYPE, 222 DEVLINK_ATTR_DPIPE_ACTION, 223 DEVLINK_ATTR_DPIPE_ACTION_VALUE, 224 DEVLINK_ATTR_DPIPE_ACTION_TYPE, 225 DEVLINK_ATTR_DPIPE_VALUE, 226 DEVLINK_ATTR_DPIPE_VALUE_MASK, 227 DEVLINK_ATTR_DPIPE_VALUE_MAPPING, 228 DEVLINK_ATTR_DPIPE_HEADERS, 229 DEVLINK_ATTR_DPIPE_HEADER, 230 DEVLINK_ATTR_DPIPE_HEADER_NAME, 231 DEVLINK_ATTR_DPIPE_HEADER_ID, 232 DEVLINK_ATTR_DPIPE_HEADER_FIELDS, 233 DEVLINK_ATTR_DPIPE_HEADER_GLOBAL, 234 DEVLINK_ATTR_DPIPE_HEADER_INDEX, 235 DEVLINK_ATTR_DPIPE_FIELD, 236 DEVLINK_ATTR_DPIPE_FIELD_NAME, 237 DEVLINK_ATTR_DPIPE_FIELD_ID, 238 DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH, 239 DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE, 240 DEVLINK_ATTR_PAD, 241 DEVLINK_ATTR_ESWITCH_ENCAP_MODE, 242 DEVLINK_ATTR_RESOURCE_LIST, 243 DEVLINK_ATTR_RESOURCE, 244 DEVLINK_ATTR_RESOURCE_NAME, 245 DEVLINK_ATTR_RESOURCE_ID, 246 DEVLINK_ATTR_RESOURCE_SIZE, 247 DEVLINK_ATTR_RESOURCE_SIZE_NEW, 248 DEVLINK_ATTR_RESOURCE_SIZE_VALID, 249 DEVLINK_ATTR_RESOURCE_SIZE_MIN, 250 DEVLINK_ATTR_RESOURCE_SIZE_MAX, 251 DEVLINK_ATTR_RESOURCE_SIZE_GRAN, 252 DEVLINK_ATTR_RESOURCE_UNIT, 253 DEVLINK_ATTR_RESOURCE_OCC, 254 DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID, 255 DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS, 256 DEVLINK_ATTR_PORT_FLAVOUR, 257 DEVLINK_ATTR_PORT_NUMBER, 258 DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER, 259 DEVLINK_ATTR_PARAM, 260 DEVLINK_ATTR_PARAM_NAME, 261 DEVLINK_ATTR_PARAM_GENERIC, 262 DEVLINK_ATTR_PARAM_TYPE, 263 DEVLINK_ATTR_PARAM_VALUES_LIST, 264 DEVLINK_ATTR_PARAM_VALUE, 265 DEVLINK_ATTR_PARAM_VALUE_DATA, 266 DEVLINK_ATTR_PARAM_VALUE_CMODE, 267 DEVLINK_ATTR_REGION_NAME, 268 DEVLINK_ATTR_REGION_SIZE, 269 DEVLINK_ATTR_REGION_SNAPSHOTS, 270 DEVLINK_ATTR_REGION_SNAPSHOT, 271 DEVLINK_ATTR_REGION_SNAPSHOT_ID, 272 DEVLINK_ATTR_REGION_CHUNKS, 273 DEVLINK_ATTR_REGION_CHUNK, 274 DEVLINK_ATTR_REGION_CHUNK_DATA, 275 DEVLINK_ATTR_REGION_CHUNK_ADDR, 276 DEVLINK_ATTR_REGION_CHUNK_LEN, 277 DEVLINK_ATTR_INFO_DRIVER_NAME, 278 DEVLINK_ATTR_INFO_SERIAL_NUMBER, 279 DEVLINK_ATTR_INFO_VERSION_FIXED, 280 DEVLINK_ATTR_INFO_VERSION_RUNNING, 281 DEVLINK_ATTR_INFO_VERSION_STORED, 282 DEVLINK_ATTR_INFO_VERSION_NAME, 283 DEVLINK_ATTR_INFO_VERSION_VALUE, 284 DEVLINK_ATTR_SB_POOL_CELL_SIZE, 285 DEVLINK_ATTR_FMSG, 286 DEVLINK_ATTR_FMSG_OBJ_NEST_START, 287 DEVLINK_ATTR_FMSG_PAIR_NEST_START, 288 DEVLINK_ATTR_FMSG_ARR_NEST_START, 289 DEVLINK_ATTR_FMSG_NEST_END, 290 DEVLINK_ATTR_FMSG_OBJ_NAME, 291 DEVLINK_ATTR_FMSG_OBJ_VALUE_TYPE, 292 DEVLINK_ATTR_FMSG_OBJ_VALUE_DATA, 293 DEVLINK_ATTR_HEALTH_REPORTER, 294 DEVLINK_ATTR_HEALTH_REPORTER_NAME, 295 DEVLINK_ATTR_HEALTH_REPORTER_STATE, 296 DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT, 297 DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT, 298 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS, 299 DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD, 300 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER, 301 DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME, 302 DEVLINK_ATTR_FLASH_UPDATE_COMPONENT, 303 DEVLINK_ATTR_FLASH_UPDATE_STATUS_MSG, 304 DEVLINK_ATTR_FLASH_UPDATE_STATUS_DONE, 305 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TOTAL, 306 DEVLINK_ATTR_PORT_PCI_PF_NUMBER, 307 DEVLINK_ATTR_PORT_PCI_VF_NUMBER, 308 DEVLINK_ATTR_STATS, 309 DEVLINK_ATTR_TRAP_NAME, 310 DEVLINK_ATTR_TRAP_ACTION, 311 DEVLINK_ATTR_TRAP_TYPE, 312 DEVLINK_ATTR_TRAP_GENERIC, 313 DEVLINK_ATTR_TRAP_METADATA, 314 DEVLINK_ATTR_TRAP_GROUP_NAME, 315 DEVLINK_ATTR_RELOAD_FAILED, 316 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS, 317 DEVLINK_ATTR_NETNS_FD, 318 DEVLINK_ATTR_NETNS_PID, 319 DEVLINK_ATTR_NETNS_ID, 320 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP, 321 DEVLINK_ATTR_TRAP_POLICER_ID, 322 DEVLINK_ATTR_TRAP_POLICER_RATE, 323 DEVLINK_ATTR_TRAP_POLICER_BURST, 324 __DEVLINK_ATTR_MAX, 325 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1 326 }; 327 enum devlink_dpipe_field_mapping_type { 328 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE, 329 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX, 330 }; 331 enum devlink_dpipe_match_type { 332 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT, 333 }; 334 enum devlink_dpipe_action_type { 335 DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY, 336 }; 337 enum devlink_dpipe_field_ethernet_id { 338 DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC, 339 }; 340 enum devlink_dpipe_field_ipv4_id { 341 DEVLINK_DPIPE_FIELD_IPV4_DST_IP, 342 }; 343 enum devlink_dpipe_field_ipv6_id { 344 DEVLINK_DPIPE_FIELD_IPV6_DST_IP, 345 }; 346 enum devlink_dpipe_header_id { 347 DEVLINK_DPIPE_HEADER_ETHERNET, 348 DEVLINK_DPIPE_HEADER_IPV4, 349 DEVLINK_DPIPE_HEADER_IPV6, 350 }; 351 enum devlink_resource_unit { 352 DEVLINK_RESOURCE_UNIT_ENTRY, 353 }; 354 #endif 355