Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755528AbbGQTBm (ORCPT ); Fri, 17 Jul 2015 15:01:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46620 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755448AbbGQTB1 (ORCPT ); Fri, 17 Jul 2015 15:01:27 -0400 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= To: , Cc: Christophe Harle , Duncan Poole , Sherry Cheung , Subhash Gutti , John Hubbard , Mark Hairgrove , Lucien Dunning , Cameron Buschardt , Arvind Gopalakrishnan , Haggai Eran , Shachar Raindel , Liran Liss , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= Subject: [PATCH 8/8] IB/mlx5/hmm: enable ODP using HMM. Date: Fri, 17 Jul 2015 15:01:05 -0400 Message-Id: <1437159665-6612-9-git-send-email-jglisse@redhat.com> In-Reply-To: <1437159665-6612-1-git-send-email-jglisse@redhat.com> References: <1437159665-6612-1-git-send-email-jglisse@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2351 Lines: 54 All pieces are in place for ODP (on demand paging) to work using HMM. Signed-off-by: Jérôme Glisse --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/