ENUM DSA_CODE(9)
π enum dsa_code β NAME
ok so enum dsa_code is literally the TO_CPU Code enum, bestie. that's the whole name. it's the enum that tells you why the hardware yeeted a frame at the CPU. slay.
it lives in the Kernel API Manual, which β iykyk β is the manual for kernel API stuff. π
β¨ SYNOPSIS β¨
here's the whole squad, exactly as declared, no edits, no cap:
enum dsa_code {
DSA_CODE_MGMT_TRAP ,
DSA_CODE_FRAME2REG ,
DSA_CODE_IGMP_MLD_TRAP ,
DSA_CODE_POLICY_TRAP ,
DSA_CODE_ARP_MIRROR ,
DSA_CODE_POLICY_MIRROR ,
DSA_CODE_RESERVED_6 ,
DSA_CODE_RESERVED_7
};
look at them. eight little icons. π«Ά
πΈ Constants πΈ
okay this is the part where we meet each one individually, main-character-energy style:
DSA_CODE_MGMT_TRAPβ the DA got classified as a management address. the classic examples are STP BPDUs and LLDP β yeah, the protocol-gossip packets. π¬DSA_CODE_FRAME2REGβ this one is the response to a"remote management"request. it's giving "you asked, I answered." β¨DSA_CODE_IGMP_MLD_TRAPβ IGMP/MLD signaling, periodt. multicast said "hello" and the CPU got the notification. π£DSA_CODE_POLICY_TRAPβ the frame matched some policy configuration on the device. typical examples, fr fr: matching on DA/SA/VID, and DHCP snooping. the policy said "caught you" πDSA_CODE_ARP_MIRRORβ the name says it all really. π that's it. that's the description. iconic of the original authors honestly.DSA_CODE_POLICY_MIRRORβ same asDSA_CODE_POLICY_TRAP, except the particular policy was set to trigger a mirror instead of a trap. one little config toggle, whole different vibe. πͺDSA_CODE_RESERVED_6β unused on all devices up to at least 6393X. it's reserved. it's chilling. it's not doing anything and that's fine. πDSA_CODE_RESERVED_7β literally same energy: unused on all devices up to at least 6393X. the 6393X number is exact, don't come for me. π₯
π¦ Description π¦
so here's the lore: a 3-bit code is used to relay why a particular frame was sent to the CPU. three bits! tiny! efficient! π
we only use this to determine if the packet was mirrored or trapped β like, whether the packet has been forwarded by hardware or not. that's the whole decision. mirror or trap. that's it.
and this enum is the superset of all possible codes. any particular device may only implement a subset, so don't be shocked when your hardware is like "we only do four of these, bestie." π
π SEE ALSO π
go look at these, they're friends of the family:
- Kernel file
./net/dsa/tag_dsa.c enum dsa_cmd(9)
and that's the page!! π shoutout to ./net/dsa, dated October 2026 β that's where this whole thing comes from, mwah, stan the kernel docs forever πππ¦
π¦ 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