1 // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 2 /* Do not edit directly, auto-generated from: */ 3 /* Documentation/netlink/specs/devlink.yaml */ 4 /* YNL-GEN kernel source */ 5 6 #include <net/netlink.h> 7 #include <net/genetlink.h> 8 9 #include "netlink_gen.h" 10 11 #include <uapi/linux/devlink.h> 12 13 /* Common nested types */ 14 const struct nla_policy devlink_dl_port_function_nl_policy[DEVLINK_PORT_FN_ATTR_CAPS + 1] = { 15 [DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR] = { .type = NLA_BINARY, }, 16 [DEVLINK_PORT_FN_ATTR_STATE] = NLA_POLICY_MAX(NLA_U8, 1), 17 [DEVLINK_PORT_FN_ATTR_OPSTATE] = NLA_POLICY_MAX(NLA_U8, 1), 18 [DEVLINK_PORT_FN_ATTR_CAPS] = NLA_POLICY_BITFIELD32(15), 19 }; 20 21 const struct nla_policy devlink_dl_selftest_id_nl_policy[DEVLINK_ATTR_SELFTEST_ID_FLASH + 1] = { 22 [DEVLINK_ATTR_SELFTEST_ID_FLASH] = { .type = NLA_FLAG, }, 23 }; 24 25 /* DEVLINK_CMD_GET - do */ 26 static const struct nla_policy devlink_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 27 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 28 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 29 }; 30 31 /* DEVLINK_CMD_PORT_GET - do */ 32 static const struct nla_policy devlink_port_get_do_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = { 33 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 34 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 35 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 36 }; 37 38 /* DEVLINK_CMD_PORT_GET - dump */ 39 static const struct nla_policy devlink_port_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 40 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 41 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 42 }; 43 44 /* DEVLINK_CMD_PORT_SET - do */ 45 static const struct nla_policy devlink_port_set_nl_policy[DEVLINK_ATTR_PORT_FUNCTION + 1] = { 46 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 47 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 48 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 49 [DEVLINK_ATTR_PORT_TYPE] = NLA_POLICY_MAX(NLA_U16, 3), 50 [DEVLINK_ATTR_PORT_FUNCTION] = NLA_POLICY_NESTED(devlink_dl_port_function_nl_policy), 51 }; 52 53 /* DEVLINK_CMD_PORT_NEW - do */ 54 static const struct nla_policy devlink_port_new_nl_policy[DEVLINK_ATTR_PORT_PCI_SF_NUMBER + 1] = { 55 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 56 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 57 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 58 [DEVLINK_ATTR_PORT_FLAVOUR] = NLA_POLICY_MAX(NLA_U16, 7), 59 [DEVLINK_ATTR_PORT_PCI_PF_NUMBER] = { .type = NLA_U16, }, 60 [DEVLINK_ATTR_PORT_PCI_SF_NUMBER] = { .type = NLA_U32, }, 61 [DEVLINK_ATTR_PORT_CONTROLLER_NUMBER] = { .type = NLA_U32, }, 62 }; 63 64 /* DEVLINK_CMD_PORT_DEL - do */ 65 static const struct nla_policy devlink_port_del_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = { 66 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 67 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 68 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 69 }; 70 71 /* DEVLINK_CMD_PORT_SPLIT - do */ 72 static const struct nla_policy devlink_port_split_nl_policy[DEVLINK_ATTR_PORT_SPLIT_COUNT + 1] = { 73 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 74 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 75 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 76 [DEVLINK_ATTR_PORT_SPLIT_COUNT] = { .type = NLA_U32, }, 77 }; 78 79 /* DEVLINK_CMD_PORT_UNSPLIT - do */ 80 static const struct nla_policy devlink_port_unsplit_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = { 81 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 82 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 83 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 84 }; 85 86 /* DEVLINK_CMD_SB_GET - do */ 87 static const struct nla_policy devlink_sb_get_do_nl_policy[DEVLINK_ATTR_SB_INDEX + 1] = { 88 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 89 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 90 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 91 }; 92 93 /* DEVLINK_CMD_SB_GET - dump */ 94 static const struct nla_policy devlink_sb_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 95 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 96 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 97 }; 98 99 /* DEVLINK_CMD_SB_POOL_GET - do */ 100 static const struct nla_policy devlink_sb_pool_get_do_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = { 101 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 102 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 103 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 104 [DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, }, 105 }; 106 107 /* DEVLINK_CMD_SB_POOL_GET - dump */ 108 static const struct nla_policy devlink_sb_pool_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 109 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 110 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 111 }; 112 113 /* DEVLINK_CMD_SB_POOL_SET - do */ 114 static const struct nla_policy devlink_sb_pool_set_nl_policy[DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE + 1] = { 115 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 116 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 117 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 118 [DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, }, 119 [DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE] = NLA_POLICY_MAX(NLA_U8, 1), 120 [DEVLINK_ATTR_SB_POOL_SIZE] = { .type = NLA_U32, }, 121 }; 122 123 /* DEVLINK_CMD_SB_PORT_POOL_GET - do */ 124 static const struct nla_policy devlink_sb_port_pool_get_do_nl_policy[DEVLINK_ATTR_SB_POOL_INDEX + 1] = { 125 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 126 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 127 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 128 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 129 [DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, }, 130 }; 131 132 /* DEVLINK_CMD_SB_PORT_POOL_GET - dump */ 133 static const struct nla_policy devlink_sb_port_pool_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 134 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 135 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 136 }; 137 138 /* DEVLINK_CMD_SB_PORT_POOL_SET - do */ 139 static const struct nla_policy devlink_sb_port_pool_set_nl_policy[DEVLINK_ATTR_SB_THRESHOLD + 1] = { 140 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 141 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 142 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 143 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 144 [DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, }, 145 [DEVLINK_ATTR_SB_THRESHOLD] = { .type = NLA_U32, }, 146 }; 147 148 /* DEVLINK_CMD_SB_TC_POOL_BIND_GET - do */ 149 static const struct nla_policy devlink_sb_tc_pool_bind_get_do_nl_policy[DEVLINK_ATTR_SB_TC_INDEX + 1] = { 150 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 151 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 152 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 153 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 154 [DEVLINK_ATTR_SB_POOL_TYPE] = NLA_POLICY_MAX(NLA_U8, 1), 155 [DEVLINK_ATTR_SB_TC_INDEX] = { .type = NLA_U16, }, 156 }; 157 158 /* DEVLINK_CMD_SB_TC_POOL_BIND_GET - dump */ 159 static const struct nla_policy devlink_sb_tc_pool_bind_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 160 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 161 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 162 }; 163 164 /* DEVLINK_CMD_SB_TC_POOL_BIND_SET - do */ 165 static const struct nla_policy devlink_sb_tc_pool_bind_set_nl_policy[DEVLINK_ATTR_SB_TC_INDEX + 1] = { 166 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 167 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 168 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 169 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 170 [DEVLINK_ATTR_SB_POOL_INDEX] = { .type = NLA_U16, }, 171 [DEVLINK_ATTR_SB_POOL_TYPE] = NLA_POLICY_MAX(NLA_U8, 1), 172 [DEVLINK_ATTR_SB_TC_INDEX] = { .type = NLA_U16, }, 173 [DEVLINK_ATTR_SB_THRESHOLD] = { .type = NLA_U32, }, 174 }; 175 176 /* DEVLINK_CMD_SB_OCC_SNAPSHOT - do */ 177 static const struct nla_policy devlink_sb_occ_snapshot_nl_policy[DEVLINK_ATTR_SB_INDEX + 1] = { 178 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 179 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 180 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 181 }; 182 183 /* DEVLINK_CMD_SB_OCC_MAX_CLEAR - do */ 184 static const struct nla_policy devlink_sb_occ_max_clear_nl_policy[DEVLINK_ATTR_SB_INDEX + 1] = { 185 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 186 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 187 [DEVLINK_ATTR_SB_INDEX] = { .type = NLA_U32, }, 188 }; 189 190 /* DEVLINK_CMD_ESWITCH_GET - do */ 191 static const struct nla_policy devlink_eswitch_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 192 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 193 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 194 }; 195 196 /* DEVLINK_CMD_ESWITCH_SET - do */ 197 static const struct nla_policy devlink_eswitch_set_nl_policy[DEVLINK_ATTR_ESWITCH_ENCAP_MODE + 1] = { 198 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 199 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 200 [DEVLINK_ATTR_ESWITCH_MODE] = NLA_POLICY_MAX(NLA_U16, 1), 201 [DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U16, 3), 202 [DEVLINK_ATTR_ESWITCH_ENCAP_MODE] = NLA_POLICY_MAX(NLA_U8, 1), 203 }; 204 205 /* DEVLINK_CMD_DPIPE_TABLE_GET - do */ 206 static const struct nla_policy devlink_dpipe_table_get_nl_policy[DEVLINK_ATTR_DPIPE_TABLE_NAME + 1] = { 207 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 208 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 209 [DEVLINK_ATTR_DPIPE_TABLE_NAME] = { .type = NLA_NUL_STRING, }, 210 }; 211 212 /* DEVLINK_CMD_DPIPE_ENTRIES_GET - do */ 213 static const struct nla_policy devlink_dpipe_entries_get_nl_policy[DEVLINK_ATTR_DPIPE_TABLE_NAME + 1] = { 214 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 215 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 216 [DEVLINK_ATTR_DPIPE_TABLE_NAME] = { .type = NLA_NUL_STRING, }, 217 }; 218 219 /* DEVLINK_CMD_DPIPE_HEADERS_GET - do */ 220 static const struct nla_policy devlink_dpipe_headers_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 221 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 222 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 223 }; 224 225 /* DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET - do */ 226 static const struct nla_policy devlink_dpipe_table_counters_set_nl_policy[DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED + 1] = { 227 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 228 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 229 [DEVLINK_ATTR_DPIPE_TABLE_NAME] = { .type = NLA_NUL_STRING, }, 230 [DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED] = { .type = NLA_U8, }, 231 }; 232 233 /* DEVLINK_CMD_RESOURCE_SET - do */ 234 static const struct nla_policy devlink_resource_set_nl_policy[DEVLINK_ATTR_RESOURCE_SIZE + 1] = { 235 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 236 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 237 [DEVLINK_ATTR_RESOURCE_ID] = { .type = NLA_U64, }, 238 [DEVLINK_ATTR_RESOURCE_SIZE] = { .type = NLA_U64, }, 239 }; 240 241 /* DEVLINK_CMD_RESOURCE_DUMP - do */ 242 static const struct nla_policy devlink_resource_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 243 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 244 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 245 }; 246 247 /* DEVLINK_CMD_RELOAD - do */ 248 static const struct nla_policy devlink_reload_nl_policy[DEVLINK_ATTR_RELOAD_LIMITS + 1] = { 249 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 250 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 251 [DEVLINK_ATTR_RELOAD_ACTION] = NLA_POLICY_RANGE(NLA_U8, 1, 2), 252 [DEVLINK_ATTR_RELOAD_LIMITS] = NLA_POLICY_BITFIELD32(6), 253 [DEVLINK_ATTR_NETNS_PID] = { .type = NLA_U32, }, 254 [DEVLINK_ATTR_NETNS_FD] = { .type = NLA_U32, }, 255 [DEVLINK_ATTR_NETNS_ID] = { .type = NLA_U32, }, 256 }; 257 258 /* DEVLINK_CMD_PARAM_GET - do */ 259 static const struct nla_policy devlink_param_get_do_nl_policy[DEVLINK_ATTR_PARAM_NAME + 1] = { 260 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 261 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 262 [DEVLINK_ATTR_PARAM_NAME] = { .type = NLA_NUL_STRING, }, 263 }; 264 265 /* DEVLINK_CMD_PARAM_GET - dump */ 266 static const struct nla_policy devlink_param_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 267 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 268 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 269 }; 270 271 /* DEVLINK_CMD_PARAM_SET - do */ 272 static const struct nla_policy devlink_param_set_nl_policy[DEVLINK_ATTR_PARAM_VALUE_CMODE + 1] = { 273 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 274 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 275 [DEVLINK_ATTR_PARAM_NAME] = { .type = NLA_NUL_STRING, }, 276 [DEVLINK_ATTR_PARAM_TYPE] = { .type = NLA_U8, }, 277 [DEVLINK_ATTR_PARAM_VALUE_CMODE] = NLA_POLICY_MAX(NLA_U8, 2), 278 }; 279 280 /* DEVLINK_CMD_REGION_GET - do */ 281 static const struct nla_policy devlink_region_get_do_nl_policy[DEVLINK_ATTR_REGION_NAME + 1] = { 282 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 283 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 284 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 285 [DEVLINK_ATTR_REGION_NAME] = { .type = NLA_NUL_STRING, }, 286 }; 287 288 /* DEVLINK_CMD_REGION_GET - dump */ 289 static const struct nla_policy devlink_region_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 290 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 291 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 292 }; 293 294 /* DEVLINK_CMD_REGION_NEW - do */ 295 static const struct nla_policy devlink_region_new_nl_policy[DEVLINK_ATTR_REGION_SNAPSHOT_ID + 1] = { 296 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 297 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 298 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 299 [DEVLINK_ATTR_REGION_NAME] = { .type = NLA_NUL_STRING, }, 300 [DEVLINK_ATTR_REGION_SNAPSHOT_ID] = { .type = NLA_U32, }, 301 }; 302 303 /* DEVLINK_CMD_REGION_DEL - do */ 304 static const struct nla_policy devlink_region_del_nl_policy[DEVLINK_ATTR_REGION_SNAPSHOT_ID + 1] = { 305 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 306 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 307 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 308 [DEVLINK_ATTR_REGION_NAME] = { .type = NLA_NUL_STRING, }, 309 [DEVLINK_ATTR_REGION_SNAPSHOT_ID] = { .type = NLA_U32, }, 310 }; 311 312 /* DEVLINK_CMD_REGION_READ - dump */ 313 static const struct nla_policy devlink_region_read_nl_policy[DEVLINK_ATTR_REGION_DIRECT + 1] = { 314 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 315 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 316 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 317 [DEVLINK_ATTR_REGION_NAME] = { .type = NLA_NUL_STRING, }, 318 [DEVLINK_ATTR_REGION_SNAPSHOT_ID] = { .type = NLA_U32, }, 319 [DEVLINK_ATTR_REGION_DIRECT] = { .type = NLA_FLAG, }, 320 [DEVLINK_ATTR_REGION_CHUNK_ADDR] = { .type = NLA_U64, }, 321 [DEVLINK_ATTR_REGION_CHUNK_LEN] = { .type = NLA_U64, }, 322 }; 323 324 /* DEVLINK_CMD_PORT_PARAM_GET - do */ 325 static const struct nla_policy devlink_port_param_get_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = { 326 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 327 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 328 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 329 }; 330 331 /* DEVLINK_CMD_PORT_PARAM_SET - do */ 332 static const struct nla_policy devlink_port_param_set_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = { 333 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 334 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 335 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 336 }; 337 338 /* DEVLINK_CMD_INFO_GET - do */ 339 static const struct nla_policy devlink_info_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 340 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 341 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 342 }; 343 344 /* DEVLINK_CMD_HEALTH_REPORTER_GET - do */ 345 static const struct nla_policy devlink_health_reporter_get_do_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = { 346 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 347 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 348 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 349 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 350 }; 351 352 /* DEVLINK_CMD_HEALTH_REPORTER_GET - dump */ 353 static const struct nla_policy devlink_health_reporter_get_dump_nl_policy[DEVLINK_ATTR_PORT_INDEX + 1] = { 354 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 355 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 356 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 357 }; 358 359 /* DEVLINK_CMD_HEALTH_REPORTER_SET - do */ 360 static const struct nla_policy devlink_health_reporter_set_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP + 1] = { 361 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 362 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 363 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 364 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 365 [DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD] = { .type = NLA_U64, }, 366 [DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER] = { .type = NLA_U8, }, 367 [DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP] = { .type = NLA_U8, }, 368 }; 369 370 /* DEVLINK_CMD_HEALTH_REPORTER_RECOVER - do */ 371 static const struct nla_policy devlink_health_reporter_recover_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = { 372 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 373 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 374 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 375 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 376 }; 377 378 /* DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE - do */ 379 static const struct nla_policy devlink_health_reporter_diagnose_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = { 380 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 381 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 382 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 383 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 384 }; 385 386 /* DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET - dump */ 387 static const struct nla_policy devlink_health_reporter_dump_get_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = { 388 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 389 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 390 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 391 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 392 }; 393 394 /* DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR - do */ 395 static const struct nla_policy devlink_health_reporter_dump_clear_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = { 396 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 397 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 398 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 399 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 400 }; 401 402 /* DEVLINK_CMD_FLASH_UPDATE - do */ 403 static const struct nla_policy devlink_flash_update_nl_policy[DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK + 1] = { 404 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 405 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 406 [DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME] = { .type = NLA_NUL_STRING, }, 407 [DEVLINK_ATTR_FLASH_UPDATE_COMPONENT] = { .type = NLA_NUL_STRING, }, 408 [DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK] = NLA_POLICY_BITFIELD32(3), 409 }; 410 411 /* DEVLINK_CMD_TRAP_GET - do */ 412 static const struct nla_policy devlink_trap_get_do_nl_policy[DEVLINK_ATTR_TRAP_NAME + 1] = { 413 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 414 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 415 [DEVLINK_ATTR_TRAP_NAME] = { .type = NLA_NUL_STRING, }, 416 }; 417 418 /* DEVLINK_CMD_TRAP_GET - dump */ 419 static const struct nla_policy devlink_trap_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 420 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 421 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 422 }; 423 424 /* DEVLINK_CMD_TRAP_SET - do */ 425 static const struct nla_policy devlink_trap_set_nl_policy[DEVLINK_ATTR_TRAP_ACTION + 1] = { 426 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 427 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 428 [DEVLINK_ATTR_TRAP_NAME] = { .type = NLA_NUL_STRING, }, 429 [DEVLINK_ATTR_TRAP_ACTION] = NLA_POLICY_MAX(NLA_U8, 2), 430 }; 431 432 /* DEVLINK_CMD_TRAP_GROUP_GET - do */ 433 static const struct nla_policy devlink_trap_group_get_do_nl_policy[DEVLINK_ATTR_TRAP_GROUP_NAME + 1] = { 434 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 435 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 436 [DEVLINK_ATTR_TRAP_GROUP_NAME] = { .type = NLA_NUL_STRING, }, 437 }; 438 439 /* DEVLINK_CMD_TRAP_GROUP_GET - dump */ 440 static const struct nla_policy devlink_trap_group_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 441 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 442 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 443 }; 444 445 /* DEVLINK_CMD_TRAP_GROUP_SET - do */ 446 static const struct nla_policy devlink_trap_group_set_nl_policy[DEVLINK_ATTR_TRAP_POLICER_ID + 1] = { 447 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 448 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 449 [DEVLINK_ATTR_TRAP_GROUP_NAME] = { .type = NLA_NUL_STRING, }, 450 [DEVLINK_ATTR_TRAP_ACTION] = NLA_POLICY_MAX(NLA_U8, 2), 451 [DEVLINK_ATTR_TRAP_POLICER_ID] = { .type = NLA_U32, }, 452 }; 453 454 /* DEVLINK_CMD_TRAP_POLICER_GET - do */ 455 static const struct nla_policy devlink_trap_policer_get_do_nl_policy[DEVLINK_ATTR_TRAP_POLICER_ID + 1] = { 456 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 457 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 458 [DEVLINK_ATTR_TRAP_POLICER_ID] = { .type = NLA_U32, }, 459 }; 460 461 /* DEVLINK_CMD_TRAP_POLICER_GET - dump */ 462 static const struct nla_policy devlink_trap_policer_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 463 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 464 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 465 }; 466 467 /* DEVLINK_CMD_TRAP_POLICER_SET - do */ 468 static const struct nla_policy devlink_trap_policer_set_nl_policy[DEVLINK_ATTR_TRAP_POLICER_BURST + 1] = { 469 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 470 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 471 [DEVLINK_ATTR_TRAP_POLICER_ID] = { .type = NLA_U32, }, 472 [DEVLINK_ATTR_TRAP_POLICER_RATE] = { .type = NLA_U64, }, 473 [DEVLINK_ATTR_TRAP_POLICER_BURST] = { .type = NLA_U64, }, 474 }; 475 476 /* DEVLINK_CMD_HEALTH_REPORTER_TEST - do */ 477 static const struct nla_policy devlink_health_reporter_test_nl_policy[DEVLINK_ATTR_HEALTH_REPORTER_NAME + 1] = { 478 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 479 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 480 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 481 [DEVLINK_ATTR_HEALTH_REPORTER_NAME] = { .type = NLA_NUL_STRING, }, 482 }; 483 484 /* DEVLINK_CMD_RATE_GET - do */ 485 static const struct nla_policy devlink_rate_get_do_nl_policy[DEVLINK_ATTR_RATE_NODE_NAME + 1] = { 486 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 487 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 488 [DEVLINK_ATTR_PORT_INDEX] = { .type = NLA_U32, }, 489 [DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING, }, 490 }; 491 492 /* DEVLINK_CMD_RATE_GET - dump */ 493 static const struct nla_policy devlink_rate_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 494 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 495 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 496 }; 497 498 /* DEVLINK_CMD_RATE_SET - do */ 499 static const struct nla_policy devlink_rate_set_nl_policy[DEVLINK_ATTR_RATE_TX_WEIGHT + 1] = { 500 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 501 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 502 [DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING, }, 503 [DEVLINK_ATTR_RATE_TX_SHARE] = { .type = NLA_U64, }, 504 [DEVLINK_ATTR_RATE_TX_MAX] = { .type = NLA_U64, }, 505 [DEVLINK_ATTR_RATE_TX_PRIORITY] = { .type = NLA_U32, }, 506 [DEVLINK_ATTR_RATE_TX_WEIGHT] = { .type = NLA_U32, }, 507 [DEVLINK_ATTR_RATE_PARENT_NODE_NAME] = { .type = NLA_NUL_STRING, }, 508 }; 509 510 /* DEVLINK_CMD_RATE_NEW - do */ 511 static const struct nla_policy devlink_rate_new_nl_policy[DEVLINK_ATTR_RATE_TX_WEIGHT + 1] = { 512 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 513 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 514 [DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING, }, 515 [DEVLINK_ATTR_RATE_TX_SHARE] = { .type = NLA_U64, }, 516 [DEVLINK_ATTR_RATE_TX_MAX] = { .type = NLA_U64, }, 517 [DEVLINK_ATTR_RATE_TX_PRIORITY] = { .type = NLA_U32, }, 518 [DEVLINK_ATTR_RATE_TX_WEIGHT] = { .type = NLA_U32, }, 519 [DEVLINK_ATTR_RATE_PARENT_NODE_NAME] = { .type = NLA_NUL_STRING, }, 520 }; 521 522 /* DEVLINK_CMD_RATE_DEL - do */ 523 static const struct nla_policy devlink_rate_del_nl_policy[DEVLINK_ATTR_RATE_NODE_NAME + 1] = { 524 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 525 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 526 [DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING, }, 527 }; 528 529 /* DEVLINK_CMD_LINECARD_GET - do */ 530 static const struct nla_policy devlink_linecard_get_do_nl_policy[DEVLINK_ATTR_LINECARD_INDEX + 1] = { 531 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 532 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 533 [DEVLINK_ATTR_LINECARD_INDEX] = { .type = NLA_U32, }, 534 }; 535 536 /* DEVLINK_CMD_LINECARD_GET - dump */ 537 static const struct nla_policy devlink_linecard_get_dump_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 538 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 539 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 540 }; 541 542 /* DEVLINK_CMD_LINECARD_SET - do */ 543 static const struct nla_policy devlink_linecard_set_nl_policy[DEVLINK_ATTR_LINECARD_TYPE + 1] = { 544 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 545 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 546 [DEVLINK_ATTR_LINECARD_INDEX] = { .type = NLA_U32, }, 547 [DEVLINK_ATTR_LINECARD_TYPE] = { .type = NLA_NUL_STRING, }, 548 }; 549 550 /* DEVLINK_CMD_SELFTESTS_GET - do */ 551 static const struct nla_policy devlink_selftests_get_nl_policy[DEVLINK_ATTR_DEV_NAME + 1] = { 552 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 553 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 554 }; 555 556 /* DEVLINK_CMD_SELFTESTS_RUN - do */ 557 static const struct nla_policy devlink_selftests_run_nl_policy[DEVLINK_ATTR_SELFTESTS + 1] = { 558 [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, 559 [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, 560 [DEVLINK_ATTR_SELFTESTS] = NLA_POLICY_NESTED(devlink_dl_selftest_id_nl_policy), 561 }; 562 563 /* Ops table for devlink */ 564 const struct genl_split_ops devlink_nl_ops[73] = { 565 { 566 .cmd = DEVLINK_CMD_GET, 567 .validate = GENL_DONT_VALIDATE_STRICT, 568 .pre_doit = devlink_nl_pre_doit, 569 .doit = devlink_nl_get_doit, 570 .post_doit = devlink_nl_post_doit, 571 .policy = devlink_get_nl_policy, 572 .maxattr = DEVLINK_ATTR_DEV_NAME, 573 .flags = GENL_CMD_CAP_DO, 574 }, 575 { 576 .cmd = DEVLINK_CMD_GET, 577 .validate = GENL_DONT_VALIDATE_DUMP, 578 .dumpit = devlink_nl_get_dumpit, 579 .flags = GENL_CMD_CAP_DUMP, 580 }, 581 { 582 .cmd = DEVLINK_CMD_PORT_GET, 583 .validate = GENL_DONT_VALIDATE_STRICT, 584 .pre_doit = devlink_nl_pre_doit_port, 585 .doit = devlink_nl_port_get_doit, 586 .post_doit = devlink_nl_post_doit, 587 .policy = devlink_port_get_do_nl_policy, 588 .maxattr = DEVLINK_ATTR_PORT_INDEX, 589 .flags = GENL_CMD_CAP_DO, 590 }, 591 { 592 .cmd = DEVLINK_CMD_PORT_GET, 593 .dumpit = devlink_nl_port_get_dumpit, 594 .policy = devlink_port_get_dump_nl_policy, 595 .maxattr = DEVLINK_ATTR_DEV_NAME, 596 .flags = GENL_CMD_CAP_DUMP, 597 }, 598 { 599 .cmd = DEVLINK_CMD_PORT_SET, 600 .validate = GENL_DONT_VALIDATE_STRICT, 601 .pre_doit = devlink_nl_pre_doit_port, 602 .doit = devlink_nl_port_set_doit, 603 .post_doit = devlink_nl_post_doit, 604 .policy = devlink_port_set_nl_policy, 605 .maxattr = DEVLINK_ATTR_PORT_FUNCTION, 606 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 607 }, 608 { 609 .cmd = DEVLINK_CMD_PORT_NEW, 610 .validate = GENL_DONT_VALIDATE_STRICT, 611 .pre_doit = devlink_nl_pre_doit, 612 .doit = devlink_nl_port_new_doit, 613 .post_doit = devlink_nl_post_doit, 614 .policy = devlink_port_new_nl_policy, 615 .maxattr = DEVLINK_ATTR_PORT_PCI_SF_NUMBER, 616 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 617 }, 618 { 619 .cmd = DEVLINK_CMD_PORT_DEL, 620 .validate = GENL_DONT_VALIDATE_STRICT, 621 .pre_doit = devlink_nl_pre_doit_port, 622 .doit = devlink_nl_port_del_doit, 623 .post_doit = devlink_nl_post_doit, 624 .policy = devlink_port_del_nl_policy, 625 .maxattr = DEVLINK_ATTR_PORT_INDEX, 626 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 627 }, 628 { 629 .cmd = DEVLINK_CMD_PORT_SPLIT, 630 .validate = GENL_DONT_VALIDATE_STRICT, 631 .pre_doit = devlink_nl_pre_doit_port, 632 .doit = devlink_nl_port_split_doit, 633 .post_doit = devlink_nl_post_doit, 634 .policy = devlink_port_split_nl_policy, 635 .maxattr = DEVLINK_ATTR_PORT_SPLIT_COUNT, 636 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 637 }, 638 { 639 .cmd = DEVLINK_CMD_PORT_UNSPLIT, 640 .validate = GENL_DONT_VALIDATE_STRICT, 641 .pre_doit = devlink_nl_pre_doit_port, 642 .doit = devlink_nl_port_unsplit_doit, 643 .post_doit = devlink_nl_post_doit, 644 .policy = devlink_port_unsplit_nl_policy, 645 .maxattr = DEVLINK_ATTR_PORT_INDEX, 646 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 647 }, 648 { 649 .cmd = DEVLINK_CMD_SB_GET, 650 .validate = GENL_DONT_VALIDATE_STRICT, 651 .pre_doit = devlink_nl_pre_doit, 652 .doit = devlink_nl_sb_get_doit, 653 .post_doit = devlink_nl_post_doit, 654 .policy = devlink_sb_get_do_nl_policy, 655 .maxattr = DEVLINK_ATTR_SB_INDEX, 656 .flags = GENL_CMD_CAP_DO, 657 }, 658 { 659 .cmd = DEVLINK_CMD_SB_GET, 660 .dumpit = devlink_nl_sb_get_dumpit, 661 .policy = devlink_sb_get_dump_nl_policy, 662 .maxattr = DEVLINK_ATTR_DEV_NAME, 663 .flags = GENL_CMD_CAP_DUMP, 664 }, 665 { 666 .cmd = DEVLINK_CMD_SB_POOL_GET, 667 .validate = GENL_DONT_VALIDATE_STRICT, 668 .pre_doit = devlink_nl_pre_doit, 669 .doit = devlink_nl_sb_pool_get_doit, 670 .post_doit = devlink_nl_post_doit, 671 .policy = devlink_sb_pool_get_do_nl_policy, 672 .maxattr = DEVLINK_ATTR_SB_POOL_INDEX, 673 .flags = GENL_CMD_CAP_DO, 674 }, 675 { 676 .cmd = DEVLINK_CMD_SB_POOL_GET, 677 .dumpit = devlink_nl_sb_pool_get_dumpit, 678 .policy = devlink_sb_pool_get_dump_nl_policy, 679 .maxattr = DEVLINK_ATTR_DEV_NAME, 680 .flags = GENL_CMD_CAP_DUMP, 681 }, 682 { 683 .cmd = DEVLINK_CMD_SB_POOL_SET, 684 .validate = GENL_DONT_VALIDATE_STRICT, 685 .pre_doit = devlink_nl_pre_doit, 686 .doit = devlink_nl_sb_pool_set_doit, 687 .post_doit = devlink_nl_post_doit, 688 .policy = devlink_sb_pool_set_nl_policy, 689 .maxattr = DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE, 690 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 691 }, 692 { 693 .cmd = DEVLINK_CMD_SB_PORT_POOL_GET, 694 .validate = GENL_DONT_VALIDATE_STRICT, 695 .pre_doit = devlink_nl_pre_doit_port, 696 .doit = devlink_nl_sb_port_pool_get_doit, 697 .post_doit = devlink_nl_post_doit, 698 .policy = devlink_sb_port_pool_get_do_nl_policy, 699 .maxattr = DEVLINK_ATTR_SB_POOL_INDEX, 700 .flags = GENL_CMD_CAP_DO, 701 }, 702 { 703 .cmd = DEVLINK_CMD_SB_PORT_POOL_GET, 704 .dumpit = devlink_nl_sb_port_pool_get_dumpit, 705 .policy = devlink_sb_port_pool_get_dump_nl_policy, 706 .maxattr = DEVLINK_ATTR_DEV_NAME, 707 .flags = GENL_CMD_CAP_DUMP, 708 }, 709 { 710 .cmd = DEVLINK_CMD_SB_PORT_POOL_SET, 711 .validate = GENL_DONT_VALIDATE_STRICT, 712 .pre_doit = devlink_nl_pre_doit_port, 713 .doit = devlink_nl_sb_port_pool_set_doit, 714 .post_doit = devlink_nl_post_doit, 715 .policy = devlink_sb_port_pool_set_nl_policy, 716 .maxattr = DEVLINK_ATTR_SB_THRESHOLD, 717 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 718 }, 719 { 720 .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET, 721 .validate = GENL_DONT_VALIDATE_STRICT, 722 .pre_doit = devlink_nl_pre_doit_port, 723 .doit = devlink_nl_sb_tc_pool_bind_get_doit, 724 .post_doit = devlink_nl_post_doit, 725 .policy = devlink_sb_tc_pool_bind_get_do_nl_policy, 726 .maxattr = DEVLINK_ATTR_SB_TC_INDEX, 727 .flags = GENL_CMD_CAP_DO, 728 }, 729 { 730 .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET, 731 .dumpit = devlink_nl_sb_tc_pool_bind_get_dumpit, 732 .policy = devlink_sb_tc_pool_bind_get_dump_nl_policy, 733 .maxattr = DEVLINK_ATTR_DEV_NAME, 734 .flags = GENL_CMD_CAP_DUMP, 735 }, 736 { 737 .cmd = DEVLINK_CMD_SB_TC_POOL_BIND_SET, 738 .validate = GENL_DONT_VALIDATE_STRICT, 739 .pre_doit = devlink_nl_pre_doit_port, 740 .doit = devlink_nl_sb_tc_pool_bind_set_doit, 741 .post_doit = devlink_nl_post_doit, 742 .policy = devlink_sb_tc_pool_bind_set_nl_policy, 743 .maxattr = DEVLINK_ATTR_SB_TC_INDEX, 744 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 745 }, 746 { 747 .cmd = DEVLINK_CMD_SB_OCC_SNAPSHOT, 748 .validate = GENL_DONT_VALIDATE_STRICT, 749 .pre_doit = devlink_nl_pre_doit, 750 .doit = devlink_nl_sb_occ_snapshot_doit, 751 .post_doit = devlink_nl_post_doit, 752 .policy = devlink_sb_occ_snapshot_nl_policy, 753 .maxattr = DEVLINK_ATTR_SB_INDEX, 754 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 755 }, 756 { 757 .cmd = DEVLINK_CMD_SB_OCC_MAX_CLEAR, 758 .validate = GENL_DONT_VALIDATE_STRICT, 759 .pre_doit = devlink_nl_pre_doit, 760 .doit = devlink_nl_sb_occ_max_clear_doit, 761 .post_doit = devlink_nl_post_doit, 762 .policy = devlink_sb_occ_max_clear_nl_policy, 763 .maxattr = DEVLINK_ATTR_SB_INDEX, 764 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 765 }, 766 { 767 .cmd = DEVLINK_CMD_ESWITCH_GET, 768 .validate = GENL_DONT_VALIDATE_STRICT, 769 .pre_doit = devlink_nl_pre_doit, 770 .doit = devlink_nl_eswitch_get_doit, 771 .post_doit = devlink_nl_post_doit, 772 .policy = devlink_eswitch_get_nl_policy, 773 .maxattr = DEVLINK_ATTR_DEV_NAME, 774 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 775 }, 776 { 777 .cmd = DEVLINK_CMD_ESWITCH_SET, 778 .validate = GENL_DONT_VALIDATE_STRICT, 779 .pre_doit = devlink_nl_pre_doit, 780 .doit = devlink_nl_eswitch_set_doit, 781 .post_doit = devlink_nl_post_doit, 782 .policy = devlink_eswitch_set_nl_policy, 783 .maxattr = DEVLINK_ATTR_ESWITCH_ENCAP_MODE, 784 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 785 }, 786 { 787 .cmd = DEVLINK_CMD_DPIPE_TABLE_GET, 788 .validate = GENL_DONT_VALIDATE_STRICT, 789 .pre_doit = devlink_nl_pre_doit, 790 .doit = devlink_nl_dpipe_table_get_doit, 791 .post_doit = devlink_nl_post_doit, 792 .policy = devlink_dpipe_table_get_nl_policy, 793 .maxattr = DEVLINK_ATTR_DPIPE_TABLE_NAME, 794 .flags = GENL_CMD_CAP_DO, 795 }, 796 { 797 .cmd = DEVLINK_CMD_DPIPE_ENTRIES_GET, 798 .validate = GENL_DONT_VALIDATE_STRICT, 799 .pre_doit = devlink_nl_pre_doit, 800 .doit = devlink_nl_dpipe_entries_get_doit, 801 .post_doit = devlink_nl_post_doit, 802 .policy = devlink_dpipe_entries_get_nl_policy, 803 .maxattr = DEVLINK_ATTR_DPIPE_TABLE_NAME, 804 .flags = GENL_CMD_CAP_DO, 805 }, 806 { 807 .cmd = DEVLINK_CMD_DPIPE_HEADERS_GET, 808 .validate = GENL_DONT_VALIDATE_STRICT, 809 .pre_doit = devlink_nl_pre_doit, 810 .doit = devlink_nl_dpipe_headers_get_doit, 811 .post_doit = devlink_nl_post_doit, 812 .policy = devlink_dpipe_headers_get_nl_policy, 813 .maxattr = DEVLINK_ATTR_DEV_NAME, 814 .flags = GENL_CMD_CAP_DO, 815 }, 816 { 817 .cmd = DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, 818 .validate = GENL_DONT_VALIDATE_STRICT, 819 .pre_doit = devlink_nl_pre_doit, 820 .doit = devlink_nl_dpipe_table_counters_set_doit, 821 .post_doit = devlink_nl_post_doit, 822 .policy = devlink_dpipe_table_counters_set_nl_policy, 823 .maxattr = DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED, 824 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 825 }, 826 { 827 .cmd = DEVLINK_CMD_RESOURCE_SET, 828 .validate = GENL_DONT_VALIDATE_STRICT, 829 .pre_doit = devlink_nl_pre_doit, 830 .doit = devlink_nl_resource_set_doit, 831 .post_doit = devlink_nl_post_doit, 832 .policy = devlink_resource_set_nl_policy, 833 .maxattr = DEVLINK_ATTR_RESOURCE_SIZE, 834 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 835 }, 836 { 837 .cmd = DEVLINK_CMD_RESOURCE_DUMP, 838 .validate = GENL_DONT_VALIDATE_STRICT, 839 .pre_doit = devlink_nl_pre_doit, 840 .doit = devlink_nl_resource_dump_doit, 841 .post_doit = devlink_nl_post_doit, 842 .policy = devlink_resource_dump_nl_policy, 843 .maxattr = DEVLINK_ATTR_DEV_NAME, 844 .flags = GENL_CMD_CAP_DO, 845 }, 846 { 847 .cmd = DEVLINK_CMD_RELOAD, 848 .validate = GENL_DONT_VALIDATE_STRICT, 849 .pre_doit = devlink_nl_pre_doit, 850 .doit = devlink_nl_reload_doit, 851 .post_doit = devlink_nl_post_doit, 852 .policy = devlink_reload_nl_policy, 853 .maxattr = DEVLINK_ATTR_RELOAD_LIMITS, 854 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 855 }, 856 { 857 .cmd = DEVLINK_CMD_PARAM_GET, 858 .validate = GENL_DONT_VALIDATE_STRICT, 859 .pre_doit = devlink_nl_pre_doit, 860 .doit = devlink_nl_param_get_doit, 861 .post_doit = devlink_nl_post_doit, 862 .policy = devlink_param_get_do_nl_policy, 863 .maxattr = DEVLINK_ATTR_PARAM_NAME, 864 .flags = GENL_CMD_CAP_DO, 865 }, 866 { 867 .cmd = DEVLINK_CMD_PARAM_GET, 868 .dumpit = devlink_nl_param_get_dumpit, 869 .policy = devlink_param_get_dump_nl_policy, 870 .maxattr = DEVLINK_ATTR_DEV_NAME, 871 .flags = GENL_CMD_CAP_DUMP, 872 }, 873 { 874 .cmd = DEVLINK_CMD_PARAM_SET, 875 .validate = GENL_DONT_VALIDATE_STRICT, 876 .pre_doit = devlink_nl_pre_doit, 877 .doit = devlink_nl_param_set_doit, 878 .post_doit = devlink_nl_post_doit, 879 .policy = devlink_param_set_nl_policy, 880 .maxattr = DEVLINK_ATTR_PARAM_VALUE_CMODE, 881 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 882 }, 883 { 884 .cmd = DEVLINK_CMD_REGION_GET, 885 .validate = GENL_DONT_VALIDATE_STRICT, 886 .pre_doit = devlink_nl_pre_doit_port_optional, 887 .doit = devlink_nl_region_get_doit, 888 .post_doit = devlink_nl_post_doit, 889 .policy = devlink_region_get_do_nl_policy, 890 .maxattr = DEVLINK_ATTR_REGION_NAME, 891 .flags = GENL_CMD_CAP_DO, 892 }, 893 { 894 .cmd = DEVLINK_CMD_REGION_GET, 895 .dumpit = devlink_nl_region_get_dumpit, 896 .policy = devlink_region_get_dump_nl_policy, 897 .maxattr = DEVLINK_ATTR_DEV_NAME, 898 .flags = GENL_CMD_CAP_DUMP, 899 }, 900 { 901 .cmd = DEVLINK_CMD_REGION_NEW, 902 .validate = GENL_DONT_VALIDATE_STRICT, 903 .pre_doit = devlink_nl_pre_doit_port_optional, 904 .doit = devlink_nl_region_new_doit, 905 .post_doit = devlink_nl_post_doit, 906 .policy = devlink_region_new_nl_policy, 907 .maxattr = DEVLINK_ATTR_REGION_SNAPSHOT_ID, 908 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 909 }, 910 { 911 .cmd = DEVLINK_CMD_REGION_DEL, 912 .validate = GENL_DONT_VALIDATE_STRICT, 913 .pre_doit = devlink_nl_pre_doit_port_optional, 914 .doit = devlink_nl_region_del_doit, 915 .post_doit = devlink_nl_post_doit, 916 .policy = devlink_region_del_nl_policy, 917 .maxattr = DEVLINK_ATTR_REGION_SNAPSHOT_ID, 918 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 919 }, 920 { 921 .cmd = DEVLINK_CMD_REGION_READ, 922 .validate = GENL_DONT_VALIDATE_DUMP_STRICT, 923 .dumpit = devlink_nl_region_read_dumpit, 924 .policy = devlink_region_read_nl_policy, 925 .maxattr = DEVLINK_ATTR_REGION_DIRECT, 926 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP, 927 }, 928 { 929 .cmd = DEVLINK_CMD_PORT_PARAM_GET, 930 .validate = GENL_DONT_VALIDATE_STRICT, 931 .pre_doit = devlink_nl_pre_doit_port, 932 .doit = devlink_nl_port_param_get_doit, 933 .post_doit = devlink_nl_post_doit, 934 .policy = devlink_port_param_get_nl_policy, 935 .maxattr = DEVLINK_ATTR_PORT_INDEX, 936 .flags = GENL_CMD_CAP_DO, 937 }, 938 { 939 .cmd = DEVLINK_CMD_PORT_PARAM_GET, 940 .validate = GENL_DONT_VALIDATE_DUMP_STRICT, 941 .dumpit = devlink_nl_port_param_get_dumpit, 942 .flags = GENL_CMD_CAP_DUMP, 943 }, 944 { 945 .cmd = DEVLINK_CMD_PORT_PARAM_SET, 946 .validate = GENL_DONT_VALIDATE_STRICT, 947 .pre_doit = devlink_nl_pre_doit_port, 948 .doit = devlink_nl_port_param_set_doit, 949 .post_doit = devlink_nl_post_doit, 950 .policy = devlink_port_param_set_nl_policy, 951 .maxattr = DEVLINK_ATTR_PORT_INDEX, 952 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 953 }, 954 { 955 .cmd = DEVLINK_CMD_INFO_GET, 956 .validate = GENL_DONT_VALIDATE_STRICT, 957 .pre_doit = devlink_nl_pre_doit, 958 .doit = devlink_nl_info_get_doit, 959 .post_doit = devlink_nl_post_doit, 960 .policy = devlink_info_get_nl_policy, 961 .maxattr = DEVLINK_ATTR_DEV_NAME, 962 .flags = GENL_CMD_CAP_DO, 963 }, 964 { 965 .cmd = DEVLINK_CMD_INFO_GET, 966 .validate = GENL_DONT_VALIDATE_DUMP, 967 .dumpit = devlink_nl_info_get_dumpit, 968 .flags = GENL_CMD_CAP_DUMP, 969 }, 970 { 971 .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET, 972 .validate = GENL_DONT_VALIDATE_STRICT, 973 .pre_doit = devlink_nl_pre_doit_port_optional, 974 .doit = devlink_nl_health_reporter_get_doit, 975 .post_doit = devlink_nl_post_doit, 976 .policy = devlink_health_reporter_get_do_nl_policy, 977 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_NAME, 978 .flags = GENL_CMD_CAP_DO, 979 }, 980 { 981 .cmd = DEVLINK_CMD_HEALTH_REPORTER_GET, 982 .dumpit = devlink_nl_health_reporter_get_dumpit, 983 .policy = devlink_health_reporter_get_dump_nl_policy, 984 .maxattr = DEVLINK_ATTR_PORT_INDEX, 985 .flags = GENL_CMD_CAP_DUMP, 986 }, 987 { 988 .cmd = DEVLINK_CMD_HEALTH_REPORTER_SET, 989 .validate = GENL_DONT_VALIDATE_STRICT, 990 .pre_doit = devlink_nl_pre_doit_port_optional, 991 .doit = devlink_nl_health_reporter_set_doit, 992 .post_doit = devlink_nl_post_doit, 993 .policy = devlink_health_reporter_set_nl_policy, 994 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP, 995 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 996 }, 997 { 998 .cmd = DEVLINK_CMD_HEALTH_REPORTER_RECOVER, 999 .validate = GENL_DONT_VALIDATE_STRICT, 1000 .pre_doit = devlink_nl_pre_doit_port_optional, 1001 .doit = devlink_nl_health_reporter_recover_doit, 1002 .post_doit = devlink_nl_post_doit, 1003 .policy = devlink_health_reporter_recover_nl_policy, 1004 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_NAME, 1005 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1006 }, 1007 { 1008 .cmd = DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE, 1009 .validate = GENL_DONT_VALIDATE_STRICT, 1010 .pre_doit = devlink_nl_pre_doit_port_optional, 1011 .doit = devlink_nl_health_reporter_diagnose_doit, 1012 .post_doit = devlink_nl_post_doit, 1013 .policy = devlink_health_reporter_diagnose_nl_policy, 1014 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_NAME, 1015 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1016 }, 1017 { 1018 .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, 1019 .validate = GENL_DONT_VALIDATE_DUMP_STRICT, 1020 .dumpit = devlink_nl_health_reporter_dump_get_dumpit, 1021 .policy = devlink_health_reporter_dump_get_nl_policy, 1022 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_NAME, 1023 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP, 1024 }, 1025 { 1026 .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR, 1027 .validate = GENL_DONT_VALIDATE_STRICT, 1028 .pre_doit = devlink_nl_pre_doit_port_optional, 1029 .doit = devlink_nl_health_reporter_dump_clear_doit, 1030 .post_doit = devlink_nl_post_doit, 1031 .policy = devlink_health_reporter_dump_clear_nl_policy, 1032 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_NAME, 1033 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1034 }, 1035 { 1036 .cmd = DEVLINK_CMD_FLASH_UPDATE, 1037 .validate = GENL_DONT_VALIDATE_STRICT, 1038 .pre_doit = devlink_nl_pre_doit, 1039 .doit = devlink_nl_flash_update_doit, 1040 .post_doit = devlink_nl_post_doit, 1041 .policy = devlink_flash_update_nl_policy, 1042 .maxattr = DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK, 1043 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1044 }, 1045 { 1046 .cmd = DEVLINK_CMD_TRAP_GET, 1047 .validate = GENL_DONT_VALIDATE_STRICT, 1048 .pre_doit = devlink_nl_pre_doit, 1049 .doit = devlink_nl_trap_get_doit, 1050 .post_doit = devlink_nl_post_doit, 1051 .policy = devlink_trap_get_do_nl_policy, 1052 .maxattr = DEVLINK_ATTR_TRAP_NAME, 1053 .flags = GENL_CMD_CAP_DO, 1054 }, 1055 { 1056 .cmd = DEVLINK_CMD_TRAP_GET, 1057 .dumpit = devlink_nl_trap_get_dumpit, 1058 .policy = devlink_trap_get_dump_nl_policy, 1059 .maxattr = DEVLINK_ATTR_DEV_NAME, 1060 .flags = GENL_CMD_CAP_DUMP, 1061 }, 1062 { 1063 .cmd = DEVLINK_CMD_TRAP_SET, 1064 .validate = GENL_DONT_VALIDATE_STRICT, 1065 .pre_doit = devlink_nl_pre_doit, 1066 .doit = devlink_nl_trap_set_doit, 1067 .post_doit = devlink_nl_post_doit, 1068 .policy = devlink_trap_set_nl_policy, 1069 .maxattr = DEVLINK_ATTR_TRAP_ACTION, 1070 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1071 }, 1072 { 1073 .cmd = DEVLINK_CMD_TRAP_GROUP_GET, 1074 .validate = GENL_DONT_VALIDATE_STRICT, 1075 .pre_doit = devlink_nl_pre_doit, 1076 .doit = devlink_nl_trap_group_get_doit, 1077 .post_doit = devlink_nl_post_doit, 1078 .policy = devlink_trap_group_get_do_nl_policy, 1079 .maxattr = DEVLINK_ATTR_TRAP_GROUP_NAME, 1080 .flags = GENL_CMD_CAP_DO, 1081 }, 1082 { 1083 .cmd = DEVLINK_CMD_TRAP_GROUP_GET, 1084 .dumpit = devlink_nl_trap_group_get_dumpit, 1085 .policy = devlink_trap_group_get_dump_nl_policy, 1086 .maxattr = DEVLINK_ATTR_DEV_NAME, 1087 .flags = GENL_CMD_CAP_DUMP, 1088 }, 1089 { 1090 .cmd = DEVLINK_CMD_TRAP_GROUP_SET, 1091 .validate = GENL_DONT_VALIDATE_STRICT, 1092 .pre_doit = devlink_nl_pre_doit, 1093 .doit = devlink_nl_trap_group_set_doit, 1094 .post_doit = devlink_nl_post_doit, 1095 .policy = devlink_trap_group_set_nl_policy, 1096 .maxattr = DEVLINK_ATTR_TRAP_POLICER_ID, 1097 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1098 }, 1099 { 1100 .cmd = DEVLINK_CMD_TRAP_POLICER_GET, 1101 .validate = GENL_DONT_VALIDATE_STRICT, 1102 .pre_doit = devlink_nl_pre_doit, 1103 .doit = devlink_nl_trap_policer_get_doit, 1104 .post_doit = devlink_nl_post_doit, 1105 .policy = devlink_trap_policer_get_do_nl_policy, 1106 .maxattr = DEVLINK_ATTR_TRAP_POLICER_ID, 1107 .flags = GENL_CMD_CAP_DO, 1108 }, 1109 { 1110 .cmd = DEVLINK_CMD_TRAP_POLICER_GET, 1111 .dumpit = devlink_nl_trap_policer_get_dumpit, 1112 .policy = devlink_trap_policer_get_dump_nl_policy, 1113 .maxattr = DEVLINK_ATTR_DEV_NAME, 1114 .flags = GENL_CMD_CAP_DUMP, 1115 }, 1116 { 1117 .cmd = DEVLINK_CMD_TRAP_POLICER_SET, 1118 .validate = GENL_DONT_VALIDATE_STRICT, 1119 .pre_doit = devlink_nl_pre_doit, 1120 .doit = devlink_nl_trap_policer_set_doit, 1121 .post_doit = devlink_nl_post_doit, 1122 .policy = devlink_trap_policer_set_nl_policy, 1123 .maxattr = DEVLINK_ATTR_TRAP_POLICER_BURST, 1124 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1125 }, 1126 { 1127 .cmd = DEVLINK_CMD_HEALTH_REPORTER_TEST, 1128 .validate = GENL_DONT_VALIDATE_STRICT, 1129 .pre_doit = devlink_nl_pre_doit_port_optional, 1130 .doit = devlink_nl_health_reporter_test_doit, 1131 .post_doit = devlink_nl_post_doit, 1132 .policy = devlink_health_reporter_test_nl_policy, 1133 .maxattr = DEVLINK_ATTR_HEALTH_REPORTER_NAME, 1134 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1135 }, 1136 { 1137 .cmd = DEVLINK_CMD_RATE_GET, 1138 .validate = GENL_DONT_VALIDATE_STRICT, 1139 .pre_doit = devlink_nl_pre_doit, 1140 .doit = devlink_nl_rate_get_doit, 1141 .post_doit = devlink_nl_post_doit, 1142 .policy = devlink_rate_get_do_nl_policy, 1143 .maxattr = DEVLINK_ATTR_RATE_NODE_NAME, 1144 .flags = GENL_CMD_CAP_DO, 1145 }, 1146 { 1147 .cmd = DEVLINK_CMD_RATE_GET, 1148 .dumpit = devlink_nl_rate_get_dumpit, 1149 .policy = devlink_rate_get_dump_nl_policy, 1150 .maxattr = DEVLINK_ATTR_DEV_NAME, 1151 .flags = GENL_CMD_CAP_DUMP, 1152 }, 1153 { 1154 .cmd = DEVLINK_CMD_RATE_SET, 1155 .validate = GENL_DONT_VALIDATE_STRICT, 1156 .pre_doit = devlink_nl_pre_doit, 1157 .doit = devlink_nl_rate_set_doit, 1158 .post_doit = devlink_nl_post_doit, 1159 .policy = devlink_rate_set_nl_policy, 1160 .maxattr = DEVLINK_ATTR_RATE_TX_WEIGHT, 1161 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1162 }, 1163 { 1164 .cmd = DEVLINK_CMD_RATE_NEW, 1165 .validate = GENL_DONT_VALIDATE_STRICT, 1166 .pre_doit = devlink_nl_pre_doit, 1167 .doit = devlink_nl_rate_new_doit, 1168 .post_doit = devlink_nl_post_doit, 1169 .policy = devlink_rate_new_nl_policy, 1170 .maxattr = DEVLINK_ATTR_RATE_TX_WEIGHT, 1171 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1172 }, 1173 { 1174 .cmd = DEVLINK_CMD_RATE_DEL, 1175 .validate = GENL_DONT_VALIDATE_STRICT, 1176 .pre_doit = devlink_nl_pre_doit, 1177 .doit = devlink_nl_rate_del_doit, 1178 .post_doit = devlink_nl_post_doit, 1179 .policy = devlink_rate_del_nl_policy, 1180 .maxattr = DEVLINK_ATTR_RATE_NODE_NAME, 1181 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1182 }, 1183 { 1184 .cmd = DEVLINK_CMD_LINECARD_GET, 1185 .validate = GENL_DONT_VALIDATE_STRICT, 1186 .pre_doit = devlink_nl_pre_doit, 1187 .doit = devlink_nl_linecard_get_doit, 1188 .post_doit = devlink_nl_post_doit, 1189 .policy = devlink_linecard_get_do_nl_policy, 1190 .maxattr = DEVLINK_ATTR_LINECARD_INDEX, 1191 .flags = GENL_CMD_CAP_DO, 1192 }, 1193 { 1194 .cmd = DEVLINK_CMD_LINECARD_GET, 1195 .dumpit = devlink_nl_linecard_get_dumpit, 1196 .policy = devlink_linecard_get_dump_nl_policy, 1197 .maxattr = DEVLINK_ATTR_DEV_NAME, 1198 .flags = GENL_CMD_CAP_DUMP, 1199 }, 1200 { 1201 .cmd = DEVLINK_CMD_LINECARD_SET, 1202 .validate = GENL_DONT_VALIDATE_STRICT, 1203 .pre_doit = devlink_nl_pre_doit, 1204 .doit = devlink_nl_linecard_set_doit, 1205 .post_doit = devlink_nl_post_doit, 1206 .policy = devlink_linecard_set_nl_policy, 1207 .maxattr = DEVLINK_ATTR_LINECARD_TYPE, 1208 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1209 }, 1210 { 1211 .cmd = DEVLINK_CMD_SELFTESTS_GET, 1212 .validate = GENL_DONT_VALIDATE_STRICT, 1213 .pre_doit = devlink_nl_pre_doit, 1214 .doit = devlink_nl_selftests_get_doit, 1215 .post_doit = devlink_nl_post_doit, 1216 .policy = devlink_selftests_get_nl_policy, 1217 .maxattr = DEVLINK_ATTR_DEV_NAME, 1218 .flags = GENL_CMD_CAP_DO, 1219 }, 1220 { 1221 .cmd = DEVLINK_CMD_SELFTESTS_GET, 1222 .validate = GENL_DONT_VALIDATE_DUMP, 1223 .dumpit = devlink_nl_selftests_get_dumpit, 1224 .flags = GENL_CMD_CAP_DUMP, 1225 }, 1226 { 1227 .cmd = DEVLINK_CMD_SELFTESTS_RUN, 1228 .validate = GENL_DONT_VALIDATE_STRICT, 1229 .pre_doit = devlink_nl_pre_doit, 1230 .doit = devlink_nl_selftests_run_doit, 1231 .post_doit = devlink_nl_post_doit, 1232 .policy = devlink_selftests_run_nl_policy, 1233 .maxattr = DEVLINK_ATTR_SELFTESTS, 1234 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 1235 }, 1236 }; 1237