public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Glisse" <jglisse@redhat.com>
To: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org
Cc: "Christophe Harle" <charle@nvidia.com>,
	"Duncan Poole" <dpoole@nvidia.com>,
	"Sherry Cheung" <SCheung@nvidia.com>,
	"Subhash Gutti" <sgutti@nvidia.com>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Mark Hairgrove" <mhairgrove@nvidia.com>,
	"Lucien Dunning" <ldunning@nvidia.com>,
	"Cameron Buschardt" <cabuschardt@nvidia.com>,
	"Arvind Gopalakrishnan" <arvindg@nvidia.com>,
	"Haggai Eran" <haggaie@mellanox.com>,
	"Shachar Raindel" <raindel@mellanox.com>,
	"Liran Liss" <liranl@mellanox.com>,
	"Jérôme Glisse" <jglisse@redhat.com>
Subject: [PATCH 8/8] IB/mlx5/hmm: enable ODP using HMM.
Date: Fri, 17 Jul 2015 15:01:05 -0400	[thread overview]
Message-ID: <1437159665-6612-9-git-send-email-jglisse@redhat.com> (raw)
In-Reply-To: <1437159665-6612-1-git-send-email-jglisse@redhat.com>

All pieces are in place for ODP (on demand paging) to work using HMM.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
---
 drivers/infiniband/core/uverbs_cmd.c | 4 ----
 drivers/infiniband/hw/mlx5/main.c    | 5 ++++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 165c9cd..c5c9bf0 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -3444,9 +3444,6 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
 		goto end;
 
 #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
-#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM
-#error "CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM not supported at this stage !"
-#else /* CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM */
 	resp.odp_caps.general_caps = attr.odp_caps.general_caps;
 	resp.odp_caps.per_transport_caps.rc_odp_caps =
 		attr.odp_caps.per_transport_caps.rc_odp_caps;
@@ -3455,7 +3452,6 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
 	resp.odp_caps.per_transport_caps.ud_odp_caps =
 		attr.odp_caps.per_transport_caps.ud_odp_caps;
 	resp.odp_caps.reserved = 0;
-#endif /* CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM */
 #else /* CONFIG_INFINIBAND_ON_DEMAND_PAGING */
 	memset(&resp.odp_caps, 0, sizeof(resp.odp_caps));
 #endif /* CONFIG_INFINIBAND_ON_DEMAND_PAGING */
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index b731d06..1ba31d4 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -295,7 +295,10 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 
 #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
 #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM
-#error "CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM not supported at this stage !"
+	if (MLX5_CAP_GEN(mdev, pg) && ibdev->hmm_ready) {
+		props->device_cap_flags |= IB_DEVICE_ON_DEMAND_PAGING;
+		props->odp_caps = dev->odp_caps;
+	}
 #else /* CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM */
 	if (MLX5_CAP_GEN(mdev, pg))
 		props->device_cap_flags |= IB_DEVICE_ON_DEMAND_PAGING;
-- 
1.9.3

      parent reply	other threads:[~2015-07-17 19:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-17 19:00 [PATCH 0/8] Add ODP support using HMM Jérôme Glisse
2015-07-17 19:00 ` [PATCH 1/8] IB/mlx5: add a new parameter to __mlx_ib_populated_pas for ODP with HMM Jérôme Glisse
2015-07-17 19:00 ` [PATCH 2/8] IB/mlx5: add a new parameter to mlx5_ib_update_mtt() " Jérôme Glisse
2015-07-17 19:01 ` [PATCH 3/8] IB/odp: export rbt_ib_umem_for_each_in_range() Jérôme Glisse
     [not found]   ` <1437159665-6612-4-git-send-email-jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-21  8:30     ` Haggai Eran
2015-07-17 19:01 ` [PATCH 4/8] IB/odp/hmm: add new kernel option to use HMM for ODP Jérôme Glisse
     [not found]   ` <1437159665-6612-5-git-send-email-jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-21 10:37     ` Haggai Eran
2015-07-17 19:01 ` [PATCH 5/8] IB/odp/hmm: add core infiniband structure and helper for ODP with HMM v2 Jérôme Glisse
2015-07-17 19:01 ` [PATCH 6/8] IB/mlx5/hmm: add mlx5 HMM device initialization and callback v3 Jérôme Glisse
     [not found]   ` <1437159665-6612-7-git-send-email-jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-21 10:44     ` Haggai Eran
2015-07-21 10:51   ` Haggai Eran
     [not found]     ` <55AE2431.20105-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-21 15:14       ` Jerome Glisse
     [not found]         ` <1450090324.1616771.1437491699456.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-21 16:06           ` Jason Gunthorpe
2015-07-17 19:01 ` [PATCH 7/8] IB/mlx5/hmm: add page fault support for ODP on HMM v2 Jérôme Glisse
2015-07-17 19:01 ` Jérôme Glisse [this message]

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=1437159665-6612-9-git-send-email-jglisse@redhat.com \
    --to=jglisse@redhat.com \
    --cc=SCheung@nvidia.com \
    --cc=arvindg@nvidia.com \
    --cc=cabuschardt@nvidia.com \
    --cc=charle@nvidia.com \
    --cc=dpoole@nvidia.com \
    --cc=haggaie@mellanox.com \
    --cc=jhubbard@nvidia.com \
    --cc=ldunning@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=liranl@mellanox.com \
    --cc=mhairgrove@nvidia.com \
    --cc=raindel@mellanox.com \
    --cc=sgutti@nvidia.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