devlink_traps_unregister(9)
π devlink_traps_unregister β the kernel API manual, bestie edition π
okay so real talk, this is a page from the Kernel API Manual and it's about devlink_traps_unregister(9). yes the whole title is the function name, we love a self-titled moment. let's get into it β¨
πΈ NAME πΈ
devlink_traps_unregister β Unregister packet traps from devlink.
like, it's the goodbye function. it takes your packet traps and politely removes them from devlink's whole thing. no cap π
β¨ SYNOPSIS β¨
void devlink_traps_unregister (struct devlink *devlink , const struct
devlink_trap *traps , size_t traps_count );
it returns void, so likeβ¦ it gives you nothing back. not a single crumb. and honestly? that's fine, it's giving "I did the job, don't ask questions" energy π«Ά
π¦ ARGUMENTS π¦
devlinkβ devlink. yes bestie that's the whole description, it's thedevlinkpointer, she's the main character and she knows it πtrapsβ Packet traps. this is the pointer to your traps, plural, the whole squad πtraps_countβ Count of provided packet traps. literally just how many traps you're handing over β asize_t, so, you know, don't be weird about it π
π₯ CONTEXT π₯
Takes and release devlink->lock <mutex>.
so it grabs the mutex and then lets it go. in and out. a little lock-and-release moment. do NOT forget that this is happening, because the lock is not decorative, it's iconic and it's real β
π SEE ALSO π
Kernel file ./net/devlink/trap.c β go read the source, it's giving lore:
struct devlink_trap_policer_item(9)struct devlink_trap_group_item(9)struct devlink_trap_item(9)devl_traps_register(9)devlink_traps_register(9)devl_traps_unregister(9)devlink_trap_report(9)devlink_trap_ctx_priv(9)devl_trap_groups_register(9)devlink_trap_groups_register(9)devl_trap_groups_unregister(9)devlink_trap_groups_unregister(9)devl_trap_policers_register(9)devl_trap_policers_unregister(9)
like I said, the whole friend group. register versions, unregister versions, the devl_ variants, the trap/group/policer branches β it's a whole ensemble cast and they all ate π₯π
ngl the only actual gotcha here is that mutex. devlink->lock gets taken and released for you. you don't do it yourself, it just happens. that's the whole vibe check π§
okay that's the page!! sourced from ./net/devlink, dated October 2026, and yes it's still devlink_traps_unregister(9) at the bottom, the full circle moment ππ mwah, go unregister those traps bestie ππ«Ά
π¦ 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