tb_maximum_bandwidth(9)
π tb_maximum_bandwidth π
okay so first things first, bestie: this is a page from the Kernel API Manual β section 9, kernel API land β and it's all about tb_maximum_bandwidth, which is literally the Maximum bandwidth over a single link. no cap. β¨
πΈ SYNOPSIS πΈ
int tb_maximum_bandwidth (struct tb *tb , struct tb_port *src_port ,
struct tb_port *dst_port , struct tb_port *port , int *max_up , int
*max_down , bool include_asym );
that's the whole vibe right there. one function, seven things you gotta hand it. slay. π«Ά
π ARGUMENTS π
tbβ the domain structure, aka the whole Thunderbolt situation you're poking at πsrc_portβ the source protocol adapter. where the traffic's coming from, iykyk π«dst_portβ the destination protocol adapter. where it's headed π¦portβ the USB4 port that the total bandwidth is calculated for. this is the main character of the calculation, fr π₯max_upβ maximum upstream bandwidth, measured in Mb/s β¬οΈmax_downβ maximum downstream bandwidth, also in Mb/s β¬οΈinclude_asymβ aboolthat says: include bandwidth if the link is switched from symmetric to asymmetric. so like, do we count the extra juice you get when the link flips into asymmetric mode? honestly iconic that you even get to choose π§
β¨ DESCRIPTION β¨
so what does it actually do. okay. it returns the maximum possible bandwidth β dropping it into max_up and max_down β over a single link at port. that's the tea. π
and if include_asym is set, it also includes the additional bandwidth you'd get if the links were transitioned into asymmetric toward the direction from src_port to dst_port. so you're not just getting today's bandwidth, you're getting the what if we went asymmetric bandwidth too. lowkey obsessed with that. π
π RETURN π
0on success β we love a clean exit, periodt π- a negative errno otherwise β not the vibe, but at least it tells you what went wrong π
ngl bestie, always check that return value. 0 = good, negative = go read your errno. don't be out here ignoring it π
π SEE ALSO π
- Kernel file
./drivers/thunderbolt/tb.c struct tb_cm(9)tb_consumed_usb3_pcie_bandwidth(9)tb_consumed_dp_bandwidth(9)tb_available_bandwidth(9)tb_configure_asym(9)tb_configure_sym(9)
the whole bandwidth friend group honestly, go read all of them π
aaaand that's the page!! sourced straight from ./drivers/thunderbolt, dated October 2026, and filed right here in section 9 of the Kernel API Manual. mwah. go configure some bandwidth 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