summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/verbs.c
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2020-01-15 15:43:33 +0300
committerLeon Romanovsky <leonro@mellanox.com>2020-01-16 17:14:42 +0300
commit87d8069f6b028793254ddd0a66df1d7b6d79b450 (patch)
tree2b5eedc24d2333dd29ff6ca9883057f97f70ef23 /drivers/infiniband/core/verbs.c
parent33006bd4f37f7d2c3d1cf0268b4f327b5fdc2558 (diff)
downloadlinux-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.c11
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;