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>
This commit is contained in:
parent
2157f5caae
commit
137d264c6f
|
@ -85,7 +85,7 @@ extern struct auxiliary_driver i40iw_auxiliary_drv;
|
||||||
#define IRDMA_NO_QSET 0xffff
|
#define IRDMA_NO_QSET 0xffff
|
||||||
|
|
||||||
#define IW_CFG_FPM_QP_COUNT 32768
|
#define IW_CFG_FPM_QP_COUNT 32768
|
||||||
#define IRDMA_MAX_PAGES_PER_FMR 512
|
#define IRDMA_MAX_PAGES_PER_FMR 262144
|
||||||
#define IRDMA_MIN_PAGES_PER_FMR 1
|
#define IRDMA_MIN_PAGES_PER_FMR 1
|
||||||
#define IRDMA_CQP_COMPL_RQ_WQE_FLUSHED 2
|
#define IRDMA_CQP_COMPL_RQ_WQE_FLUSHED 2
|
||||||
#define IRDMA_CQP_COMPL_SQ_WQE_FLUSHED 3
|
#define IRDMA_CQP_COMPL_SQ_WQE_FLUSHED 3
|
||||||
|
|
|
@ -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;
|
palloc = &iwpbl->pble_alloc;
|
||||||
iwmr->page_cnt = max_num_sg;
|
iwmr->page_cnt = max_num_sg;
|
||||||
err_code = irdma_get_pble(iwdev->rf->pble_rsrc, palloc, iwmr->page_cnt,
|
err_code = irdma_get_pble(iwdev->rf->pble_rsrc, palloc, iwmr->page_cnt,
|
||||||
true);
|
false);
|
||||||
if (err_code)
|
if (err_code)
|
||||||
goto err_get_pble;
|
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))
|
if (unlikely(iwmr->npages == iwmr->page_cnt))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
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 = palloc->level1.addr;
|
||||||
pbl[iwmr->npages++] = addr;
|
pbl[iwmr->npages] = addr;
|
||||||
|
}
|
||||||
|
iwmr->npages++;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue