ENUM DSA_CMD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum dsa_cmd(9) β€” straight from the Kernel API Manual, bestie

okay so real talk: this is a page about enum dsa_cmd, and it's lowkey one of the most important little enums in the DSA (Distributed Switch Architecture) world. it's the command field that tells everyone why a packet is doing what it's doing. no cap, it's giving traffic-director energy. πŸ‘‘


✨ NAME ✨

enum dsa_cmd β€” the DSA Command, aka the little label that tells the switch tree what a packet is up to πŸŽ€


🌸 SYNOPSIS 🌸

enum dsa_cmd {
    DSA_CMD_TO_CPU ,
    DSA_CMD_FROM_CPU ,
    DSA_CMD_TO_SNIFFER ,
    DSA_CMD_FORWARD

};

πŸ¦‹ Constants πŸ¦‹

the main characters, one by one πŸ’–

  • DSA_CMD_TO_CPU β€” set on packets that were trapped or mirrored to the CPU port. why do we need it? because it's how you implement control protocols β€” think STP and LLDP β€” that absolutely must not let those control packets get switched according to the normal rules. it's a whole "do not touch, this one's special" vibe πŸ™ˆ
  • DSA_CMD_FROM_CPU β€” used by the CPU to send a packet to a specific port, straight up ignoring all the barriers that the switch normally enforces (VLANs, STP port states etc.). and nope, no source address learning takes place. it's literally "sudo send packet" πŸ’€πŸ”₯
  • DSA_CMD_TO_SNIFFER β€” set on the copies of packets that matched some user configured ingress or egress monitor criteria. these get forwarded by the switch tree to the user configured ingress or egress monitor port, which can be set to the CPU port or a regular port. so:
    • if the destination is a regular port, the tag will be removed before egressing the port πŸ‘‹
    • if the destination is the CPU port, the tag will not be removed 🫢

(yes, the tag keeps its little outfit on when it goes to the CPU. iconic behaviour.)

  • DSA_CMD_FORWARD β€” this tag is used on all bulk traffic passing through the switch tree, including the flows that are directed towards the CPU. its device/port tuple encodes the original source port on which the packet ingressed. it can also be used on transmit by the CPU to defer the forwarding decision to the hardware, based on the current config of PVT/VTU/ATU etc. and bestie β€” source address learning takes places if enabled on the receiving DSA/CPU port 🌈

🌟 SEE ALSO 🌟

  • Kernel file ./net/dsa/tag_dsa.c
  • enum dsa_code(9)

that's the whole page, fr fr. this one lives under ./net/dsa and it's dated October 2026 β€” so like, future icon behaviour only πŸ’œβœ¨ go forth and tag your packets correctly, bestie πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from