linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Yishai Hadas <yishaih@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	linux-netdev <netdev@vger.kernel.org>
Subject: [PATCH rdma-next 5/5] IB/mlx5: Add mmap support for VAR
Date: Thu, 12 Dec 2019 13:09:28 +0200	[thread overview]
Message-ID: <20191212110928.334995-6-leon@kernel.org> (raw)
In-Reply-To: <20191212110928.334995-1-leon@kernel.org>

From: Yishai Hadas <yishaih@mellanox.com>

Add mmap support for VAR, it uses the 'offset' command mode with
involvement of IB core APIs to find the previously allocated mmap entry.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 873480b07686..52bc86ab9490 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,
-- 
2.20.1


  parent reply	other threads:[~2019-12-12 11:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 11:09 [PATCH rdma-next 0/5] VIRTIO_NET Emulation Offload Leon Romanovsky
2019-12-12 11:09 ` [PATCH mlx5-next 1/5] net/mlx5: Add Virtio Emulation related device capabilities Leon Romanovsky
2019-12-12 11:09 ` [PATCH mlx5-next 2/5] net/mlx5: Expose vDPA emulation " Leon Romanovsky
2019-12-12 11:09 ` [PATCH rdma-next 3/5] IB/mlx5: Extend caps stage to handle VAR capabilities Leon Romanovsky
2019-12-12 11:09 ` [PATCH rdma-next 4/5] IB/mlx5: Introduce VAR object and its alloc/destroy methods Leon Romanovsky
2020-01-07 19:36   ` Jason Gunthorpe
2020-01-08  8:12     ` Yishai Hadas
2019-12-12 11:09 ` Leon Romanovsky [this message]
2020-01-07 19:37 ` [PATCH rdma-next 0/5] VIRTIO_NET Emulation Offload Jason Gunthorpe
2020-01-10 18:30   ` Leon Romanovsky
2020-01-12 23:54     ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191212110928.334995-6-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=yishaih@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).