sdma_map_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to sdma_map_init(9) from the Kernel API Manual πŸ’– this is the little routine that changes the mapping based on the number of vls, and we’re gonna get into it. no cap.

✨ NAME ✨

sdma_map_init β€” called when # vls change πŸ’…

🌸 SYNOPSIS 🌸

int sdma_map_init (struct hfi1_devdata *dd , u8 port , u8 num_vls , u8
*vl_engines );

πŸŽ€ ARGUMENTS πŸŽ€

  • dd β€” hfi1_devdata 🫢
  • port β€” port number
  • num_vls β€” number of vls
  • vl_engines β€” per vl engine mapping (optional)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this routine changes the mapping based on the number of vls. literally its whole thing.

vl_engines is used to specify a non-uniform vl/engine loading. if it’s NULL, that implies auto computing the loading and giving each VLs a uniform distribution of engines per VL. ✨

the auto algorithm computes the sde_per_vl and the number of extra engines. any extra engines are added from the last VL on down. πŸ‘‘

rcu locking is used here to control access to the mapping fields. πŸ”’

if either the num_vls or num_sdma are non-power of 2, the array sizes in the struct sdma_vl_map and the struct sdma_map_elem are rounded up to the next highest power of 2, and the first entry is reused in a round robin fashion. πŸŒ€

if an error occurs, the map change is not done and the mapping is not changed. periodt. πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/infiniband/hw/hfi1/sdma.c β€” plus the whole function bestie squad, in order:


mwah πŸ’‹ that’s the page, signed off with source/version ./drivers/infiniband/hw/hfi1, date October 2026, and title sdma_map_init(9). 🫢✨

πŸ“¦ where this page comes from