Skip to content

Commit 50c582d

Browse files
gal-pressmanjgunthorpe
authored andcommitted
RDMA/bnxt_re: Make use of destroy AH sleepable flag
When in a sleepable (non-atomic) context, wait for firmware completion instead of polling for it. Signed-off-by: Gal Pressman <[email protected]> Acked-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 90e3edd commit 50c582d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,8 @@ int bnxt_re_destroy_ah(struct ib_ah *ib_ah, u32 flags)
653653
struct bnxt_re_dev *rdev = ah->rdev;
654654
int rc;
655655

656-
rc = bnxt_qplib_destroy_ah(&rdev->qplib_res, &ah->qplib_ah);
656+
rc = bnxt_qplib_destroy_ah(&rdev->qplib_res, &ah->qplib_ah,
657+
!(flags & RDMA_DESTROY_AH_SLEEPABLE));
657658
if (rc) {
658659
dev_err(rdev_to_dev(rdev), "Failed to destroy HW AH");
659660
return rc;
@@ -820,7 +821,7 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp)
820821

821822
if (ib_qp->qp_type == IB_QPT_GSI && rdev->qp1_sqp) {
822823
rc = bnxt_qplib_destroy_ah(&rdev->qplib_res,
823-
&rdev->sqp_ah->qplib_ah);
824+
&rdev->sqp_ah->qplib_ah, false);
824825
if (rc) {
825826
dev_err(rdev_to_dev(rdev),
826827
"Failed to destroy HW AH for shadow QP");

drivers/infiniband/hw/bnxt_re/qplib_sp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah,
531531
return 0;
532532
}
533533

534-
int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah)
534+
int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah,
535+
bool block)
535536
{
536537
struct bnxt_qplib_rcfw *rcfw = res->rcfw;
537538
struct cmdq_destroy_ah req;
@@ -545,7 +546,7 @@ int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah)
545546
req.ah_cid = cpu_to_le32(ah->id);
546547

547548
rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
548-
NULL, 1);
549+
NULL, block);
549550
if (rc)
550551
return rc;
551552
return 0;

drivers/infiniband/hw/bnxt_re/qplib_sp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ int bnxt_qplib_set_func_resources(struct bnxt_qplib_res *res,
243243
struct bnxt_qplib_ctx *ctx);
244244
int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah,
245245
bool block);
246-
int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah);
246+
int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah,
247+
bool block);
247248
int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res,
248249
struct bnxt_qplib_mrw *mrw);
249250
int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw,

0 commit comments

Comments
 (0)