diff options
author | Mustafa Ismail <mustafa.ismail@intel.com> | 2022-07-05 18:08:09 -0500 |
---|---|---|
committer | Leon Romanovsky <leonro@nvidia.com> | 2022-07-18 10:39:28 +0300 |
commit | 137d264c6f63f5b57200b8becb00d7cc58163c05 (patch) | |
tree | 1d6a2413d77d7f84d1f2b381ae5d04daa2916be8 /drivers/infiniband/hw/irdma/verbs.c | |
parent | 2157f5caaed59128d70a1dd72f5ec809cad54407 (diff) | |
download | lwn-137d264c6f63f5b57200b8becb00d7cc58163c05.tar.gz lwn-137d264c6f63f5b57200b8becb00d7cc58163c05.zip |
RDMA/irdma: Add 2 level PBLE support for FMR
Level 2 Physical Buffer List Entry (PBLE) is currently not supported for
Fast MRs which limits memory registrations to 256K pages.
Adapt irdma_set_page and irdma_alloc_mr to allow for 2 level PBLEs.
Link: https://lore.kernel.org/r/20220705230815.265-2-shiraz.saleem@intel.com
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw/irdma/verbs.c')
-rw-r--r-- | drivers/infiniband/hw/irdma/verbs.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index c4412ece5a6d..0f5856bd1dde 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -2605,7 +2605,7 @@ static struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type, palloc = &iwpbl->pble_alloc; iwmr->page_cnt = max_num_sg; err_code = irdma_get_pble(iwdev->rf->pble_rsrc, palloc, iwmr->page_cnt, - true); + false); if (err_code) goto err_get_pble; @@ -2641,8 +2641,16 @@ static int irdma_set_page(struct ib_mr *ibmr, u64 addr) if (unlikely(iwmr->npages == iwmr->page_cnt)) return -ENOMEM; - pbl = palloc->level1.addr; - pbl[iwmr->npages++] = addr; + if (palloc->level == PBLE_LEVEL_2) { + struct irdma_pble_info *palloc_info = + palloc->level2.leaf + (iwmr->npages >> PBLE_512_SHIFT); + + palloc_info->addr[iwmr->npages & (PBLE_PER_PAGE - 1)] = addr; + } else { + pbl = palloc->level1.addr; + pbl[iwmr->npages] = addr; + } + iwmr->npages++; return 0; } |