diff options
author | Artemy Kovalyov <artemyko@mellanox.com> | 2017-04-05 09:23:55 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-04-25 15:40:28 -0400 |
commit | 403cd12e2cf759ead5cbdcb62bf9872b9618d400 (patch) | |
tree | 79699ef47b0813f8f7f861f6a92397fb67b00da5 /include/rdma | |
parent | 4df4a5bac3264efa0595b52b2a9cd5274b32f0d4 (diff) | |
download | blackbird-op-linux-403cd12e2cf759ead5cbdcb62bf9872b9618d400.tar.gz blackbird-op-linux-403cd12e2cf759ead5cbdcb62bf9872b9618d400.zip |
IB/umem: Add contiguous ODP support
Currenlty ODP supports only regular MMU pages.
Add ODP support for regions consisting of physically contiguous chunks
of arbitrary order (huge pages for instance) to improve performance.
Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/ib_umem.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rdma/ib_umem.h b/include/rdma/ib_umem.h index 7f4af1e1ae64..23159dd5be18 100644 --- a/include/rdma/ib_umem.h +++ b/include/rdma/ib_umem.h @@ -72,12 +72,12 @@ static inline unsigned long ib_umem_start(struct ib_umem *umem) /* Returns the address of the page after the last one of an ODP umem. */ static inline unsigned long ib_umem_end(struct ib_umem *umem) { - return PAGE_ALIGN(umem->address + umem->length); + return ALIGN(umem->address + umem->length, BIT(umem->page_shift)); } static inline size_t ib_umem_num_pages(struct ib_umem *umem) { - return (ib_umem_end(umem) - ib_umem_start(umem)) >> PAGE_SHIFT; + return (ib_umem_end(umem) - ib_umem_start(umem)) >> umem->page_shift; } #ifdef CONFIG_INFINIBAND_USER_MEM |