diff options
author | Jérôme Glisse <jglisse@redhat.com> | 2015-04-06 10:40:34 -0400 |
---|---|---|
committer | Jérôme Glisse <jglisse@redhat.com> | 2016-04-07 13:24:08 -0400 |
commit | eaf748052b3f3fabc473452ae75d933078b1a26b (patch) | |
tree | 7c6350aadf6e25cee25aa0a024df034448cf0254 | |
parent | 2b60f40a4b58a1b05db36c98d805d9b1871bda5f (diff) |
ib/mlx5/hmm: enable odp using hmm v2hmm
All pieces are in place for odp (on demand paging) to work using hmm.
Add kernel option and final code to enable it.
Changed since v1:
- Added kernel option in this last patch of the serie.
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
-rw-r--r-- | drivers/infiniband/Kconfig | 10 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index 6425c0e5d18a..019a8dda9ec8 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig @@ -50,6 +50,16 @@ config INFINIBAND_ON_DEMAND_PAGING memory regions without pinning their pages, fetching the pages on demand instead. +config INFINIBAND_ON_DEMAND_PAGING_HMM + bool "InfiniBand on-demand paging support using HMM." + depends on HMM + depends on INFINIBAND_ON_DEMAND_PAGING + default n + ---help--- + Use HMM (heterogeneous memory management) kernel API for + on demand paging. No userspace difference, this is just + an alternative implementation of the feature. + config INFINIBAND_ADDR_TRANS bool depends on INFINIBAND diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index fe63a302e13c..7e915827d376 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -556,6 +556,10 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, #if IS_ENABLED(CONFIG_INFINIBAND_ON_DEMAND_PAGING) #if IS_ENABLED(CONFIG_INFINIBAND_ON_DEMAND_PAGING_HMM) + 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; |