1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 /* 2 /* 3 * include/uapi/linux/devlink.h - Network phys 3 * include/uapi/linux/devlink.h - Network physical device Netlink interface 4 * Copyright (c) 2016 Mellanox Technologies. A 4 * Copyright (c) 2016 Mellanox Technologies. All rights reserved. 5 * Copyright (c) 2016 Jiri Pirko <jiri@mellano 5 * Copyright (c) 2016 Jiri Pirko <jiri@mellanox.com> 6 * 6 * 7 * This program is free software; you can redi 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Publi 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either versio 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 10 * (at your option) any later version. 11 */ 11 */ 12 12 13 #ifndef _UAPI_LINUX_DEVLINK_H_ 13 #ifndef _UAPI_LINUX_DEVLINK_H_ 14 #define _UAPI_LINUX_DEVLINK_H_ 14 #define _UAPI_LINUX_DEVLINK_H_ 15 15 16 #include <linux/const.h> 16 #include <linux/const.h> 17 17 18 #define DEVLINK_GENL_NAME "devlink" 18 #define DEVLINK_GENL_NAME "devlink" 19 #define DEVLINK_GENL_VERSION 0x1 19 #define DEVLINK_GENL_VERSION 0x1 20 #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config 20 #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config" 21 21 22 enum devlink_command { 22 enum devlink_command { 23 /* don't change the order or add anyth 23 /* don't change the order or add anything between, this is ABI! */ 24 DEVLINK_CMD_UNSPEC, 24 DEVLINK_CMD_UNSPEC, 25 25 26 DEVLINK_CMD_GET, /* can 26 DEVLINK_CMD_GET, /* can dump */ 27 DEVLINK_CMD_SET, 27 DEVLINK_CMD_SET, 28 DEVLINK_CMD_NEW, 28 DEVLINK_CMD_NEW, 29 DEVLINK_CMD_DEL, 29 DEVLINK_CMD_DEL, 30 30 31 DEVLINK_CMD_PORT_GET, /* can 31 DEVLINK_CMD_PORT_GET, /* can dump */ 32 DEVLINK_CMD_PORT_SET, 32 DEVLINK_CMD_PORT_SET, 33 DEVLINK_CMD_PORT_NEW, 33 DEVLINK_CMD_PORT_NEW, 34 DEVLINK_CMD_PORT_DEL, 34 DEVLINK_CMD_PORT_DEL, 35 35 36 DEVLINK_CMD_PORT_SPLIT, 36 DEVLINK_CMD_PORT_SPLIT, 37 DEVLINK_CMD_PORT_UNSPLIT, 37 DEVLINK_CMD_PORT_UNSPLIT, 38 38 39 DEVLINK_CMD_SB_GET, /* can 39 DEVLINK_CMD_SB_GET, /* can dump */ 40 DEVLINK_CMD_SB_SET, 40 DEVLINK_CMD_SB_SET, 41 DEVLINK_CMD_SB_NEW, 41 DEVLINK_CMD_SB_NEW, 42 DEVLINK_CMD_SB_DEL, 42 DEVLINK_CMD_SB_DEL, 43 43 44 DEVLINK_CMD_SB_POOL_GET, /* can 44 DEVLINK_CMD_SB_POOL_GET, /* can dump */ 45 DEVLINK_CMD_SB_POOL_SET, 45 DEVLINK_CMD_SB_POOL_SET, 46 DEVLINK_CMD_SB_POOL_NEW, 46 DEVLINK_CMD_SB_POOL_NEW, 47 DEVLINK_CMD_SB_POOL_DEL, 47 DEVLINK_CMD_SB_POOL_DEL, 48 48 49 DEVLINK_CMD_SB_PORT_POOL_GET, /* can 49 DEVLINK_CMD_SB_PORT_POOL_GET, /* can dump */ 50 DEVLINK_CMD_SB_PORT_POOL_SET, 50 DEVLINK_CMD_SB_PORT_POOL_SET, 51 DEVLINK_CMD_SB_PORT_POOL_NEW, 51 DEVLINK_CMD_SB_PORT_POOL_NEW, 52 DEVLINK_CMD_SB_PORT_POOL_DEL, 52 DEVLINK_CMD_SB_PORT_POOL_DEL, 53 53 54 DEVLINK_CMD_SB_TC_POOL_BIND_GET, 54 DEVLINK_CMD_SB_TC_POOL_BIND_GET, /* can dump */ 55 DEVLINK_CMD_SB_TC_POOL_BIND_SET, 55 DEVLINK_CMD_SB_TC_POOL_BIND_SET, 56 DEVLINK_CMD_SB_TC_POOL_BIND_NEW, 56 DEVLINK_CMD_SB_TC_POOL_BIND_NEW, 57 DEVLINK_CMD_SB_TC_POOL_BIND_DEL, 57 DEVLINK_CMD_SB_TC_POOL_BIND_DEL, 58 58 59 /* Shared buffer occupancy monitoring 59 /* Shared buffer occupancy monitoring commands */ 60 DEVLINK_CMD_SB_OCC_SNAPSHOT, 60 DEVLINK_CMD_SB_OCC_SNAPSHOT, 61 DEVLINK_CMD_SB_OCC_MAX_CLEAR, 61 DEVLINK_CMD_SB_OCC_MAX_CLEAR, 62 62 63 DEVLINK_CMD_ESWITCH_GET, 63 DEVLINK_CMD_ESWITCH_GET, 64 #define DEVLINK_CMD_ESWITCH_MODE_GET /* obsole 64 #define DEVLINK_CMD_ESWITCH_MODE_GET /* obsolete, never use this! */ \ 65 DEVLINK_CMD_ESWITCH_GET 65 DEVLINK_CMD_ESWITCH_GET 66 66 67 DEVLINK_CMD_ESWITCH_SET, 67 DEVLINK_CMD_ESWITCH_SET, 68 #define DEVLINK_CMD_ESWITCH_MODE_SET /* obsole 68 #define DEVLINK_CMD_ESWITCH_MODE_SET /* obsolete, never use this! */ \ 69 DEVLINK_CMD_ESWITCH_SET 69 DEVLINK_CMD_ESWITCH_SET 70 70 71 DEVLINK_CMD_DPIPE_TABLE_GET, 71 DEVLINK_CMD_DPIPE_TABLE_GET, 72 DEVLINK_CMD_DPIPE_ENTRIES_GET, 72 DEVLINK_CMD_DPIPE_ENTRIES_GET, 73 DEVLINK_CMD_DPIPE_HEADERS_GET, 73 DEVLINK_CMD_DPIPE_HEADERS_GET, 74 DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, 74 DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, 75 DEVLINK_CMD_RESOURCE_SET, 75 DEVLINK_CMD_RESOURCE_SET, 76 DEVLINK_CMD_RESOURCE_DUMP, 76 DEVLINK_CMD_RESOURCE_DUMP, 77 77 78 /* Hot driver reload, makes configurat 78 /* Hot driver reload, makes configuration changes take place. The 79 * devlink instance is not released du 79 * devlink instance is not released during the process. 80 */ 80 */ 81 DEVLINK_CMD_RELOAD, 81 DEVLINK_CMD_RELOAD, 82 82 83 DEVLINK_CMD_PARAM_GET, /* can 83 DEVLINK_CMD_PARAM_GET, /* can dump */ 84 DEVLINK_CMD_PARAM_SET, 84 DEVLINK_CMD_PARAM_SET, 85 DEVLINK_CMD_PARAM_NEW, 85 DEVLINK_CMD_PARAM_NEW, 86 DEVLINK_CMD_PARAM_DEL, 86 DEVLINK_CMD_PARAM_DEL, 87 87 88 DEVLINK_CMD_REGION_GET, 88 DEVLINK_CMD_REGION_GET, 89 DEVLINK_CMD_REGION_SET, 89 DEVLINK_CMD_REGION_SET, 90 DEVLINK_CMD_REGION_NEW, 90 DEVLINK_CMD_REGION_NEW, 91 DEVLINK_CMD_REGION_DEL, 91 DEVLINK_CMD_REGION_DEL, 92 DEVLINK_CMD_REGION_READ, 92 DEVLINK_CMD_REGION_READ, 93 93 94 DEVLINK_CMD_PORT_PARAM_GET, /* can 94 DEVLINK_CMD_PORT_PARAM_GET, /* can dump */ 95 DEVLINK_CMD_PORT_PARAM_SET, 95 DEVLINK_CMD_PORT_PARAM_SET, 96 DEVLINK_CMD_PORT_PARAM_NEW, 96 DEVLINK_CMD_PORT_PARAM_NEW, 97 DEVLINK_CMD_PORT_PARAM_DEL, 97 DEVLINK_CMD_PORT_PARAM_DEL, 98 98 99 DEVLINK_CMD_INFO_GET, /* can 99 DEVLINK_CMD_INFO_GET, /* can dump */ 100 100 101 DEVLINK_CMD_HEALTH_REPORTER_GET, 101 DEVLINK_CMD_HEALTH_REPORTER_GET, 102 DEVLINK_CMD_HEALTH_REPORTER_SET, 102 DEVLINK_CMD_HEALTH_REPORTER_SET, 103 DEVLINK_CMD_HEALTH_REPORTER_RECOVER, 103 DEVLINK_CMD_HEALTH_REPORTER_RECOVER, 104 DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE, 104 DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE, 105 DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, 105 DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, 106 DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR 106 DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR, 107 107 108 DEVLINK_CMD_FLASH_UPDATE, 108 DEVLINK_CMD_FLASH_UPDATE, 109 DEVLINK_CMD_FLASH_UPDATE_END, 109 DEVLINK_CMD_FLASH_UPDATE_END, /* notification only */ 110 DEVLINK_CMD_FLASH_UPDATE_STATUS, 110 DEVLINK_CMD_FLASH_UPDATE_STATUS, /* notification only */ 111 111 112 DEVLINK_CMD_TRAP_GET, /* can 112 DEVLINK_CMD_TRAP_GET, /* can dump */ 113 DEVLINK_CMD_TRAP_SET, 113 DEVLINK_CMD_TRAP_SET, 114 DEVLINK_CMD_TRAP_NEW, 114 DEVLINK_CMD_TRAP_NEW, 115 DEVLINK_CMD_TRAP_DEL, 115 DEVLINK_CMD_TRAP_DEL, 116 116 117 DEVLINK_CMD_TRAP_GROUP_GET, /* can 117 DEVLINK_CMD_TRAP_GROUP_GET, /* can dump */ 118 DEVLINK_CMD_TRAP_GROUP_SET, 118 DEVLINK_CMD_TRAP_GROUP_SET, 119 DEVLINK_CMD_TRAP_GROUP_NEW, 119 DEVLINK_CMD_TRAP_GROUP_NEW, 120 DEVLINK_CMD_TRAP_GROUP_DEL, 120 DEVLINK_CMD_TRAP_GROUP_DEL, 121 121 122 DEVLINK_CMD_TRAP_POLICER_GET, /* can 122 DEVLINK_CMD_TRAP_POLICER_GET, /* can dump */ 123 DEVLINK_CMD_TRAP_POLICER_SET, 123 DEVLINK_CMD_TRAP_POLICER_SET, 124 DEVLINK_CMD_TRAP_POLICER_NEW, 124 DEVLINK_CMD_TRAP_POLICER_NEW, 125 DEVLINK_CMD_TRAP_POLICER_DEL, 125 DEVLINK_CMD_TRAP_POLICER_DEL, 126 126 127 DEVLINK_CMD_HEALTH_REPORTER_TEST, 127 DEVLINK_CMD_HEALTH_REPORTER_TEST, 128 128 129 DEVLINK_CMD_RATE_GET, /* can 129 DEVLINK_CMD_RATE_GET, /* can dump */ 130 DEVLINK_CMD_RATE_SET, 130 DEVLINK_CMD_RATE_SET, 131 DEVLINK_CMD_RATE_NEW, 131 DEVLINK_CMD_RATE_NEW, 132 DEVLINK_CMD_RATE_DEL, 132 DEVLINK_CMD_RATE_DEL, 133 133 134 DEVLINK_CMD_LINECARD_GET, 134 DEVLINK_CMD_LINECARD_GET, /* can dump */ 135 DEVLINK_CMD_LINECARD_SET, 135 DEVLINK_CMD_LINECARD_SET, 136 DEVLINK_CMD_LINECARD_NEW, 136 DEVLINK_CMD_LINECARD_NEW, 137 DEVLINK_CMD_LINECARD_DEL, 137 DEVLINK_CMD_LINECARD_DEL, 138 138 139 DEVLINK_CMD_SELFTESTS_GET, /* can 139 DEVLINK_CMD_SELFTESTS_GET, /* can dump */ 140 DEVLINK_CMD_SELFTESTS_RUN, 140 DEVLINK_CMD_SELFTESTS_RUN, 141 141 142 DEVLINK_CMD_NOTIFY_FILTER_SET, << 143 << 144 /* add new commands above here */ 142 /* add new commands above here */ 145 __DEVLINK_CMD_MAX, 143 __DEVLINK_CMD_MAX, 146 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 144 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 147 }; 145 }; 148 146 149 enum devlink_port_type { 147 enum devlink_port_type { 150 DEVLINK_PORT_TYPE_NOTSET, 148 DEVLINK_PORT_TYPE_NOTSET, 151 DEVLINK_PORT_TYPE_AUTO, 149 DEVLINK_PORT_TYPE_AUTO, 152 DEVLINK_PORT_TYPE_ETH, 150 DEVLINK_PORT_TYPE_ETH, 153 DEVLINK_PORT_TYPE_IB, 151 DEVLINK_PORT_TYPE_IB, 154 }; 152 }; 155 153 156 enum devlink_sb_pool_type { 154 enum devlink_sb_pool_type { 157 DEVLINK_SB_POOL_TYPE_INGRESS, 155 DEVLINK_SB_POOL_TYPE_INGRESS, 158 DEVLINK_SB_POOL_TYPE_EGRESS, 156 DEVLINK_SB_POOL_TYPE_EGRESS, 159 }; 157 }; 160 158 161 /* static threshold - limiting the maximum num 159 /* static threshold - limiting the maximum number of bytes. 162 * dynamic threshold - limiting the maximum nu 160 * dynamic threshold - limiting the maximum number of bytes 163 * based on the currently available free spa 161 * based on the currently available free space in the shared buffer pool. 164 * In this mode, the maximum quota is calcul 162 * In this mode, the maximum quota is calculated based 165 * on the following formula: 163 * on the following formula: 166 * max_quota = alpha / (1 + alpha) * Free_ 164 * max_quota = alpha / (1 + alpha) * Free_Buffer 167 * While Free_Buffer is the amount of none-o 165 * While Free_Buffer is the amount of none-occupied buffer associated to 168 * the relevant pool. 166 * the relevant pool. 169 * The value range which can be passed is 0- 167 * The value range which can be passed is 0-20 and serves 170 * for computation of alpha by following for 168 * for computation of alpha by following formula: 171 * alpha = 2 ^ (passed_value - 10) 169 * alpha = 2 ^ (passed_value - 10) 172 */ 170 */ 173 171 174 enum devlink_sb_threshold_type { 172 enum devlink_sb_threshold_type { 175 DEVLINK_SB_THRESHOLD_TYPE_STATIC, 173 DEVLINK_SB_THRESHOLD_TYPE_STATIC, 176 DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC, 174 DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC, 177 }; 175 }; 178 176 179 #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20 177 #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20 180 178 181 enum devlink_eswitch_mode { 179 enum devlink_eswitch_mode { 182 DEVLINK_ESWITCH_MODE_LEGACY, 180 DEVLINK_ESWITCH_MODE_LEGACY, 183 DEVLINK_ESWITCH_MODE_SWITCHDEV, 181 DEVLINK_ESWITCH_MODE_SWITCHDEV, 184 }; 182 }; 185 183 186 enum devlink_eswitch_inline_mode { 184 enum devlink_eswitch_inline_mode { 187 DEVLINK_ESWITCH_INLINE_MODE_NONE, 185 DEVLINK_ESWITCH_INLINE_MODE_NONE, 188 DEVLINK_ESWITCH_INLINE_MODE_LINK, 186 DEVLINK_ESWITCH_INLINE_MODE_LINK, 189 DEVLINK_ESWITCH_INLINE_MODE_NETWORK, 187 DEVLINK_ESWITCH_INLINE_MODE_NETWORK, 190 DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT, 188 DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT, 191 }; 189 }; 192 190 193 enum devlink_eswitch_encap_mode { 191 enum devlink_eswitch_encap_mode { 194 DEVLINK_ESWITCH_ENCAP_MODE_NONE, 192 DEVLINK_ESWITCH_ENCAP_MODE_NONE, 195 DEVLINK_ESWITCH_ENCAP_MODE_BASIC, 193 DEVLINK_ESWITCH_ENCAP_MODE_BASIC, 196 }; 194 }; 197 195 198 enum devlink_port_flavour { 196 enum devlink_port_flavour { 199 DEVLINK_PORT_FLAVOUR_PHYSICAL, /* Any 197 DEVLINK_PORT_FLAVOUR_PHYSICAL, /* Any kind of a port physically 200 * faci 198 * facing the user. 201 */ 199 */ 202 DEVLINK_PORT_FLAVOUR_CPU, /* CPU port 200 DEVLINK_PORT_FLAVOUR_CPU, /* CPU port */ 203 DEVLINK_PORT_FLAVOUR_DSA, /* Distribut 201 DEVLINK_PORT_FLAVOUR_DSA, /* Distributed switch architecture 204 * interconn 202 * interconnect port. 205 */ 203 */ 206 DEVLINK_PORT_FLAVOUR_PCI_PF, /* Repres 204 DEVLINK_PORT_FLAVOUR_PCI_PF, /* Represents eswitch port for 207 * the PC 205 * the PCI PF. It is an internal 208 * port t 206 * port that faces the PCI PF. 209 */ 207 */ 210 DEVLINK_PORT_FLAVOUR_PCI_VF, /* Repres 208 DEVLINK_PORT_FLAVOUR_PCI_VF, /* Represents eswitch port 211 * for th 209 * for the PCI VF. It is an internal 212 * port t 210 * port that faces the PCI VF. 213 */ 211 */ 214 DEVLINK_PORT_FLAVOUR_VIRTUAL, /* Any v 212 DEVLINK_PORT_FLAVOUR_VIRTUAL, /* Any virtual port facing the user. */ 215 DEVLINK_PORT_FLAVOUR_UNUSED, /* Port w 213 DEVLINK_PORT_FLAVOUR_UNUSED, /* Port which exists in the switch, but 216 * is not 214 * is not used in any way. 217 */ 215 */ 218 DEVLINK_PORT_FLAVOUR_PCI_SF, /* Repres 216 DEVLINK_PORT_FLAVOUR_PCI_SF, /* Represents eswitch port 219 * for th 217 * for the PCI SF. It is an internal 220 * port t 218 * port that faces the PCI SF. 221 */ 219 */ 222 }; 220 }; 223 221 224 enum devlink_rate_type { 222 enum devlink_rate_type { 225 DEVLINK_RATE_TYPE_LEAF, 223 DEVLINK_RATE_TYPE_LEAF, 226 DEVLINK_RATE_TYPE_NODE, 224 DEVLINK_RATE_TYPE_NODE, 227 }; 225 }; 228 226 229 enum devlink_param_cmode { 227 enum devlink_param_cmode { 230 DEVLINK_PARAM_CMODE_RUNTIME, 228 DEVLINK_PARAM_CMODE_RUNTIME, 231 DEVLINK_PARAM_CMODE_DRIVERINIT, 229 DEVLINK_PARAM_CMODE_DRIVERINIT, 232 DEVLINK_PARAM_CMODE_PERMANENT, 230 DEVLINK_PARAM_CMODE_PERMANENT, 233 231 234 /* Add new configuration modes above * 232 /* Add new configuration modes above */ 235 __DEVLINK_PARAM_CMODE_MAX, 233 __DEVLINK_PARAM_CMODE_MAX, 236 DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PA 234 DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1 237 }; 235 }; 238 236 239 enum devlink_param_fw_load_policy_value { 237 enum devlink_param_fw_load_policy_value { 240 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRI 238 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER, 241 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLA 239 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH, 242 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DIS 240 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK, 243 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNK 241 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNKNOWN, 244 }; 242 }; 245 243 246 enum devlink_param_reset_dev_on_drv_probe_valu 244 enum devlink_param_reset_dev_on_drv_probe_value { 247 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_V 245 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN, 248 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_V 246 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS, 249 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_V 247 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER, 250 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_V 248 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK, 251 }; 249 }; 252 250 253 enum { 251 enum { 254 DEVLINK_ATTR_STATS_RX_PACKETS, 252 DEVLINK_ATTR_STATS_RX_PACKETS, /* u64 */ 255 DEVLINK_ATTR_STATS_RX_BYTES, 253 DEVLINK_ATTR_STATS_RX_BYTES, /* u64 */ 256 DEVLINK_ATTR_STATS_RX_DROPPED, 254 DEVLINK_ATTR_STATS_RX_DROPPED, /* u64 */ 257 255 258 __DEVLINK_ATTR_STATS_MAX, 256 __DEVLINK_ATTR_STATS_MAX, 259 DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATT 257 DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1 260 }; 258 }; 261 259 262 /* Specify what sections of a flash component 260 /* Specify what sections of a flash component can be overwritten when 263 * performing an update. Overwriting of firmwa 261 * performing an update. Overwriting of firmware binary sections is always 264 * implicitly assumed to be allowed. 262 * implicitly assumed to be allowed. 265 * 263 * 266 * Each section must be documented in 264 * Each section must be documented in 267 * Documentation/networking/devlink/devlink-fl 265 * Documentation/networking/devlink/devlink-flash.rst 268 * 266 * 269 */ 267 */ 270 enum devlink_flash_overwrite { !! 268 enum { 271 DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT, 269 DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT, 272 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BI 270 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT, 273 271 274 __DEVLINK_FLASH_OVERWRITE_MAX_BIT, 272 __DEVLINK_FLASH_OVERWRITE_MAX_BIT, 275 DEVLINK_FLASH_OVERWRITE_MAX_BIT = __DE 273 DEVLINK_FLASH_OVERWRITE_MAX_BIT = __DEVLINK_FLASH_OVERWRITE_MAX_BIT - 1 276 }; 274 }; 277 275 278 #define DEVLINK_FLASH_OVERWRITE_SETTINGS _BITU 276 #define DEVLINK_FLASH_OVERWRITE_SETTINGS _BITUL(DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT) 279 #define DEVLINK_FLASH_OVERWRITE_IDENTIFIERS _B 277 #define DEVLINK_FLASH_OVERWRITE_IDENTIFIERS _BITUL(DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT) 280 278 281 #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECT 279 #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \ 282 (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_ 280 (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1) 283 281 284 enum devlink_attr_selftest_id { 282 enum devlink_attr_selftest_id { 285 DEVLINK_ATTR_SELFTEST_ID_UNSPEC, 283 DEVLINK_ATTR_SELFTEST_ID_UNSPEC, 286 DEVLINK_ATTR_SELFTEST_ID_FLASH, /* fla 284 DEVLINK_ATTR_SELFTEST_ID_FLASH, /* flag */ 287 285 288 __DEVLINK_ATTR_SELFTEST_ID_MAX, 286 __DEVLINK_ATTR_SELFTEST_ID_MAX, 289 DEVLINK_ATTR_SELFTEST_ID_MAX = __DEVLI 287 DEVLINK_ATTR_SELFTEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_ID_MAX - 1 290 }; 288 }; 291 289 292 enum devlink_selftest_status { 290 enum devlink_selftest_status { 293 DEVLINK_SELFTEST_STATUS_SKIP, 291 DEVLINK_SELFTEST_STATUS_SKIP, 294 DEVLINK_SELFTEST_STATUS_PASS, 292 DEVLINK_SELFTEST_STATUS_PASS, 295 DEVLINK_SELFTEST_STATUS_FAIL 293 DEVLINK_SELFTEST_STATUS_FAIL 296 }; 294 }; 297 295 298 enum devlink_attr_selftest_result { 296 enum devlink_attr_selftest_result { 299 DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC, 297 DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC, 300 DEVLINK_ATTR_SELFTEST_RESULT, 298 DEVLINK_ATTR_SELFTEST_RESULT, /* nested */ 301 DEVLINK_ATTR_SELFTEST_RESULT_ID, 299 DEVLINK_ATTR_SELFTEST_RESULT_ID, /* u32, enum devlink_attr_selftest_id */ 302 DEVLINK_ATTR_SELFTEST_RESULT_STATUS, 300 DEVLINK_ATTR_SELFTEST_RESULT_STATUS, /* u8, enum devlink_selftest_status */ 303 301 304 __DEVLINK_ATTR_SELFTEST_RESULT_MAX, 302 __DEVLINK_ATTR_SELFTEST_RESULT_MAX, 305 DEVLINK_ATTR_SELFTEST_RESULT_MAX = __D 303 DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_MAX - 1 306 }; 304 }; 307 305 308 /** 306 /** 309 * enum devlink_trap_action - Packet trap acti 307 * enum devlink_trap_action - Packet trap action. 310 * @DEVLINK_TRAP_ACTION_DROP: Packet is droppe 308 * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not 311 * sent to the CPU. 309 * sent to the CPU. 312 * @DEVLINK_TRAP_ACTION_TRAP: The sole copy of 310 * @DEVLINK_TRAP_ACTION_TRAP: The sole copy of the packet is sent to the CPU. 313 * @DEVLINK_TRAP_ACTION_MIRROR: Packet is forw 311 * @DEVLINK_TRAP_ACTION_MIRROR: Packet is forwarded by the device and a copy is 314 * sent to the CP 312 * sent to the CPU. 315 */ 313 */ 316 enum devlink_trap_action { 314 enum devlink_trap_action { 317 DEVLINK_TRAP_ACTION_DROP, 315 DEVLINK_TRAP_ACTION_DROP, 318 DEVLINK_TRAP_ACTION_TRAP, 316 DEVLINK_TRAP_ACTION_TRAP, 319 DEVLINK_TRAP_ACTION_MIRROR, 317 DEVLINK_TRAP_ACTION_MIRROR, 320 }; 318 }; 321 319 322 /** 320 /** 323 * enum devlink_trap_type - Packet trap type. 321 * enum devlink_trap_type - Packet trap type. 324 * @DEVLINK_TRAP_TYPE_DROP: Trap reason is a d 322 * @DEVLINK_TRAP_TYPE_DROP: Trap reason is a drop. Trapped packets are only 325 * processed by devli 323 * processed by devlink and not injected to the 326 * kernel's Rx path. 324 * kernel's Rx path. 327 * @DEVLINK_TRAP_TYPE_EXCEPTION: Trap reason i 325 * @DEVLINK_TRAP_TYPE_EXCEPTION: Trap reason is an exception. Packet was not 328 * forwarded as 326 * forwarded as intended due to an exception 329 * (e.g., missin 327 * (e.g., missing neighbour entry) and trapped to 330 * control plane 328 * control plane for resolution. Trapped packets 331 * are processed 329 * are processed by devlink and injected to 332 * the kernel's 330 * the kernel's Rx path. 333 * @DEVLINK_TRAP_TYPE_CONTROL: Packet was trap 331 * @DEVLINK_TRAP_TYPE_CONTROL: Packet was trapped because it is required for 334 * the correct fun 332 * the correct functioning of the control plane. 335 * For example, an 333 * For example, an ARP request packet. Trapped 336 * packets are inj 334 * packets are injected to the kernel's Rx path, 337 * but not reporte 335 * but not reported to drop monitor. 338 */ 336 */ 339 enum devlink_trap_type { 337 enum devlink_trap_type { 340 DEVLINK_TRAP_TYPE_DROP, 338 DEVLINK_TRAP_TYPE_DROP, 341 DEVLINK_TRAP_TYPE_EXCEPTION, 339 DEVLINK_TRAP_TYPE_EXCEPTION, 342 DEVLINK_TRAP_TYPE_CONTROL, 340 DEVLINK_TRAP_TYPE_CONTROL, 343 }; 341 }; 344 342 345 enum { 343 enum { 346 /* Trap can report input port as metad 344 /* Trap can report input port as metadata */ 347 DEVLINK_ATTR_TRAP_METADATA_TYPE_IN_POR 345 DEVLINK_ATTR_TRAP_METADATA_TYPE_IN_PORT, 348 /* Trap can report flow action cookie 346 /* Trap can report flow action cookie as metadata */ 349 DEVLINK_ATTR_TRAP_METADATA_TYPE_FA_COO 347 DEVLINK_ATTR_TRAP_METADATA_TYPE_FA_COOKIE, 350 }; 348 }; 351 349 352 enum devlink_reload_action { 350 enum devlink_reload_action { 353 DEVLINK_RELOAD_ACTION_UNSPEC, 351 DEVLINK_RELOAD_ACTION_UNSPEC, 354 DEVLINK_RELOAD_ACTION_DRIVER_REINIT, 352 DEVLINK_RELOAD_ACTION_DRIVER_REINIT, /* Driver entities re-instantiation */ 355 DEVLINK_RELOAD_ACTION_FW_ACTIVATE, 353 DEVLINK_RELOAD_ACTION_FW_ACTIVATE, /* FW activate */ 356 354 357 /* Add new reload actions above */ 355 /* Add new reload actions above */ 358 __DEVLINK_RELOAD_ACTION_MAX, 356 __DEVLINK_RELOAD_ACTION_MAX, 359 DEVLINK_RELOAD_ACTION_MAX = __DEVLINK_ 357 DEVLINK_RELOAD_ACTION_MAX = __DEVLINK_RELOAD_ACTION_MAX - 1 360 }; 358 }; 361 359 362 enum devlink_reload_limit { 360 enum devlink_reload_limit { 363 DEVLINK_RELOAD_LIMIT_UNSPEC, /* uns 361 DEVLINK_RELOAD_LIMIT_UNSPEC, /* unspecified, no constraints */ 364 DEVLINK_RELOAD_LIMIT_NO_RESET, /* No 362 DEVLINK_RELOAD_LIMIT_NO_RESET, /* No reset allowed, no down time allowed, 365 * no 363 * no link flap and no configuration is lost. 366 */ 364 */ 367 365 368 /* Add new reload limit above */ 366 /* Add new reload limit above */ 369 __DEVLINK_RELOAD_LIMIT_MAX, 367 __DEVLINK_RELOAD_LIMIT_MAX, 370 DEVLINK_RELOAD_LIMIT_MAX = __DEVLINK_R 368 DEVLINK_RELOAD_LIMIT_MAX = __DEVLINK_RELOAD_LIMIT_MAX - 1 371 }; 369 }; 372 370 373 #define DEVLINK_RELOAD_LIMITS_VALID_MASK (_BIT 371 #define DEVLINK_RELOAD_LIMITS_VALID_MASK (_BITUL(__DEVLINK_RELOAD_LIMIT_MAX) - 1) 374 372 375 enum devlink_linecard_state { 373 enum devlink_linecard_state { 376 DEVLINK_LINECARD_STATE_UNSPEC, 374 DEVLINK_LINECARD_STATE_UNSPEC, 377 DEVLINK_LINECARD_STATE_UNPROVISIONED, 375 DEVLINK_LINECARD_STATE_UNPROVISIONED, 378 DEVLINK_LINECARD_STATE_UNPROVISIONING, 376 DEVLINK_LINECARD_STATE_UNPROVISIONING, 379 DEVLINK_LINECARD_STATE_PROVISIONING, 377 DEVLINK_LINECARD_STATE_PROVISIONING, 380 DEVLINK_LINECARD_STATE_PROVISIONING_FA 378 DEVLINK_LINECARD_STATE_PROVISIONING_FAILED, 381 DEVLINK_LINECARD_STATE_PROVISIONED, 379 DEVLINK_LINECARD_STATE_PROVISIONED, 382 DEVLINK_LINECARD_STATE_ACTIVE, 380 DEVLINK_LINECARD_STATE_ACTIVE, 383 381 384 __DEVLINK_LINECARD_STATE_MAX, 382 __DEVLINK_LINECARD_STATE_MAX, 385 DEVLINK_LINECARD_STATE_MAX = __DEVLINK 383 DEVLINK_LINECARD_STATE_MAX = __DEVLINK_LINECARD_STATE_MAX - 1 386 }; 384 }; 387 385 388 enum devlink_attr { 386 enum devlink_attr { 389 /* don't change the order or add anyth 387 /* don't change the order or add anything between, this is ABI! */ 390 DEVLINK_ATTR_UNSPEC, 388 DEVLINK_ATTR_UNSPEC, 391 389 392 /* bus name + dev name together are a 390 /* bus name + dev name together are a handle for devlink entity */ 393 DEVLINK_ATTR_BUS_NAME, 391 DEVLINK_ATTR_BUS_NAME, /* string */ 394 DEVLINK_ATTR_DEV_NAME, 392 DEVLINK_ATTR_DEV_NAME, /* string */ 395 393 396 DEVLINK_ATTR_PORT_INDEX, 394 DEVLINK_ATTR_PORT_INDEX, /* u32 */ 397 DEVLINK_ATTR_PORT_TYPE, 395 DEVLINK_ATTR_PORT_TYPE, /* u16 */ 398 DEVLINK_ATTR_PORT_DESIRED_TYPE, 396 DEVLINK_ATTR_PORT_DESIRED_TYPE, /* u16 */ 399 DEVLINK_ATTR_PORT_NETDEV_IFINDEX, 397 DEVLINK_ATTR_PORT_NETDEV_IFINDEX, /* u32 */ 400 DEVLINK_ATTR_PORT_NETDEV_NAME, 398 DEVLINK_ATTR_PORT_NETDEV_NAME, /* string */ 401 DEVLINK_ATTR_PORT_IBDEV_NAME, 399 DEVLINK_ATTR_PORT_IBDEV_NAME, /* string */ 402 DEVLINK_ATTR_PORT_SPLIT_COUNT, 400 DEVLINK_ATTR_PORT_SPLIT_COUNT, /* u32 */ 403 DEVLINK_ATTR_PORT_SPLIT_GROUP, 401 DEVLINK_ATTR_PORT_SPLIT_GROUP, /* u32 */ 404 DEVLINK_ATTR_SB_INDEX, 402 DEVLINK_ATTR_SB_INDEX, /* u32 */ 405 DEVLINK_ATTR_SB_SIZE, 403 DEVLINK_ATTR_SB_SIZE, /* u32 */ 406 DEVLINK_ATTR_SB_INGRESS_POOL_COUNT, 404 DEVLINK_ATTR_SB_INGRESS_POOL_COUNT, /* u16 */ 407 DEVLINK_ATTR_SB_EGRESS_POOL_COUNT, 405 DEVLINK_ATTR_SB_EGRESS_POOL_COUNT, /* u16 */ 408 DEVLINK_ATTR_SB_INGRESS_TC_COUNT, 406 DEVLINK_ATTR_SB_INGRESS_TC_COUNT, /* u16 */ 409 DEVLINK_ATTR_SB_EGRESS_TC_COUNT, 407 DEVLINK_ATTR_SB_EGRESS_TC_COUNT, /* u16 */ 410 DEVLINK_ATTR_SB_POOL_INDEX, 408 DEVLINK_ATTR_SB_POOL_INDEX, /* u16 */ 411 DEVLINK_ATTR_SB_POOL_TYPE, 409 DEVLINK_ATTR_SB_POOL_TYPE, /* u8 */ 412 DEVLINK_ATTR_SB_POOL_SIZE, 410 DEVLINK_ATTR_SB_POOL_SIZE, /* u32 */ 413 DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE, 411 DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE, /* u8 */ 414 DEVLINK_ATTR_SB_THRESHOLD, 412 DEVLINK_ATTR_SB_THRESHOLD, /* u32 */ 415 DEVLINK_ATTR_SB_TC_INDEX, 413 DEVLINK_ATTR_SB_TC_INDEX, /* u16 */ 416 DEVLINK_ATTR_SB_OCC_CUR, 414 DEVLINK_ATTR_SB_OCC_CUR, /* u32 */ 417 DEVLINK_ATTR_SB_OCC_MAX, 415 DEVLINK_ATTR_SB_OCC_MAX, /* u32 */ 418 DEVLINK_ATTR_ESWITCH_MODE, 416 DEVLINK_ATTR_ESWITCH_MODE, /* u16 */ 419 DEVLINK_ATTR_ESWITCH_INLINE_MODE, 417 DEVLINK_ATTR_ESWITCH_INLINE_MODE, /* u8 */ 420 418 421 DEVLINK_ATTR_DPIPE_TABLES, 419 DEVLINK_ATTR_DPIPE_TABLES, /* nested */ 422 DEVLINK_ATTR_DPIPE_TABLE, 420 DEVLINK_ATTR_DPIPE_TABLE, /* nested */ 423 DEVLINK_ATTR_DPIPE_TABLE_NAME, 421 DEVLINK_ATTR_DPIPE_TABLE_NAME, /* string */ 424 DEVLINK_ATTR_DPIPE_TABLE_SIZE, 422 DEVLINK_ATTR_DPIPE_TABLE_SIZE, /* u64 */ 425 DEVLINK_ATTR_DPIPE_TABLE_MATCHES, 423 DEVLINK_ATTR_DPIPE_TABLE_MATCHES, /* nested */ 426 DEVLINK_ATTR_DPIPE_TABLE_ACTIONS, 424 DEVLINK_ATTR_DPIPE_TABLE_ACTIONS, /* nested */ 427 DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENAB 425 DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED, /* u8 */ 428 426 429 DEVLINK_ATTR_DPIPE_ENTRIES, 427 DEVLINK_ATTR_DPIPE_ENTRIES, /* nested */ 430 DEVLINK_ATTR_DPIPE_ENTRY, 428 DEVLINK_ATTR_DPIPE_ENTRY, /* nested */ 431 DEVLINK_ATTR_DPIPE_ENTRY_INDEX, 429 DEVLINK_ATTR_DPIPE_ENTRY_INDEX, /* u64 */ 432 DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES, 430 DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES, /* nested */ 433 DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES 431 DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES, /* nested */ 434 DEVLINK_ATTR_DPIPE_ENTRY_COUNTER, 432 DEVLINK_ATTR_DPIPE_ENTRY_COUNTER, /* u64 */ 435 433 436 DEVLINK_ATTR_DPIPE_MATCH, 434 DEVLINK_ATTR_DPIPE_MATCH, /* nested */ 437 DEVLINK_ATTR_DPIPE_MATCH_VALUE, 435 DEVLINK_ATTR_DPIPE_MATCH_VALUE, /* nested */ 438 DEVLINK_ATTR_DPIPE_MATCH_TYPE, 436 DEVLINK_ATTR_DPIPE_MATCH_TYPE, /* u32 */ 439 437 440 DEVLINK_ATTR_DPIPE_ACTION, 438 DEVLINK_ATTR_DPIPE_ACTION, /* nested */ 441 DEVLINK_ATTR_DPIPE_ACTION_VALUE, 439 DEVLINK_ATTR_DPIPE_ACTION_VALUE, /* nested */ 442 DEVLINK_ATTR_DPIPE_ACTION_TYPE, 440 DEVLINK_ATTR_DPIPE_ACTION_TYPE, /* u32 */ 443 441 444 DEVLINK_ATTR_DPIPE_VALUE, 442 DEVLINK_ATTR_DPIPE_VALUE, 445 DEVLINK_ATTR_DPIPE_VALUE_MASK, 443 DEVLINK_ATTR_DPIPE_VALUE_MASK, 446 DEVLINK_ATTR_DPIPE_VALUE_MAPPING, 444 DEVLINK_ATTR_DPIPE_VALUE_MAPPING, /* u32 */ 447 445 448 DEVLINK_ATTR_DPIPE_HEADERS, 446 DEVLINK_ATTR_DPIPE_HEADERS, /* nested */ 449 DEVLINK_ATTR_DPIPE_HEADER, 447 DEVLINK_ATTR_DPIPE_HEADER, /* nested */ 450 DEVLINK_ATTR_DPIPE_HEADER_NAME, 448 DEVLINK_ATTR_DPIPE_HEADER_NAME, /* string */ 451 DEVLINK_ATTR_DPIPE_HEADER_ID, 449 DEVLINK_ATTR_DPIPE_HEADER_ID, /* u32 */ 452 DEVLINK_ATTR_DPIPE_HEADER_FIELDS, 450 DEVLINK_ATTR_DPIPE_HEADER_FIELDS, /* nested */ 453 DEVLINK_ATTR_DPIPE_HEADER_GLOBAL, 451 DEVLINK_ATTR_DPIPE_HEADER_GLOBAL, /* u8 */ 454 DEVLINK_ATTR_DPIPE_HEADER_INDEX, 452 DEVLINK_ATTR_DPIPE_HEADER_INDEX, /* u32 */ 455 453 456 DEVLINK_ATTR_DPIPE_FIELD, 454 DEVLINK_ATTR_DPIPE_FIELD, /* nested */ 457 DEVLINK_ATTR_DPIPE_FIELD_NAME, 455 DEVLINK_ATTR_DPIPE_FIELD_NAME, /* string */ 458 DEVLINK_ATTR_DPIPE_FIELD_ID, 456 DEVLINK_ATTR_DPIPE_FIELD_ID, /* u32 */ 459 DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH, 457 DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH, /* u32 */ 460 DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE, 458 DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE, /* u32 */ 461 459 462 DEVLINK_ATTR_PAD, 460 DEVLINK_ATTR_PAD, 463 461 464 DEVLINK_ATTR_ESWITCH_ENCAP_MODE, 462 DEVLINK_ATTR_ESWITCH_ENCAP_MODE, /* u8 */ 465 DEVLINK_ATTR_RESOURCE_LIST, 463 DEVLINK_ATTR_RESOURCE_LIST, /* nested */ 466 DEVLINK_ATTR_RESOURCE, 464 DEVLINK_ATTR_RESOURCE, /* nested */ 467 DEVLINK_ATTR_RESOURCE_NAME, 465 DEVLINK_ATTR_RESOURCE_NAME, /* string */ 468 DEVLINK_ATTR_RESOURCE_ID, 466 DEVLINK_ATTR_RESOURCE_ID, /* u64 */ 469 DEVLINK_ATTR_RESOURCE_SIZE, 467 DEVLINK_ATTR_RESOURCE_SIZE, /* u64 */ 470 DEVLINK_ATTR_RESOURCE_SIZE_NEW, 468 DEVLINK_ATTR_RESOURCE_SIZE_NEW, /* u64 */ 471 DEVLINK_ATTR_RESOURCE_SIZE_VALID, 469 DEVLINK_ATTR_RESOURCE_SIZE_VALID, /* u8 */ 472 DEVLINK_ATTR_RESOURCE_SIZE_MIN, 470 DEVLINK_ATTR_RESOURCE_SIZE_MIN, /* u64 */ 473 DEVLINK_ATTR_RESOURCE_SIZE_MAX, 471 DEVLINK_ATTR_RESOURCE_SIZE_MAX, /* u64 */ 474 DEVLINK_ATTR_RESOURCE_SIZE_GRAN, 472 DEVLINK_ATTR_RESOURCE_SIZE_GRAN, /* u64 */ 475 DEVLINK_ATTR_RESOURCE_UNIT, 473 DEVLINK_ATTR_RESOURCE_UNIT, /* u8 */ 476 DEVLINK_ATTR_RESOURCE_OCC, 474 DEVLINK_ATTR_RESOURCE_OCC, /* u64 */ 477 DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID, 475 DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID, /* u64 */ 478 DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNIT 476 DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS,/* u64 */ 479 477 480 DEVLINK_ATTR_PORT_FLAVOUR, 478 DEVLINK_ATTR_PORT_FLAVOUR, /* u16 */ 481 DEVLINK_ATTR_PORT_NUMBER, 479 DEVLINK_ATTR_PORT_NUMBER, /* u32 */ 482 DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER 480 DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER, /* u32 */ 483 481 484 DEVLINK_ATTR_PARAM, 482 DEVLINK_ATTR_PARAM, /* nested */ 485 DEVLINK_ATTR_PARAM_NAME, 483 DEVLINK_ATTR_PARAM_NAME, /* string */ 486 DEVLINK_ATTR_PARAM_GENERIC, 484 DEVLINK_ATTR_PARAM_GENERIC, /* flag */ 487 DEVLINK_ATTR_PARAM_TYPE, 485 DEVLINK_ATTR_PARAM_TYPE, /* u8 */ 488 DEVLINK_ATTR_PARAM_VALUES_LIST, 486 DEVLINK_ATTR_PARAM_VALUES_LIST, /* nested */ 489 DEVLINK_ATTR_PARAM_VALUE, 487 DEVLINK_ATTR_PARAM_VALUE, /* nested */ 490 DEVLINK_ATTR_PARAM_VALUE_DATA, 488 DEVLINK_ATTR_PARAM_VALUE_DATA, /* dynamic */ 491 DEVLINK_ATTR_PARAM_VALUE_CMODE, 489 DEVLINK_ATTR_PARAM_VALUE_CMODE, /* u8 */ 492 490 493 DEVLINK_ATTR_REGION_NAME, 491 DEVLINK_ATTR_REGION_NAME, /* string */ 494 DEVLINK_ATTR_REGION_SIZE, 492 DEVLINK_ATTR_REGION_SIZE, /* u64 */ 495 DEVLINK_ATTR_REGION_SNAPSHOTS, 493 DEVLINK_ATTR_REGION_SNAPSHOTS, /* nested */ 496 DEVLINK_ATTR_REGION_SNAPSHOT, 494 DEVLINK_ATTR_REGION_SNAPSHOT, /* nested */ 497 DEVLINK_ATTR_REGION_SNAPSHOT_ID, 495 DEVLINK_ATTR_REGION_SNAPSHOT_ID, /* u32 */ 498 496 499 DEVLINK_ATTR_REGION_CHUNKS, 497 DEVLINK_ATTR_REGION_CHUNKS, /* nested */ 500 DEVLINK_ATTR_REGION_CHUNK, 498 DEVLINK_ATTR_REGION_CHUNK, /* nested */ 501 DEVLINK_ATTR_REGION_CHUNK_DATA, 499 DEVLINK_ATTR_REGION_CHUNK_DATA, /* binary */ 502 DEVLINK_ATTR_REGION_CHUNK_ADDR, 500 DEVLINK_ATTR_REGION_CHUNK_ADDR, /* u64 */ 503 DEVLINK_ATTR_REGION_CHUNK_LEN, 501 DEVLINK_ATTR_REGION_CHUNK_LEN, /* u64 */ 504 502 505 DEVLINK_ATTR_INFO_DRIVER_NAME, 503 DEVLINK_ATTR_INFO_DRIVER_NAME, /* string */ 506 DEVLINK_ATTR_INFO_SERIAL_NUMBER, 504 DEVLINK_ATTR_INFO_SERIAL_NUMBER, /* string */ 507 DEVLINK_ATTR_INFO_VERSION_FIXED, 505 DEVLINK_ATTR_INFO_VERSION_FIXED, /* nested */ 508 DEVLINK_ATTR_INFO_VERSION_RUNNING, 506 DEVLINK_ATTR_INFO_VERSION_RUNNING, /* nested */ 509 DEVLINK_ATTR_INFO_VERSION_STORED, 507 DEVLINK_ATTR_INFO_VERSION_STORED, /* nested */ 510 DEVLINK_ATTR_INFO_VERSION_NAME, 508 DEVLINK_ATTR_INFO_VERSION_NAME, /* string */ 511 DEVLINK_ATTR_INFO_VERSION_VALUE, 509 DEVLINK_ATTR_INFO_VERSION_VALUE, /* string */ 512 510 513 DEVLINK_ATTR_SB_POOL_CELL_SIZE, 511 DEVLINK_ATTR_SB_POOL_CELL_SIZE, /* u32 */ 514 512 515 DEVLINK_ATTR_FMSG, 513 DEVLINK_ATTR_FMSG, /* nested */ 516 DEVLINK_ATTR_FMSG_OBJ_NEST_START, 514 DEVLINK_ATTR_FMSG_OBJ_NEST_START, /* flag */ 517 DEVLINK_ATTR_FMSG_PAIR_NEST_START, 515 DEVLINK_ATTR_FMSG_PAIR_NEST_START, /* flag */ 518 DEVLINK_ATTR_FMSG_ARR_NEST_START, 516 DEVLINK_ATTR_FMSG_ARR_NEST_START, /* flag */ 519 DEVLINK_ATTR_FMSG_NEST_END, 517 DEVLINK_ATTR_FMSG_NEST_END, /* flag */ 520 DEVLINK_ATTR_FMSG_OBJ_NAME, 518 DEVLINK_ATTR_FMSG_OBJ_NAME, /* string */ 521 DEVLINK_ATTR_FMSG_OBJ_VALUE_TYPE, 519 DEVLINK_ATTR_FMSG_OBJ_VALUE_TYPE, /* u8 */ 522 DEVLINK_ATTR_FMSG_OBJ_VALUE_DATA, 520 DEVLINK_ATTR_FMSG_OBJ_VALUE_DATA, /* dynamic */ 523 521 524 DEVLINK_ATTR_HEALTH_REPORTER, 522 DEVLINK_ATTR_HEALTH_REPORTER, /* nested */ 525 DEVLINK_ATTR_HEALTH_REPORTER_NAME, 523 DEVLINK_ATTR_HEALTH_REPORTER_NAME, /* string */ 526 DEVLINK_ATTR_HEALTH_REPORTER_STATE, 524 DEVLINK_ATTR_HEALTH_REPORTER_STATE, /* u8 */ 527 DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT 525 DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT, /* u64 */ 528 DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_C 526 DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT, /* u64 */ 529 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS, 527 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS, /* u64 */ 530 DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_ 528 DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD, /* u64 */ 531 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECO 529 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER, /* u8 */ 532 530 533 DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME, 531 DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME, /* string */ 534 DEVLINK_ATTR_FLASH_UPDATE_COMPONENT, 532 DEVLINK_ATTR_FLASH_UPDATE_COMPONENT, /* string */ 535 DEVLINK_ATTR_FLASH_UPDATE_STATUS_MSG, 533 DEVLINK_ATTR_FLASH_UPDATE_STATUS_MSG, /* string */ 536 DEVLINK_ATTR_FLASH_UPDATE_STATUS_DONE, 534 DEVLINK_ATTR_FLASH_UPDATE_STATUS_DONE, /* u64 */ 537 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TOTAL 535 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TOTAL, /* u64 */ 538 536 539 DEVLINK_ATTR_PORT_PCI_PF_NUMBER, 537 DEVLINK_ATTR_PORT_PCI_PF_NUMBER, /* u16 */ 540 DEVLINK_ATTR_PORT_PCI_VF_NUMBER, 538 DEVLINK_ATTR_PORT_PCI_VF_NUMBER, /* u16 */ 541 539 542 DEVLINK_ATTR_STATS, 540 DEVLINK_ATTR_STATS, /* nested */ 543 541 544 DEVLINK_ATTR_TRAP_NAME, 542 DEVLINK_ATTR_TRAP_NAME, /* string */ 545 /* enum devlink_trap_action */ 543 /* enum devlink_trap_action */ 546 DEVLINK_ATTR_TRAP_ACTION, 544 DEVLINK_ATTR_TRAP_ACTION, /* u8 */ 547 /* enum devlink_trap_type */ 545 /* enum devlink_trap_type */ 548 DEVLINK_ATTR_TRAP_TYPE, 546 DEVLINK_ATTR_TRAP_TYPE, /* u8 */ 549 DEVLINK_ATTR_TRAP_GENERIC, 547 DEVLINK_ATTR_TRAP_GENERIC, /* flag */ 550 DEVLINK_ATTR_TRAP_METADATA, 548 DEVLINK_ATTR_TRAP_METADATA, /* nested */ 551 DEVLINK_ATTR_TRAP_GROUP_NAME, 549 DEVLINK_ATTR_TRAP_GROUP_NAME, /* string */ 552 550 553 DEVLINK_ATTR_RELOAD_FAILED, 551 DEVLINK_ATTR_RELOAD_FAILED, /* u8 0 or 1 */ 554 552 555 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_N 553 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS, /* u64 */ 556 554 557 DEVLINK_ATTR_NETNS_FD, 555 DEVLINK_ATTR_NETNS_FD, /* u32 */ 558 DEVLINK_ATTR_NETNS_PID, 556 DEVLINK_ATTR_NETNS_PID, /* u32 */ 559 DEVLINK_ATTR_NETNS_ID, 557 DEVLINK_ATTR_NETNS_ID, /* u32 */ 560 558 561 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP 559 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP, /* u8 */ 562 560 563 DEVLINK_ATTR_TRAP_POLICER_ID, 561 DEVLINK_ATTR_TRAP_POLICER_ID, /* u32 */ 564 DEVLINK_ATTR_TRAP_POLICER_RATE, 562 DEVLINK_ATTR_TRAP_POLICER_RATE, /* u64 */ 565 DEVLINK_ATTR_TRAP_POLICER_BURST, 563 DEVLINK_ATTR_TRAP_POLICER_BURST, /* u64 */ 566 564 567 DEVLINK_ATTR_PORT_FUNCTION, 565 DEVLINK_ATTR_PORT_FUNCTION, /* nested */ 568 566 569 DEVLINK_ATTR_INFO_BOARD_SERIAL_NUMBER, 567 DEVLINK_ATTR_INFO_BOARD_SERIAL_NUMBER, /* string */ 570 568 571 DEVLINK_ATTR_PORT_LANES, 569 DEVLINK_ATTR_PORT_LANES, /* u32 */ 572 DEVLINK_ATTR_PORT_SPLITTABLE, 570 DEVLINK_ATTR_PORT_SPLITTABLE, /* u8 */ 573 571 574 DEVLINK_ATTR_PORT_EXTERNAL, 572 DEVLINK_ATTR_PORT_EXTERNAL, /* u8 */ 575 DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, 573 DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, /* u32 */ 576 574 577 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TIMEO 575 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TIMEOUT, /* u64 */ 578 DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MA 576 DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK, /* bitfield32 */ 579 577 580 DEVLINK_ATTR_RELOAD_ACTION, 578 DEVLINK_ATTR_RELOAD_ACTION, /* u8 */ 581 DEVLINK_ATTR_RELOAD_ACTIONS_PERFORMED, 579 DEVLINK_ATTR_RELOAD_ACTIONS_PERFORMED, /* bitfield32 */ 582 DEVLINK_ATTR_RELOAD_LIMITS, 580 DEVLINK_ATTR_RELOAD_LIMITS, /* bitfield32 */ 583 581 584 DEVLINK_ATTR_DEV_STATS, 582 DEVLINK_ATTR_DEV_STATS, /* nested */ 585 DEVLINK_ATTR_RELOAD_STATS, 583 DEVLINK_ATTR_RELOAD_STATS, /* nested */ 586 DEVLINK_ATTR_RELOAD_STATS_ENTRY, 584 DEVLINK_ATTR_RELOAD_STATS_ENTRY, /* nested */ 587 DEVLINK_ATTR_RELOAD_STATS_LIMIT, 585 DEVLINK_ATTR_RELOAD_STATS_LIMIT, /* u8 */ 588 DEVLINK_ATTR_RELOAD_STATS_VALUE, 586 DEVLINK_ATTR_RELOAD_STATS_VALUE, /* u32 */ 589 DEVLINK_ATTR_REMOTE_RELOAD_STATS, 587 DEVLINK_ATTR_REMOTE_RELOAD_STATS, /* nested */ 590 DEVLINK_ATTR_RELOAD_ACTION_INFO, 588 DEVLINK_ATTR_RELOAD_ACTION_INFO, /* nested */ 591 DEVLINK_ATTR_RELOAD_ACTION_STATS, 589 DEVLINK_ATTR_RELOAD_ACTION_STATS, /* nested */ 592 590 593 DEVLINK_ATTR_PORT_PCI_SF_NUMBER, 591 DEVLINK_ATTR_PORT_PCI_SF_NUMBER, /* u32 */ 594 592 595 DEVLINK_ATTR_RATE_TYPE, 593 DEVLINK_ATTR_RATE_TYPE, /* u16 */ 596 DEVLINK_ATTR_RATE_TX_SHARE, 594 DEVLINK_ATTR_RATE_TX_SHARE, /* u64 */ 597 DEVLINK_ATTR_RATE_TX_MAX, 595 DEVLINK_ATTR_RATE_TX_MAX, /* u64 */ 598 DEVLINK_ATTR_RATE_NODE_NAME, 596 DEVLINK_ATTR_RATE_NODE_NAME, /* string */ 599 DEVLINK_ATTR_RATE_PARENT_NODE_NAME, 597 DEVLINK_ATTR_RATE_PARENT_NODE_NAME, /* string */ 600 598 601 DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, 599 DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, /* u32 */ 602 600 603 DEVLINK_ATTR_LINECARD_INDEX, 601 DEVLINK_ATTR_LINECARD_INDEX, /* u32 */ 604 DEVLINK_ATTR_LINECARD_STATE, 602 DEVLINK_ATTR_LINECARD_STATE, /* u8 */ 605 DEVLINK_ATTR_LINECARD_TYPE, 603 DEVLINK_ATTR_LINECARD_TYPE, /* string */ 606 DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, 604 DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ 607 605 608 DEVLINK_ATTR_NESTED_DEVLINK, 606 DEVLINK_ATTR_NESTED_DEVLINK, /* nested */ 609 607 610 DEVLINK_ATTR_SELFTESTS, 608 DEVLINK_ATTR_SELFTESTS, /* nested */ 611 609 612 DEVLINK_ATTR_RATE_TX_PRIORITY, !! 610 /* add new attributes above here, update the policy in devlink.c */ 613 DEVLINK_ATTR_RATE_TX_WEIGHT, << 614 << 615 DEVLINK_ATTR_REGION_DIRECT, << 616 << 617 /* Add new attributes above here, upda << 618 * Documentation/netlink/specs/devlink << 619 * net/devlink/netlink_gen.c. << 620 */ << 621 611 622 __DEVLINK_ATTR_MAX, 612 __DEVLINK_ATTR_MAX, 623 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX 613 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1 624 }; 614 }; 625 615 626 /* Mapping between internal resource described 616 /* Mapping between internal resource described by the field and system 627 * structure 617 * structure 628 */ 618 */ 629 enum devlink_dpipe_field_mapping_type { 619 enum devlink_dpipe_field_mapping_type { 630 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE, 620 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE, 631 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFIND 621 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX, 632 }; 622 }; 633 623 634 /* Match type - specify the type of the match 624 /* Match type - specify the type of the match */ 635 enum devlink_dpipe_match_type { 625 enum devlink_dpipe_match_type { 636 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT, 626 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT, 637 }; 627 }; 638 628 639 /* Action type - specify the action type */ 629 /* Action type - specify the action type */ 640 enum devlink_dpipe_action_type { 630 enum devlink_dpipe_action_type { 641 DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY 631 DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY, 642 }; 632 }; 643 633 644 enum devlink_dpipe_field_ethernet_id { 634 enum devlink_dpipe_field_ethernet_id { 645 DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC, 635 DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC, 646 }; 636 }; 647 637 648 enum devlink_dpipe_field_ipv4_id { 638 enum devlink_dpipe_field_ipv4_id { 649 DEVLINK_DPIPE_FIELD_IPV4_DST_IP, 639 DEVLINK_DPIPE_FIELD_IPV4_DST_IP, 650 }; 640 }; 651 641 652 enum devlink_dpipe_field_ipv6_id { 642 enum devlink_dpipe_field_ipv6_id { 653 DEVLINK_DPIPE_FIELD_IPV6_DST_IP, 643 DEVLINK_DPIPE_FIELD_IPV6_DST_IP, 654 }; 644 }; 655 645 656 enum devlink_dpipe_header_id { 646 enum devlink_dpipe_header_id { 657 DEVLINK_DPIPE_HEADER_ETHERNET, 647 DEVLINK_DPIPE_HEADER_ETHERNET, 658 DEVLINK_DPIPE_HEADER_IPV4, 648 DEVLINK_DPIPE_HEADER_IPV4, 659 DEVLINK_DPIPE_HEADER_IPV6, 649 DEVLINK_DPIPE_HEADER_IPV6, 660 }; 650 }; 661 651 662 enum devlink_resource_unit { 652 enum devlink_resource_unit { 663 DEVLINK_RESOURCE_UNIT_ENTRY, 653 DEVLINK_RESOURCE_UNIT_ENTRY, 664 }; 654 }; 665 655 666 enum devlink_port_fn_attr_cap { << 667 DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT, << 668 DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BI << 669 DEVLINK_PORT_FN_ATTR_CAP_IPSEC_CRYPTO_ << 670 DEVLINK_PORT_FN_ATTR_CAP_IPSEC_PACKET_ << 671 << 672 /* Add new caps above */ << 673 __DEVLINK_PORT_FN_ATTR_CAPS_MAX, << 674 }; << 675 << 676 #define DEVLINK_PORT_FN_CAP_ROCE _BITUL(DEVLIN << 677 #define DEVLINK_PORT_FN_CAP_MIGRATABLE \ << 678 _BITUL(DEVLINK_PORT_FN_ATTR_CAP_MIGRAT << 679 #define DEVLINK_PORT_FN_CAP_IPSEC_CRYPTO _BITU << 680 #define DEVLINK_PORT_FN_CAP_IPSEC_PACKET _BITU << 681 << 682 enum devlink_port_function_attr { 656 enum devlink_port_function_attr { 683 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC, 657 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC, 684 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, 658 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */ 685 DEVLINK_PORT_FN_ATTR_STATE, /* u8 659 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */ 686 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 660 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */ 687 DEVLINK_PORT_FN_ATTR_CAPS, /* bit << 688 DEVLINK_PORT_FN_ATTR_DEVLINK, /* nes << 689 DEVLINK_PORT_FN_ATTR_MAX_IO_EQS, << 690 661 691 __DEVLINK_PORT_FUNCTION_ATTR_MAX, 662 __DEVLINK_PORT_FUNCTION_ATTR_MAX, 692 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEV 663 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1 693 }; 664 }; 694 665 695 enum devlink_port_fn_state { 666 enum devlink_port_fn_state { 696 DEVLINK_PORT_FN_STATE_INACTIVE, 667 DEVLINK_PORT_FN_STATE_INACTIVE, 697 DEVLINK_PORT_FN_STATE_ACTIVE, 668 DEVLINK_PORT_FN_STATE_ACTIVE, 698 }; 669 }; 699 670 700 /** 671 /** 701 * enum devlink_port_fn_opstate - indicates op 672 * enum devlink_port_fn_opstate - indicates operational state of the function 702 * @DEVLINK_PORT_FN_OPSTATE_ATTACHED: Driver i 673 * @DEVLINK_PORT_FN_OPSTATE_ATTACHED: Driver is attached to the function. 703 * For graceful tear down of the function, aft 674 * For graceful tear down of the function, after inactivation of the 704 * function, user should wait for operational 675 * function, user should wait for operational state to turn DETACHED. 705 * @DEVLINK_PORT_FN_OPSTATE_DETACHED: Driver i 676 * @DEVLINK_PORT_FN_OPSTATE_DETACHED: Driver is detached from the function. 706 * It is safe to delete the port. 677 * It is safe to delete the port. 707 */ 678 */ 708 enum devlink_port_fn_opstate { 679 enum devlink_port_fn_opstate { 709 DEVLINK_PORT_FN_OPSTATE_DETACHED, 680 DEVLINK_PORT_FN_OPSTATE_DETACHED, 710 DEVLINK_PORT_FN_OPSTATE_ATTACHED, 681 DEVLINK_PORT_FN_OPSTATE_ATTACHED, 711 }; 682 }; 712 683 713 #endif /* _UAPI_LINUX_DEVLINK_H_ */ 684 #endif /* _UAPI_LINUX_DEVLINK_H_ */ 714 685
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.