.\" Automatically generated by Pandoc 3.6 .\" .TH "mlx5dv_var_export / mlx5dv_var_import / mlx5dv_var_unimport" "3" "" "" .SH NAME mlx5dv_var_export \- Export VAR attributes for cross\-process sharing .PP mlx5dv_var_import \- Import a VAR from exported attributes .PP mlx5dv_var_unimport \- Unimport a VAR .SH SYNOPSIS .IP .EX #include \f[B]\f[R] int mlx5dv_var_export(\f[B]struct\f[R] mlx5dv_var *dv_var, void *data); \f[B]struct\f[R] mlx5dv_var *mlx5dv_var_import(\f[B]struct\f[R] ibv_context *context, void *data); void mlx5dv_var_unimport(\f[B]struct\f[R] mlx5dv_var *dv_var); .EE .SH DESCRIPTION These functions enable cross\-process sharing of VAR objects. .PP \f[I]mlx5dv_var_export()\f[R] exports a VAR attributes into a data 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]var_attrs_size\f[R] field. .PP \f[I]mlx5dv_var_import()\f[R] returns a VAR that is associated with the exported attributes in the given \f[I]context\f[R]. .PP The \f[I]context\f[R] can be the original VAR allocating context or any context sharing the same kernel resources (e.g., via \f[I]ibv_import_device()\f[R]). .PP \f[I]mlx5dv_var_unimport()\f[R] unimports a VAR that was imported via \f[I]mlx5dv_var_import()\f[R]. Once the VAR usage has ended, either \f[I]mlx5dv_free_var()\f[R] or \f[I]mlx5dv_var_unimport()\f[R] should be called. \f[I]mlx5dv_free_var()\f[R] destroys the kernel object, while \f[I]mlx5dv_var_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 VAR. Once destroy/free is done, no other process can use the object except for unimport. All users must collaborate to ensure this. .SH ARGUMENTS .SS mlx5dv_var_export .TP \f[I]dv_var\f[R] The VAR 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]var_attrs_size\f[R] bytes as returned by \f[I]mlx5dv_get_export_sizes()\f[R]. .SS mlx5dv_var_import .TP \f[I]context\f[R] RDMA device context to import the VAR into. .TP \f[I]data\f[R] Pointer to a buffer previously filled by \f[I]mlx5dv_var_export()\f[R]. .SH RETURN VALUE \f[I]mlx5dv_var_export()\f[R] returns 0 on success, or the value of errno on error. .PP \f[I]mlx5dv_var_import()\f[R] returns a pointer to a \f[I]struct mlx5dv_var\f[R] on success, or NULL on error with errno set. .SH SEE ALSO \f[B]mlx5dv_alloc_var\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