ieee8021q_tt_to_tc(9)
π ieee8021q_tt_to_tc β the kernel API manual, bestie edition β¨
Okay so picture this: it's a kernel API manual page, the function is ieee8021q_tt_to_tc, and it's here to do exactly one iconic thing β map your IEEE 802.1Q Traffic Type to a Traffic Class. That's it. That's the whole vibe. π
β¨ NAME β¨
ieee8021q_tt_to_tc β Map IEEE 802.1Q Traffic Type to Traffic Class
Like, the name literally ate and left no crumbs. π¦
πΈ SYNOPSIS πΈ
int ieee8021q_tt_to_tc (enum ieee8021q_traffic_type tt , unsigned int
num_queues );
Notice how we're returning an int, bestie β remember that, it's foreshadowing for the RETURN section. π
π«Ά ARGUMENTS π«Ά
ttβ the IEEE 802.1Q Traffic Type. Yes, that's the whole description. She's minimal, she's mysterious, she's tt. πnum_queuesβ the Number of queues. Also exactly what it sounds like. No cap. β¨
π₯ DESCRIPTION π₯
So what does this function actually do? It maps an IEEE 802.1Q Traffic Type to a Traffic Class (TC), and the mapping depends on how many queues are configured on the NIC. The way it picks the TC is based on the example that IEEE 802.1Q-2022 gives us in Annex I, "I.3 Traffic type to traffic class mapping", plus Table I-1, "Traffic type to traffic class mapping". So like, it's not vibes-based mapping, it's standards-based mapping. Very main character energy of it honestly. π
π RETURN π
It returns the Traffic Class that corresponds to the Traffic Type you handed it β or, plot twist, a negative value if something goes wrong. π So yeah, check your return value, bestie, that's the whole point of it being an int.
Lowkey important: a negative return means error. Don't just assume you got a valid TC, fr fr. π
π SEE ALSO π
- Kernel file
./net/core/ieee8021q_helpers.cβ go read it, it's giving source code realness π ietf_dscp_to_ieee8021q_tt(9)β the sibling function, iykyk π
β Alright bestie, that's the whole page. This little gem lives over in ./net/core, it's from October 2026, and it's brought to you by the Kernel API Manual. Slay, go map some traffic types responsibly. ππ§ββοΈ
π¦ 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