1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
12 #include "mlx5_autoconf.h"
15 #include <rte_malloc.h>
16 #include <rte_ethdev_driver.h>
17 #include <rte_common.h>
19 #include <mlx5_glue.h>
20 #include <mlx5_common.h>
21 #include <mlx5_common_mr.h>
22 #include <mlx5_verbs.h>
24 * Register mr. Given protection domain pointer, pointer to addr and length
25 * register the memory region.
28 * Pointer to protection domain context.
30 * Pointer to memory start address.
32 * Length of the memory to register.
34 * pmd_mr struct set with lkey, address, length and pointer to mr object
37 * 0 on successful registration, -1 otherwise
40 mlx5_reg_mr(void *pd, void *addr, size_t length,
41 struct mlx5_pmd_mr *pmd_mr)
43 return mlx5_common_verbs_reg_mr(pd, addr, length, pmd_mr);
47 * Deregister mr. Given the mlx5 pmd MR - deregister the MR
50 * pmd_mr struct set with lkey, address, length and pointer to mr object
54 mlx5_dereg_mr(struct mlx5_pmd_mr *pmd_mr)
56 mlx5_common_verbs_dereg_mr(pmd_mr);
59 /* verbs operations. */
60 const struct mlx5_verbs_ops mlx5_verbs_ops = {
61 .reg_mr = mlx5_reg_mr,
62 .dereg_mr = mlx5_dereg_mr,