MLX5DV_DEVX_UMEM_UNIMPORT(3)
π mlx5dv_devx_umem_export / mlx5dv_devx_umem_import / mlx5dv_devx_umem_unimport π
okay bestie, you're in the Library Functions Manual corner of the internet now, and this page is all about moving DEVX UMEM objects between processes without losing your whole mind. π«Ά
πΈ NAME πΈ
mlx5dv_devx_umem_exportβ Export DEVX UMEM attributes for cross-process sharingmlx5dv_devx_umem_importβ Import a DEVX UMEM from exported attributesmlx5dv_devx_umem_unimportβ Unimport a DEVX UMEM
π¦ SYNOPSIS π¦
#include <infiniband/mlx5dv.h>
int mlx5dv_devx_umem_export(struct mlx5dv_devx_umem *umem, void *data);
struct mlx5dv_devx_umem *
mlx5dv_devx_umem_import(struct ibv_context *context, void *data);
void mlx5dv_devx_umem_unimport(struct mlx5dv_devx_umem *umem);
π DESCRIPTION π
These functions are the cross-process sharing pipeline for DEVX UMEM objects. Think of it like this: one process has the UMEM, another process needs in on it, and export/import is the group-chat invite. π
mlx5dv_devx_umem_export() exports the DEVX UMEM attributes into a data buffer. The caller has to allocate that buffer, and it must be at least the size returned by mlx5dv_get_export_sizes() in the devx_umem_attrs_size field. No tiny-buffer shenanigans, okay? π
mlx5dv_devx_umem_import() returns a DEVX UMEM that is associated with the exported attributes in the given context. The data buffer must have been previously filled by mlx5dv_devx_umem_export() β it is literally the handoff. β¨
The context can be the original UMEM registering context or any context sharing the same kernel resources (e.g., via ibv_import_device()). Main character energy: the UMEM can show up in more than one place, as long as the kernel resources line up. π
mlx5dv_devx_umem_unimport() unimports a DEVX UMEM that was imported via mlx5dv_devx_umem_import(). Once the UMEM usage has ended, either mlx5dv_devx_umem_dereg() or mlx5dv_devx_umem_unimport() should be called. mlx5dv_devx_umem_dereg() deregisters the kernel object, while mlx5dv_devx_umem_unimport() only cleans up local resources without affecting the kernel object. Big difference, bestie β know which one you're reaching for. π
It is the responsibility of the application to coordinate between all contexts that use this UMEM. Once deregistration is done, no other process can use the object except for unimport. All users must collaborate to ensure this.
π¨ This is the part where everyone has to communicate. Itβs giving shared custody of a very important kernel object β do not ghost the other contexts. π«Ά
β¨ ARGUMENTS β¨
π
mlx5dv_devx_umem_export
umemβ The DEVX UMEM to export.dataβ Pointer to a buffer to be filled with the exported attributes. The buffer must be at leastdevx_umem_attrs_sizebytes as returned bymlx5dv_get_export_sizes().
π§ mlx5dv_devx_umem_import
contextβ RDMA device context to import the DEVX UMEM into.dataβ Pointer to a buffer previously filled bymlx5dv_devx_umem_export().
π RETURN VALUE π
mlx5dv_devx_umem_export() returns 0 on success, or the value of errno on error.
mlx5dv_devx_umem_import() returns a pointer to a struct mlx5dv_devx_umem on success, or NULL on error with errno set.
π₯ SEE ALSO π₯
mlx5dv_devx_umem_regmlx5dv_get_export_sizesmlx5dv_open_device
π AUTHOR π
Maher Sanalla msanalla@nvidia.com
π
xoxo, your Unix bestie β manual: Library Functions Manual, footer/version tag: mlx5dv_dev...em_unimport(3), date: not printed on this page, so this sign-off is giving mystery-date energy. π«Ά
π¦ where this page comes from
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms