dsa_8021q_rcv(9)
π dsa_8021q_rcv(9) β the kernel API manual, but make it make sense
Okay bestie, welcome to the dsa_8021q_rcv page from the Kernel API Manual β¨ β this is the girl whose whole job is decoding where a packet came from. No cap, she's a little legend.
π NAME π
dsa_8021q_rcv β Decode source information from tag_8021q header π¦
β¨ SYNOPSIS β¨
void dsa_8021q_rcv (struct sk_buff *skb , int *source_port , int *switch_id , int *vbid , int *vid );
Like, that's the whole vibe check right there π«
πΈ ARGUMENTS πΈ
skbβ the RX socket buffer, aka the packet showing up to the function's door πͺsource_portβ pointer to storage for precise source port information. Okay so here's the tea: if this is already known from outsidetag_8021q, the pre-initialized value is preserved. If it's not known, pass-1. Simple as that πswitch_idβ similar tosource_port. Same rules, same energy π«Άvbidβ pointer to storage for an imprecise bridge ID. This one's got rules, bestie: it must be pre-initialized with-1β οΈ. And if a positive value comes back? Thensource_portandswitch_idare invalid. Periodt.vidβ pointer to storage for the original VID, for the case where tag_8021q decoding failed π (it happens to the best of us)
π DESCRIPTION π
So here's what she actually does π₯:
If the packet has a tag_8021q header, she decodes it and sets source_port, switch_id and vbid, then strips the header off. Iconic behaviour, honestly.
Otherwise β no header, no problem β she sets vid and keeps the header in the hwaccel area of the packet π. Not me being precise about where the header lives, but like, that's literally where it lives.
π SEE ALSO π
Kernel file ./net/dsa/tag_8021q.c β go read it, iykyk πβ¨
Fr fr though: thatvbidneeds to arrive as-1or the whole thing gets weird. Don't say I didn't warn you π
And that's a wrap, bestie π this chaotic little page lives in ./net/dsa, dated October 2026, and it's giving kernel-doc excellence β slay π
π¦ 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