.\" Automatically generated by Pandoc 3.6 .\" .TH "mlx5dv_devx_obj_export / mlx5dv_devx_obj_import / mlx5dv_devx_obj_unimport" "3" "" "" .SH NAME mlx5dv_devx_obj_export \- Export DEVX object attributes for cross\-process sharing .PP mlx5dv_devx_obj_import \- Import a DEVX object from exported attributes .PP mlx5dv_devx_obj_unimport \- Unimport a DEVX object .SH SYNOPSIS .IP .EX #include \f[B]\f[R] int mlx5dv_devx_obj_export(\f[B]struct\f[R] mlx5dv_devx_obj *obj, void *data); \f[B]struct\f[R] mlx5dv_devx_obj *mlx5dv_devx_obj_import(\f[B]struct\f[R] ibv_context *context, void *data); void mlx5dv_devx_obj_unimport(\f[B]struct\f[R] mlx5dv_devx_obj *obj); .EE .SH DESCRIPTION These functions enable cross\-process sharing of DEVX objects. .PP \f[I]mlx5dv_devx_obj_export()\f[R] exports DEVX object attributes into a buffer. The buffer must be allocated by the caller with at least the size returned by \f[I]mlx5dv_get_export_sizes()\f[R] in the \f[I]devx_obj_attrs_size\f[R] field. .PP \f[I]mlx5dv_devx_obj_import()\f[R] returns a DEVX object that is associated with the exported attributes in the given \f[I]context\f[R]. The \f[I]data\f[R] buffer must have been previously filled by \f[I]mlx5dv_devx_obj_export()\f[R]. .PP The \f[I]context\f[R] can be the original object creating context or any context sharing the same kernel resources (e.g., via \f[I]ibv_import_device()\f[R]). .PP \f[I]mlx5dv_devx_obj_unimport()\f[R] unimports a DEVX object that was imported via \f[I]mlx5dv_devx_obj_import()\f[R]. Once the object usage has ended, either \f[I]mlx5dv_devx_obj_destroy()\f[R] or \f[I]mlx5dv_devx_obj_unimport()\f[R] should be called. \f[I]mlx5dv_devx_obj_destroy()\f[R] destroys the kernel object, while \f[I]mlx5dv_devx_obj_unimport()\f[R] only cleans up local resources without affecting the kernel object. .PP It is the responsibility of the application to coordinate between all contexts that use this object. Once destroy is done, no other process can use the object except for unimport. All users must collaborate to ensure this. .SH ARGUMENTS .SS mlx5dv_devx_obj_export .TP \f[I]obj\f[R] The DEVX object to export. .TP \f[I]data\f[R] Pointer to a buffer to be filled with the exported attributes. The buffer must be at least \f[I]devx_obj_attrs_size\f[R] bytes as returned by \f[I]mlx5dv_get_export_sizes()\f[R]. .SS mlx5dv_devx_obj_import .TP \f[I]context\f[R] RDMA device context to import the DEVX object into. .TP \f[I]data\f[R] Pointer to a buffer previously filled by \f[I]mlx5dv_devx_obj_export()\f[R]. .SH RETURN VALUE \f[I]mlx5dv_devx_obj_export()\f[R] returns 0 on success, or the value of errno on error. .PP \f[I]mlx5dv_devx_obj_import()\f[R] returns a pointer to a \f[I]struct mlx5dv_devx_obj\f[R] on success, or NULL on error with errno set. .SH SEE ALSO \f[B]mlx5dv_devx_obj_create\f[R], \f[B]mlx5dv_get_export_sizes\f[R], \f[B]mlx5dv_open_device\f[R] .SH AUTHOR Maher Sanalla \c .MT msanalla@nvidia.com .ME \c