diff options
| author | Selvin Xavier <[email protected]> | 2021-09-15 12:32:39 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2021-09-20 16:37:02 +0000 |
| commit | 2b4ccce6cafae8eff0daec06b7652d9ab75f692f (patch) | |
| tree | 81429704fb514bd37488b8499232db82fcbc5f81 /drivers/infiniband/hw/bnxt_re/qplib_res.c | |
| parent | RDMA/bnxt_re: Fix query SRQ failure (diff) | |
| download | kernel-2b4ccce6cafae8eff0daec06b7652d9ab75f692f.tar.gz kernel-2b4ccce6cafae8eff0daec06b7652d9ab75f692f.zip | |
RDMA/bnxt_re: Fix FRMR issue with single page MR allocation
When the FRMR is allocated with single page, driver is attempting to
create a level 0 HWQ and not allocating any page because the nopte field
is set. This causes the crash during post_send as the pbl is not
populated.
To avoid this crash, check for the nopte bit during HWQ creation with
single page and create a level 1 page table and populate the pbl address
correctly.
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Selvin Xavier <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/qplib_res.c')
| -rw-r--r-- | drivers/infiniband/hw/bnxt_re/qplib_res.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index 44282a8cdd4f..bf49363f590e 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -228,15 +228,16 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq, npages++; } - if (npages == MAX_PBL_LVL_0_PGS) { + if (npages == MAX_PBL_LVL_0_PGS && !hwq_attr->sginfo->nopte) { /* This request is Level 0, map PTE */ rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_0], hwq_attr->sginfo); if (rc) goto fail; hwq->level = PBL_LVL_0; + goto done; } - if (npages > MAX_PBL_LVL_0_PGS) { + if (npages >= MAX_PBL_LVL_0_PGS) { if (npages > MAX_PBL_LVL_1_PGS) { u32 flag = (hwq_attr->type == HWQ_TYPE_L2_CMPL) ? 0 : PTU_PTE_VALID; |
