mlx5r_umr_dm..._update_pgsz(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mlx5r_umr_dmabuf_update_pgsz(9)

okay so first thing, bestie β€” this is a page from the Kernel API Manual, section 9 (the kernel-functions girlypop section ✨). The function we're stanning today is mlx5r_umr_dmabuf_update_pgsz, and the header up top shortens it to mlx5r_umr_dm..._update_pgsz(9) because even manpage headers get tired. Anyway. Let's get into it πŸŽ€


✨ NAME ✨

mlx5r_umr_dmabuf_update_pgsz β€” safely update a DMABUF MR's page size and its entries accordingly πŸ¦‹

🌸 SYNOPSIS 🌸

int mlx5r_umr_dmabuf_update_pgsz (struct mlx5_ib_mr *mr , u32 xlt_flags
, u32 pdn , unsigned int page_shift );

πŸŽ€ ARGUMENTS πŸŽ€

  • mr β€” the memory region you're updating, like the main character of this whole operation πŸ‘‘
  • xlt_flags β€” the translation table update flags. flags! for the translation table! updating! iykyk πŸ’…
  • pdn β€” the protection domain number
  • page_shift β€” the new (optimized) page shift to use. yes bestie, optimized ✨

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: this function updates the page size and the mkey translation entries for a DMABUF MR, and it does it in a safe, multi-step process β€” literally so it never exposes partially updated mappings. no cap, that's the whole point 🫢

The update happens in 5 steps:

  1. Make the first X entries non-present, while X is calculated to be minimal according to a large page shift that can be used to cover the MR length
  2. Update the page size to the large supported page size
  3. Load the remaining N-X entries according to the (optimized) page_shift
  4. Update the page size according to the (optimized) page_shift
  5. Load the first X entries with the correct translations

the way this is sequenced?? iconic. it ensures that at no point is the MR accessible with a partially updated translation table β€” which maintains correctness and prevents access to stale or inconsistent mappings. that's the correctness girlie behavior we love to see πŸ˜­πŸ’–

Returns 0 on success or a negative error code on failure. (so like, check your return value, bestie. always. πŸ™ˆ)

ngl the "never half-updated" thing is the entire personality of this function β€” don't skip a step, don't reorder them, and definitely don't let anything read the table mid-glow-up πŸ’€

⭐ SEE ALSO ⭐


and that's the page!! 🧚 this one lives under ./drivers/infiniband/hw/mlx5 in the Kernel API Manual, dated October 2026 β€” so yeah, it's giving future-kernel energy, slay πŸ’œβœ¨

πŸ“¦ where this page comes from