Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/bnxt_re: Pass correct flag for dma mr creation

DMA MR doesn't use the unified MR model. So the lkey passed
on to the reg_mr command to FW should contain the correct
lkey. Driver is incorrectly over writing the lkey with pdid
and firmware commands fails due to this.

Avoid passing the wrong key for cases where the unified MR
registration is not used.

Fixes: f786eebbbefa ("RDMA/bnxt_re: Avoid an extra hwrm per MR creation")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/1763624215-10382-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Selvin Xavier and committed by
Leon Romanovsky
a26c4c7c 6afe40ff

+9 -7
+5 -3
drivers/infiniband/hw/bnxt_re/ib_verbs.c
··· 601 601 mr->qplib_mr.va = (u64)(unsigned long)fence->va; 602 602 mr->qplib_mr.total_size = BNXT_RE_FENCE_BYTES; 603 603 rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, NULL, 604 - BNXT_RE_FENCE_PBL_SIZE, PAGE_SIZE); 604 + BNXT_RE_FENCE_PBL_SIZE, PAGE_SIZE, 605 + _is_alloc_mr_unified(rdev->dev_attr->dev_cap_flags)); 605 606 if (rc) { 606 607 ibdev_err(&rdev->ibdev, "Failed to register fence-MR\n"); 607 608 goto fail; ··· 4033 4032 mr->qplib_mr.hwq.level = PBL_LVL_MAX; 4034 4033 mr->qplib_mr.total_size = -1; /* Infinte length */ 4035 4034 rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, NULL, 0, 4036 - PAGE_SIZE); 4035 + PAGE_SIZE, false); 4037 4036 if (rc) 4038 4037 goto fail_mr; 4039 4038 ··· 4263 4262 4264 4263 umem_pgs = ib_umem_num_dma_blocks(umem, page_size); 4265 4264 rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, umem, 4266 - umem_pgs, page_size); 4265 + umem_pgs, page_size, 4266 + _is_alloc_mr_unified(rdev->dev_attr->dev_cap_flags)); 4267 4267 if (rc) { 4268 4268 ibdev_err(&rdev->ibdev, "Failed to register user MR - rc = %d\n", rc); 4269 4269 rc = -EIO;
+3 -3
drivers/infiniband/hw/bnxt_re/qplib_sp.c
··· 578 578 } 579 579 580 580 int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, 581 - struct ib_umem *umem, int num_pbls, u32 buf_pg_size) 581 + struct ib_umem *umem, int num_pbls, u32 buf_pg_size, bool unified_mr) 582 582 { 583 583 struct bnxt_qplib_rcfw *rcfw = res->rcfw; 584 584 struct bnxt_qplib_hwq_attr hwq_attr = {}; ··· 640 640 req.access = (mr->access_flags & BNXT_QPLIB_MR_ACCESS_MASK); 641 641 req.va = cpu_to_le64(mr->va); 642 642 req.key = cpu_to_le32(mr->lkey); 643 - if (_is_alloc_mr_unified(res->dattr->dev_cap_flags)) 643 + if (unified_mr) 644 644 req.key = cpu_to_le32(mr->pd->id); 645 645 req.flags = cpu_to_le16(mr->flags); 646 646 req.mr_size = cpu_to_le64(mr->total_size); ··· 651 651 if (rc) 652 652 goto fail; 653 653 654 - if (_is_alloc_mr_unified(res->dattr->dev_cap_flags)) { 654 + if (unified_mr) { 655 655 mr->lkey = le32_to_cpu(resp.xid); 656 656 mr->rkey = mr->lkey; 657 657 }
+1 -1
drivers/infiniband/hw/bnxt_re/qplib_sp.h
··· 341 341 int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw, 342 342 bool block); 343 343 int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, 344 - struct ib_umem *umem, int num_pbls, u32 buf_pg_size); 344 + struct ib_umem *umem, int num_pbls, u32 buf_pg_size, bool unified_mr); 345 345 int bnxt_qplib_free_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr); 346 346 int bnxt_qplib_alloc_fast_reg_mr(struct bnxt_qplib_res *res, 347 347 struct bnxt_qplib_mrw *mr, int max);