ENUM DSA_CODE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 as DSA_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