Skip to content

Commit a4e3198

Browse files
author
Yishai Hadas
committed
mlx5: Add support for the ibv_reg_mr_ex() verb
Add support for the ibv_reg_mr_ex() verb. Signed-off-by: Yishai Hadas <[email protected]>
1 parent c7743ea commit a4e3198

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

providers/mlx5/mlx5.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ static const struct verbs_context_ops mlx5_ctx_common_ops = {
175175
.query_qp_data_in_order = mlx5_query_qp_data_in_order,
176176
.alloc_dmah = mlx5_alloc_dmah,
177177
.dealloc_dmah = mlx5_dealloc_dmah,
178+
.reg_mr_ex = mlx5_reg_mr_ex,
178179
};
179180

180181
static const struct verbs_context_ops mlx5_ctx_cqev1_ops = {

providers/mlx5/mlx5.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ struct ibv_mr *mlx5_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
11431143
uint64_t hca_va, int access);
11441144
struct ibv_mr *mlx5_reg_dmabuf_mr(struct ibv_pd *pd, uint64_t offset, size_t length,
11451145
uint64_t iova, int fd, int access);
1146+
struct ibv_mr *mlx5_reg_mr_ex(struct ibv_pd *pd, struct ibv_reg_mr_in *in);
11461147
int mlx5_rereg_mr(struct verbs_mr *mr, int flags, struct ibv_pd *pd, void *addr,
11471148
size_t length, int access);
11481149
int mlx5_dereg_mr(struct verbs_mr *mr);

providers/mlx5/verbs.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,25 @@ struct ibv_mr *mlx5_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
651651
return &mr->vmr.ibv_mr;
652652
}
653653

654+
struct ibv_mr *mlx5_reg_mr_ex(struct ibv_pd *pd, struct ibv_reg_mr_in *in)
655+
{
656+
struct mlx5_mr *mr;
657+
int ret;
658+
659+
mr = calloc(1, sizeof(*mr));
660+
if (!mr)
661+
return NULL;
662+
663+
ret = ibv_cmd_reg_mr_ex(pd, &mr->vmr, in);
664+
if (ret) {
665+
free(mr);
666+
return NULL;
667+
}
668+
mr->alloc_flags = in->access;
669+
670+
return &mr->vmr.ibv_mr;
671+
}
672+
654673
struct ibv_mr *mlx5_reg_dmabuf_mr(struct ibv_pd *pd, uint64_t offset, size_t length,
655674
uint64_t iova, int fd, int acc)
656675
{

0 commit comments

Comments
 (0)