hl_mmu_hr_ge...loc_next_hop(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hl_mmu_hr_get_alloc_next_hop(9) β€” like, the actual kernel API manual, bestie ✨

okay so you're in the Kernel API Manual and this page is about one very specific little function, and honestly? it's giving "small but crucial." let's get into it πŸŽ€


🌸 NAME 🌸

hl_mmu_hr_get_alloc_next_hop β€” get the next HOP, and allocate it if it does not exist. yes bestie, it does both. multitasking icon behavior fr fr πŸ‘‘


✨ SYNOPSIS ✨

struct pgt_info * hl_mmu_hr_get_alloc_next_hop (struct hl_ctx *ctx ,
       struct hl_mmu_hr_priv *hr_priv , struct hl_hr_mmu_funcs *hr_func ,
       struct hl_mmu_properties *mmu_prop , u64 curr_pte , bool *is_new_hop );

like, copy it exactly, don't @ me πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctx β€” pointer to the context structure. the main character of the whole situation, lowkey.
  • hr_priv β€” host resident private info structure. its private info, we don't pry πŸ™ˆ
  • hr_func β€” host resident functions. the toolbox 🧰
  • mmu_prop β€” MMU properties. the vibes/settings, basically.
  • curr_pte β€” current PTE value. it's a u64, so like… a big number. respect it.
  • is_new_hop β€” set to true if the HOP is new. and no cap: it is the caller's responsibility to set it to false. don't forget, or it's gonna be a whole thing 😭

πŸ’– DESCRIPTION πŸ’–

so basically: on success it returns the pgt_info structure associated with the allocated HOP. and if it doesn't succeed? it returns NULL. that's it. that's the whole deal. short and iconic, periodt 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/accel/habanalabs/common/mmu/mmu.c β€” that's where the magic lives, iykyk πŸ—‚οΈ

and then the whole friend group, in this exact order, mwah πŸ’‹


and that's the page, bestie 🫢 this iconic lil doc came from ./drivers/accel/habanalabs/com... and it's stamped October 2026, so go forth and allocate responsibly. mwah, love u, bye πŸ’œβœ¨

πŸ“¦ where this page comes from