get_link_speed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, this is a page from the Kernel API Manual, and it's all about get_link_speed β€” the little function that helps determine whether the active link speed is 12.5G or 25G. iconic behavior, honestly. πŸ’…


🌸 NAME 🌸

get_link_speed β€” determine whether it's 12.5G or 25G speed πŸŽ€


✨ SYNOPSIS ✨

u16 get_link_speed (u16 link_speed );

πŸŽ€ ARGUMENTS πŸŽ€

  • link_speed β€” the speed of the active link. that's the whole vibe check right there πŸ¦‹

πŸ¦‹ RETURN πŸ¦‹

  • Returns 2 if the link speed is identified as 12.5G.
  • Returns 1 if the link speed is 25G.

no cap, those are the two return values πŸ’–


πŸ’… DESCRIPTION πŸ’…

So the function indirectly calculates the required link speed value for the convert_xmit_counter function. it's giving helper-function main character energy ✨

If the link speed is 25G, the function returns 1, because that's what the xmit counter conversion formula needs :-( β€” and the formula is 25G / link_speed. This conversion will provide value 1 if the current link speed is 25G or 2 if it's 12.5G. This is done to avoid a 12.5 float number conversion, which is honestly so valid of it 🫢


πŸ”₯ SEE ALSO πŸ”₯


okurrr, that's the whole page πŸ’œ this one lives in the ./drivers/infiniband/hw/hfi1 source/version corner of the kernel, and it's dated October 2026 β€” periodt πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from