ENUM DSA_CMD(9)
π 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
- 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