RDMA/mlx5: Embed into the code flow the ODP config option
Convert various places to more readable code, which embeds CONFIG_INFINIBAND_ON_DEMAND_PAGING into the code flow. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:

committed by
Jason Gunthorpe

parent
8b4d5bc5cf
commit
13859d5df4
@@ -83,6 +83,19 @@ static inline struct ib_umem_odp *to_ib_umem_odp(struct ib_umem *umem)
|
||||
return container_of(umem, struct ib_umem_odp, umem);
|
||||
}
|
||||
|
||||
/*
|
||||
* The lower 2 bits of the DMA address signal the R/W permissions for
|
||||
* the entry. To upgrade the permissions, provide the appropriate
|
||||
* bitmask to the map_dma_pages function.
|
||||
*
|
||||
* Be aware that upgrading a mapped address might result in change of
|
||||
* the DMA address for the page.
|
||||
*/
|
||||
#define ODP_READ_ALLOWED_BIT (1<<0ULL)
|
||||
#define ODP_WRITE_ALLOWED_BIT (1<<1ULL)
|
||||
|
||||
#define ODP_DMA_ADDR_MASK (~(ODP_READ_ALLOWED_BIT | ODP_WRITE_ALLOWED_BIT))
|
||||
|
||||
#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
|
||||
|
||||
struct ib_ucontext_per_mm {
|
||||
@@ -107,19 +120,6 @@ struct ib_umem_odp *ib_alloc_odp_umem(struct ib_ucontext_per_mm *per_mm,
|
||||
unsigned long addr, size_t size);
|
||||
void ib_umem_odp_release(struct ib_umem_odp *umem_odp);
|
||||
|
||||
/*
|
||||
* The lower 2 bits of the DMA address signal the R/W permissions for
|
||||
* the entry. To upgrade the permissions, provide the appropriate
|
||||
* bitmask to the map_dma_pages function.
|
||||
*
|
||||
* Be aware that upgrading a mapped address might result in change of
|
||||
* the DMA address for the page.
|
||||
*/
|
||||
#define ODP_READ_ALLOWED_BIT (1<<0ULL)
|
||||
#define ODP_WRITE_ALLOWED_BIT (1<<1ULL)
|
||||
|
||||
#define ODP_DMA_ADDR_MASK (~(ODP_READ_ALLOWED_BIT | ODP_WRITE_ALLOWED_BIT))
|
||||
|
||||
int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 start_offset,
|
||||
u64 bcnt, u64 access_mask,
|
||||
unsigned long current_seq);
|
||||
|
Reference in New Issue
Block a user