STRUCT DEVLINK_TRAP(9)
β¨ struct devlink_trap(9) β¨
okay bestie, welcome to the Kernel API Manual entry for struct devlink_trap(9) β yes that's the whole title, and yes it's a whole vibe. this one's short and sweet and honestly kind of iconic in its minimalism π
π NAME π
struct devlink_trap β Immutable packet trap attributes.
like, immutable. as in: these things are NOT changing, bestie. set in stone. periodt. πͺ¨
π¦ SYNOPSIS π¦
struct devlink_trap {
enum devlink_trap_type type;
enum devlink_trap_action init_action;
bool generic;
u16 id;
const char *name;
u16 init_group_id;
u32 metadata_cap;
};
look at her. seven fields. no notes. π₯
πΈ Members πΈ
typeβ the trap type. that's it, that's the field. lowkey self-explanatory but we love her anyway πinit_actionβ the initial trap action. emphasis on initial, because the whole struct is immutable but this one's literally named after the starting state, iykyk.genericβ abooltelling you whether the trap is generic or not. that's the entire lore. π«Άidβ the trap identifier. au16. she's small but she's doing her best.nameβ the trap name, as aconst char *. β¨ branding β¨init_group_idβ the initial group identifier, also au16. matching set withid, cute.metadata_capβ the metadata types that can be provided by the trap. au32full of possibilities π¦
π Description π
so this struct describes the immutable attributes of packet traps that drivers register with devlink. that's the whole thing. short queen. π
like β drivers register traps with devlink, and these are the attributes that never change on them. no cap. π§
π SEE ALSO π
Kernel file ./include/net/devlink.h, plus the whole friend group:
struct devlink_port_pci_pf_attrs(9)struct devlink_port_pci_vf_attrs(9)struct devlink_port_pci_sf_attrs(9)struct devlink_port_attrs(9)struct devlink_linecard_ops(9)struct devlink_dpipe_field(9)struct devlink_dpipe_header(9)struct devlink_dpipe_match(9)struct devlink_dpipe_action(9)struct devlink_dpipe_value(9)struct devlink_dpipe_entry(9)struct devlink_dpipe_dump_ctx(9)struct devlink_dpipe_table(9)struct devlink_dpipe_table_ops(9)struct devlink_dpipe_headers(9)struct devlink_resource_size_params(9)struct devlink_flash_notify(9)struct devlink_param(9)struct devlink_flash_update_params(9)struct devlink_region_ops(9)struct devlink_port_region_ops(9)struct devlink_health_reporter_ops(9)struct devlink_trap_metadata(9)struct devlink_trap_policer(9)struct devlink_trap_group(9)struct devlink_port_ops(9)
that's a LOT of structs. the devlink extended universe is real and it is thriving ππ
ok that's the whole page, bestie. go forth and register your traps. π«Ά
and finally, the cute little sign-off from the original footer: this one lives in ./include/net, straight from the October 2026 era of the kernel, and its name is β say it with me β struct devlink_trap(9). slay. ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms