Lines Matching refs:trap
64 const struct devlink_trap *trap; member
91 if (!strcmp(trap_item->trap->name, name)) in devlink_trap_item_lookup()
132 const struct devlink_trap *trap) in devlink_trap_metadata_put() argument
140 if ((trap->metadata_cap & DEVLINK_TRAP_METADATA_TYPE_F_IN_PORT) && in devlink_trap_metadata_put()
143 if ((trap->metadata_cap & DEVLINK_TRAP_METADATA_TYPE_F_FA_COOKIE) && in devlink_trap_metadata_put()
221 trap_item->trap, in devlink_trap_stats_put()
277 if (nla_put_string(msg, DEVLINK_ATTR_TRAP_NAME, trap_item->trap->name)) in devlink_nl_trap_fill()
280 if (nla_put_u8(msg, DEVLINK_ATTR_TRAP_TYPE, trap_item->trap->type)) in devlink_nl_trap_fill()
283 if (trap_item->trap->generic && in devlink_nl_trap_fill()
290 err = devlink_trap_metadata_put(msg, trap_item->trap); in devlink_nl_trap_fill()
382 trap_item->trap->type != DEVLINK_TRAP_TYPE_DROP) { in __devlink_trap_action_set()
387 err = devlink->ops->trap_action_set(devlink, trap_item->trap, in __devlink_trap_action_set()
605 trap_item->trap->type != DEVLINK_TRAP_TYPE_DROP) in __devlink_trap_group_action_set()
1091 static int devlink_trap_generic_verify(const struct devlink_trap *trap) in devlink_trap_generic_verify() argument
1093 if (trap->id > DEVLINK_TRAP_GENERIC_ID_MAX) in devlink_trap_generic_verify()
1096 if (strcmp(trap->name, devlink_trap_generic[trap->id].name)) in devlink_trap_generic_verify()
1099 if (trap->type != devlink_trap_generic[trap->id].type) in devlink_trap_generic_verify()
1105 static int devlink_trap_driver_verify(const struct devlink_trap *trap) in devlink_trap_driver_verify() argument
1109 if (trap->id <= DEVLINK_TRAP_GENERIC_ID_MAX) in devlink_trap_driver_verify()
1113 if (!strcmp(trap->name, devlink_trap_generic[i].name)) in devlink_trap_driver_verify()
1120 static int devlink_trap_verify(const struct devlink_trap *trap) in devlink_trap_verify() argument
1122 if (!trap || !trap->name) in devlink_trap_verify()
1125 if (trap->generic) in devlink_trap_verify()
1126 return devlink_trap_generic_verify(trap); in devlink_trap_verify()
1128 return devlink_trap_driver_verify(trap); in devlink_trap_verify()
1217 u16 group_id = trap_item->trap->init_group_id; in devlink_trap_item_group_link()
1273 const struct devlink_trap *trap, void *priv) in devlink_trap_register() argument
1278 if (devlink_trap_item_lookup(devlink, trap->name)) in devlink_trap_register()
1291 trap_item->trap = trap; in devlink_trap_register()
1292 trap_item->action = trap->init_action; in devlink_trap_register()
1299 err = devlink->ops->trap_init(devlink, trap, trap_item); in devlink_trap_register()
1317 const struct devlink_trap *trap) in devlink_trap_unregister() argument
1321 trap_item = devlink_trap_item_lookup(devlink, trap->name); in devlink_trap_unregister()
1328 devlink->ops->trap_fini(devlink, trap, trap_item); in devlink_trap_unregister()
1334 const struct devlink_trap *trap) in devlink_trap_disable() argument
1338 trap_item = devlink_trap_item_lookup(devlink, trap->name); in devlink_trap_disable()
1342 devlink->ops->trap_action_set(devlink, trap, DEVLINK_TRAP_ACTION_DROP, in devlink_trap_disable()
1367 const struct devlink_trap *trap = &traps[i]; in devl_traps_register() local
1369 err = devlink_trap_verify(trap); in devl_traps_register()
1373 err = devlink_trap_register(devlink, trap, priv); in devl_traps_register()
1473 metadata->trap_name = trap_item->trap->name; in devlink_trap_report_metadata_set()
1476 metadata->trap_type = trap_item->trap->type; in devlink_trap_report_metadata_set()