diff options
author | Moni Shoua <monis@mellanox.com> | 2020-01-15 15:43:33 +0300 |
---|---|---|
committer | Leon Romanovsky <leonro@mellanox.com> | 2020-01-16 17:14:42 +0300 |
commit | 87d8069f6b028793254ddd0a66df1d7b6d79b450 (patch) | |
tree | 2b5eedc24d2333dd29ff6ca9883057f97f70ef23 /drivers/infiniband/core/verbs.c | |
parent | 33006bd4f37f7d2c3d1cf0268b4f327b5fdc2558 (diff) | |
download | linux-87d8069f6b028793254ddd0a66df1d7b6d79b450.tar.xz |
IB/core: Add interface to advise_mr for kernel users
Allow ULPs to call advise_mr, so they can control ODP regions
in the same way as user space applications.
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 7a69e4bbe877..d33bdc9b01cd 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -2020,6 +2020,17 @@ struct ib_mr *ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, } EXPORT_SYMBOL(ib_reg_user_mr); +int ib_advise_mr(struct ib_pd *pd, enum ib_uverbs_advise_mr_advice advice, + u32 flags, struct ib_sge *sg_list, u32 num_sge) +{ + if (!pd->device->ops.advise_mr) + return -EOPNOTSUPP; + + return pd->device->ops.advise_mr(pd, advice, flags, sg_list, num_sge, + NULL); +} +EXPORT_SYMBOL(ib_advise_mr); + int ib_dereg_mr_user(struct ib_mr *mr, struct ib_udata *udata) { struct ib_pd *pd = mr->pd; |