dsa_8021q_rcv(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 outside tag_8021q, the pre-initialized value is preserved. If it's not known, pass -1. Simple as that πŸ’…
  • switch_id β€” similar to source_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? Then source_port and switch_id are 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: that vbid needs to arrive as -1 or 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