aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/main.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2019-12-12 13:09:28 +0200
committerJason Gunthorpe <jgg@mellanox.com>2020-01-12 19:49:13 -0400
commit3f59b6c3e600f9665dcf5b8e566cd7b778f03045 (patch)
tree0d1a1d17c8c4155313f06df129df758da1b04d0f /drivers/infiniband/hw/mlx5/main.c
parentIB/mlx5: Introduce VAR object and its alloc/destroy methods (diff)
downloadlinux-dev-3f59b6c3e600f9665dcf5b8e566cd7b778f03045.tar.xz
linux-dev-3f59b6c3e600f9665dcf5b8e566cd7b778f03045.zip
IB/mlx5: Add mmap support for VAR
Add mmap support for VAR, it uses the 'offset' command mode with involvement of IB core APIs to find the previously allocated mmap entry. Link: https://lore.kernel.org/r/20191212110928.334995-6-leon@kernel.org Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 433ed48425ad..97bcf01960ae 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -2253,7 +2253,10 @@ static int mlx5_ib_mmap_offset(struct mlx5_ib_dev *dev,
mentry = to_mmmap(entry);
pfn = (mentry->address >> PAGE_SHIFT);
- prot = pgprot_writecombine(vma->vm_page_prot);
+ if (mentry->mmap_flag == MLX5_IB_MMAP_TYPE_VAR)
+ prot = pgprot_noncached(vma->vm_page_prot);
+ else
+ prot = pgprot_writecombine(vma->vm_page_prot);
ret = rdma_user_mmap_io(ucontext, vma, pfn,
entry->npages * PAGE_SIZE,
prot,