RDMA/bnxt_re: Bug fixes
Subsystems (2)
Selvin Xavier
maintainercover RDMA/bnxt_re: Bug fixes
Includes some of the minor bug fixes in bnxt_re. Please review and apply.
Thanks,
Selvin Xavier
Kalesh AP (5):
RDMA/bnxt_re: Avoid creating fence MR for newer adapters RDMA/bnxt_re: Remove a redundant check inside bnxt_re_vf_res_config RDMA/bnxt_re: Fix unconditional fence for newer adapters RDMA/bnxt_re: Return error for SRQ resize
RDMA/bnxt_re: Add a missing check in bnxt_qplib_query_srq
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 43 +++++++++++++++++++++----------- drivers/infiniband/hw/bnxt_re/main.c | 3 --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 3 ++- 3 files changed, 30 insertions(+), 19 deletions(-)
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 1/5 RDMA/bnxt_re: Avoid creating fence MR for newer adapters
From: Kalesh AP <[email protected]>
Limit the usage of fence MR to adapters older than Gen P5 products.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +10 -0
@@ -401,6 +401,10 @@ static void bnxt_re_create_fence_wqe(struct bnxt_re_pd *pd)struct bnxt_re_fence_data *fence = &pd->fence;struct ib_mr *ib_mr = &fence->mr->ib_mr;struct bnxt_qplib_swqe *wqe = &fence->bind_wqe; +struct bnxt_re_dev *rdev = pd->rdev; + +if (bnxt_qplib_is_chip_gen_p5_p7 (rdev->chip_ctx)) +return ;memset (wqe,0 ,sizeof (*wqe)); wqe->type =BNXT_QPLIB_SWQE_TYPE_BIND_MW ;
@@ -455,6 +459,9 @@ static void bnxt_re_destroy_fence_mr(struct bnxt_re_pd *pd)struct device *dev = &rdev->en_dev->pdev->dev;struct bnxt_re_mr *mr = fence->mr; +if (bnxt_qplib_is_chip_gen_p5_p7 (rdev->chip_ctx)) +return ; +if (fence->mw) {bnxt_re_dealloc_mw (fence->mw); fence->mw =NULL ;
@@ -486,6 +493,9 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)struct ib_mw *mw;int rc; +if (bnxt_qplib_is_chip_gen_p5_p7 (rdev->chip_ctx)) +return 0 ; + dma_addr =dma_map_single (dev, fence->va,BNXT_RE_FENCE_BYTES ,DMA_BIDIRECTIONAL ); rc =dma_mapping_error (dev, dma_addr);
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 2/5 RDMA/bnxt_re: Remove a redundant check inside bnxt_re_vf_res_config
In reply to Selvin XavierFrom: Kalesh AP <[email protected]>
After the cited commit, there is no possibility that this check can return true. Remove it.
--- drivers/infiniband/hw/bnxt_re/main.c | 3 --- 1 file changed, 3 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +0 -3
@@ -280,9 +280,6 @@ static void bnxt_re_set_resource_limits(struct bnxt_re_dev *rdev)static void bnxt_re_vf_res_config (struct bnxt_re_dev *rdev) { - -if (test_bit (BNXT_RE_FLAG_ERR_DEVICE_DETACHED , &rdev->flags)) -return ; rdev->num_vfs =pci_sriov_get_totalvfs (rdev->en_dev->pdev);if (!bnxt_qplib_is_chip_gen_p5_p7 (rdev->chip_ctx)) {bnxt_re_set_resource_limits (rdev);
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 3/5 RDMA/bnxt_re: Fix unconditional fence for newer adapters
In reply to Selvin XavierFrom: Kalesh AP <[email protected]>
Older adapters required an unconditional fence for non-wire memory operations. Newer adapters doesn't require this and therefore, disabling the unconditional fence.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +16 -12
@@ -2566,11 +2566,6 @@ static int bnxt_re_build_inv_wqe(const struct ib_send_wr *wr, wqe->type =BNXT_QPLIB_SWQE_TYPE_LOCAL_INV ; wqe->local_inv.inv_l_key = wr->ex.invalidate_rkey; -/* Need unconditional fence for local invalidate -* opcode to work as expected. -*/ - wqe->flags |=BNXT_QPLIB_SWQE_FLAGS_UC_FENCE ; -if (wr->send_flags &IB_SEND_SIGNALED ) wqe->flags |=BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP ;if (wr->send_flags &IB_SEND_SOLICITED )
@@ -2593,12 +2588,6 @@ static int bnxt_re_build_reg_wqe(const struct ib_reg_wr *wr, wqe->frmr.levels = qplib_frpl->hwq.level; wqe->type =BNXT_QPLIB_SWQE_TYPE_REG_MR ; -/* Need unconditional fence for reg_mr -* opcode to function as expected. -*/ - - wqe->flags |=BNXT_QPLIB_SWQE_FLAGS_UC_FENCE ; -if (wr->wr.send_flags &IB_SEND_SIGNALED ) wqe->flags |=BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP ;
@@ -2729,6 +2718,18 @@ static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,return rc; } +static void bnxt_re_legacy_set_uc_fence (struct bnxt_qplib_swqe *wqe) +{ +/* Need unconditional fence for non-wire memory opcode +* to work as expected. +*/ +if (wqe->type ==BNXT_QPLIB_SWQE_TYPE_LOCAL_INV || + wqe->type ==BNXT_QPLIB_SWQE_TYPE_FAST_REG_MR || + wqe->type ==BNXT_QPLIB_SWQE_TYPE_REG_MR || + wqe->type ==BNXT_QPLIB_SWQE_TYPE_BIND_MW ) + wqe->flags |=BNXT_QPLIB_SWQE_FLAGS_UC_FENCE ; +} +int bnxt_re_post_send (struct ib_qp *ib_qp,const struct ib_send_wr *wr,const struct ib_send_wr **bad_wr) {
@@ -2808,8 +2809,11 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr, rc = -EINVAL ; goto bad; } -if (!rc) +if (!rc) { +if (!bnxt_qplib_is_chip_gen_p5_p7 (qp->rdev->chip_ctx)) +bnxt_re_legacy_set_uc_fence (&wqe); rc =bnxt_qplib_post_send (&qp->qplib_qp, &wqe); + } bad:if (rc) { ibdev_err(&qp->rdev->ibdev,
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 4/5 RDMA/bnxt_re: Return error for SRQ resize
In reply to Selvin XavierFrom: Kalesh AP <[email protected]>
SRQ resize is not supported in the driver. But driver is not returning error from bnxt_re_modify_srq() for SRQ resize.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +2 -3
@@ -1827,7 +1827,7 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,switch (srq_attr_mask) {case IB_SRQ_MAX_WR :/* SRQ resize is not supported */ -break ; +return -EINVAL ;case IB_SRQ_LIMIT :/* Change the SRQ threshold */ if (srq_attr->srq_limit > srq->qplib_srq.max_wqe)
@@ -1842,13 +1842,12 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,/* On success, update the shadow */ srq->srq_limit = srq_attr->srq_limit;/* No need to Build and send response back to udata */ -break ; +return 0 ;default :ibdev_err (&rdev->ibdev,"Unsupported srq_attr_mask 0x%x" , srq_attr_mask);return -EINVAL ; } -return 0 ; }int bnxt_re_query_srq (struct ib_srq *ib_srq,struct ib_srq_attr *srq_attr)
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 5/5 RDMA/bnxt_re: Add a missing check in bnxt_qplib_query_srq
In reply to Selvin XavierFrom: Kalesh AP <[email protected]>
Before populating the response, driver has to check the status of HWRM command.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -1
@@ -744,7 +744,8 @@ int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,bnxt_qplib_fill_cmdqmsg (&msg, &req, &resp, &sbuf,sizeof (req),sizeof (resp),0 ); rc =bnxt_qplib_rcfw_send_message (rcfw, &msg); - srq->threshold =le16_to_cpu (sb->srq_limit); +if (!rc) + srq->threshold =le16_to_cpu (sb->srq_limit);dma_free_coherent (&rcfw->pdev->dev, sbuf.size, sbuf.sb, sbuf.dma_addr);
Signature · 1 line
2.5.5
Leon Romanovsky
AppliedQuoted 6 lines · Selvin Xavier
Includes some of the minor bug fixes in
bnxt_re. Please review and apply.Thanks,
Selvin Xavier
Quoted 8 lines
Kalesh AP (5):
RDMA/bnxt_re: Avoid creating fence MR for newer adapters RDMA/bnxt_re: Remove a redundant check insidebnxt_re_vf_res_configRDMA/bnxt_re: Fix unconditional fence for newer adapters RDMA/bnxt_re: Return error for SRQ resize
RDMA/bnxt_re: Add a missing check inbnxt_qplib_query_srq[...]
Applied, thanks!
[1/5] RDMA/bnxt_re: Avoid creating fence MR for newer adapters
https://git.kernel.org/rdma/rdma/c/282fd66e2ef6e5 [2/5] RDMA/bnxt_re: Remove a redundant check inside bnxt_re_vf_res_config https://git.kernel.org/rdma/rdma/c/8fcbf0a55f71be [3/5] RDMA/bnxt_re: Fix unconditional fence for newer adapters https://git.kernel.org/rdma/rdma/c/8eaca6b5997bd8 [4/5] RDMA/bnxt_re: Return error for SRQ resize https://git.kernel.org/rdma/rdma/c/3687b450c5f32e [5/5] RDMA/bnxt_re: Add a missing check in bnxt_qplib_query_srq https://git.kernel.org/rdma/rdma/c/80dde187f734cf
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>