get_xmit_wait_counters(9)
โจ get_xmit_wait_counters (9) โจ
okay so this is a page from the Kernel API Manual and bestie, it's giving "tiny function, big job" energy ๐ buckle up, we're doing counter math ๐งฎโจ
๐ NAME ๐
get_xmit_wait_counters โ literally converts the HFI's SendWaitCnt/SendWaitVlCnt counter from TXE cycle units into flit times ๐ฆ no cap, that's the whole vibe check.
๐ธ SYNOPSIS ๐ธ
u64 get_xmit_wait_counters (struct hfi1_pportdata *ppd , u16 link_width
, u16 link_speed , int vl );
๐ ARGUMENTS ๐
ppdโ the info of the physical Hfi port ๐ซถ like, the main character struct here.link_widthโ width of the active link ๐link_speedโ speed of the active link ๐โโ๏ธ๐จvlโ representsVL0-VL7, and alsoVL15forPortVLXmitWaitcounters requests ๐ and if thevlvalue isC_VL_COUNT, then it represents aSendWaitCntcounter request. iykyk ๐ฅ
โญ RETURN โญ
returns the SendWaitCnt/SendWaitVlCnt counter value per vl ๐ that's it, that's the tea.
๐ DESCRIPTION ๐
So what it does: it converts SendWaitCnt/SendWaitVlCnt counter from TXE cycle times to flit times โจ.
Call this function to take samples of these counters ๐. And here's the part that's lowkey kinda iconic โ the function will calculate for the previous state transition, and then update the current state at the end of the function, using ppd->prev_link_width and ppd->port_vl_xmit_wait_last into port_vl_xmit_wait_curr and link_width ๐
ngl, that state-carried-over-from-last-time thing is the whole trick. it's literally doing the glow-up at the end of the function ๐ง๐ซ
๐ฆ SEE ALSO ๐ฆ
Kernel file ./drivers/infiniband/hw/hfi1/mad.c โ and while you're in there, go say hi to get_pkeys(9), set_pkeys(9), tx_link_width(9), hfi1_pkey_validation_pma(9), and hfi1_process_mad(9) ๐
bestie that's a wrap ๐ฌ this cutie lives at ./drivers/infiniband/hw/hfi1, dated October 2026 โ go forth and sample those counters, you absolute icon ๐๐
๐
๐ฆ 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