| 1 | --- |
| 2 | layout: page |
| 3 | title: mlx5dv_reg_dmabuf_mr |
| 4 | section: 3 |
| 5 | tagline: Verbs |
| 6 | --- |
| 7 | |
| 8 | # NAME |
| 9 | |
| 10 | mlx5dv_reg_dmabuf_mr - Register a dma-buf based memory region (MR) |
| 11 | |
| 12 | # SYNOPSIS |
| 13 | |
| 14 | ```c |
| 15 | #include <infiniband/mlx5dv.h> |
| 16 | |
| 17 | struct ibv_mr *mlx5dv_reg_dmabuf_mr(struct ibv_pd *pd, uint64_t offset, |
| 18 | size_t length, uint64_t iova, int fd, |
| 19 | int access, int mlx5_access) |
| 20 | ``` |
| 21 | |
| 22 | # DESCRIPTION |
| 23 | |
| 24 | Register a dma-buf based memory region (MR), it follows the functionality of |
| 25 | *ibv_reg_dmabuf_mr()* with the ability to supply specific mlx5 access flags. |
| 26 | |
| 27 | # ARGUMENTS |
| 28 | *pd* |
| 29 | : The associated protection domain. |
| 30 | |
| 31 | *offset* |
| 32 | : The offset of the dma-buf where the MR starts. |
| 33 | |
| 34 | *length* |
| 35 | : The length of the MR. |
| 36 | |
| 37 | *iova* |
| 38 | : Specifies the virtual base address of the MR when accessed through a lkey or rkey. |
| 39 | It must have the same page offset as *offset* and be aligned with the system page size. |
| 40 | |
| 41 | *fd* |
| 42 | : The file descriptor that the dma-buf is identified by. |
| 43 | |
| 44 | *access* |
| 45 | : The desired memory protection attributes; it is either 0 or the bitwise OR of one or more of *enum ibv_access_flags*. |
| 46 | |
| 47 | *mlx5_access* |
| 48 | : A specific device access flags, it is either 0 or the below. |
| 49 | |
| 50 | *MLX5DV_REG_DMABUF_ACCESS_DATA_DIRECT* |
| 51 | if set, this MR will be accessed through the Data Direct engine bonded with that RDMA device. |
| 52 | |
| 53 | # RETURN VALUE |
| 54 | |
| 55 | Upon success returns a pointer to the registered MR, or NULL if the request fails, in that case the value of errno indicates the failure reason. |
| 56 | |
| 57 | # SEE ALSO |
| 58 | |
| 59 | *ibv_reg_dmabuf_mr(3)*, *mlx5dv_get_data_direct_sysfs_path(3)* |
| 60 | |
| 61 | # AUTHOR |
| 62 | |
| 63 | Yishai Hadas <[email protected]> |