mlx5r_umr_dm..._update_pgsz(9)
π 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 numberpage_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:
- 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
- Update the page size to the large supported page size
- Load the remaining N-X entries according to the (optimized) page_shift
- Update the page size according to the (optimized) page_shift
- 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 β
- Kernel file
./drivers/infiniband/hw/mlx5/umr.c mlx5r_umr_revoke_mr(9)
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
- 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