get_xmit_wait_counters(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

โœจ 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 โ€” represents VL0-VL7, and also VL15 for PortVLXmitWait counters requests ๐Ÿ‘‘ and if the vl value is C_VL_COUNT, then it represents a SendWaitCnt counter 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