Skip to content

Commit 90e3edd

Browse files
gal-pressmanjgunthorpe
authored andcommitted
RDMA/bnxt_re: Make use of create 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 2553ba2 commit 90e3edd

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
@@ -723,7 +723,8 @@ struct ib_ah *bnxt_re_create_ah(struct ib_pd *ib_pd,
723723
}
724724

725725
memcpy(ah->qplib_ah.dmac, ah_attr->roce.dmac, ETH_ALEN);
726-
rc = bnxt_qplib_create_ah(&rdev->qplib_res, &ah->qplib_ah);
726+
rc = bnxt_qplib_create_ah(&rdev->qplib_res, &ah->qplib_ah,
727+
!(flags & RDMA_CREATE_AH_SLEEPABLE));
727728
if (rc) {
728729
dev_err(rdev_to_dev(rdev), "Failed to allocate HW AH");
729730
goto fail;
@@ -959,7 +960,7 @@ static struct bnxt_re_ah *bnxt_re_create_shadow_qp_ah
959960
/* Have DMAC same as SMAC */
960961
ether_addr_copy(ah->qplib_ah.dmac, rdev->netdev->dev_addr);
961962

962-
rc = bnxt_qplib_create_ah(&rdev->qplib_res, &ah->qplib_ah);
963+
rc = bnxt_qplib_create_ah(&rdev->qplib_res, &ah->qplib_ah, false);
963964
if (rc) {
964965
dev_err(rdev_to_dev(rdev),
965966
"Failed to allocate 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
@@ -488,7 +488,8 @@ int bnxt_qplib_add_pkey(struct bnxt_qplib_res *res,
488488
}
489489

490490
/* AH */
491-
int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah)
491+
int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah,
492+
bool block)
492493
{
493494
struct bnxt_qplib_rcfw *rcfw = res->rcfw;
494495
struct cmdq_create_ah req;
@@ -522,7 +523,7 @@ int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah)
522523
req.dest_mac[2] = cpu_to_le16(temp16[2]);
523524

524525
rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
525-
NULL, 1);
526+
NULL, block);
526527
if (rc)
527528
return rc;
528529

drivers/infiniband/hw/bnxt_re/qplib_sp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
241241
int bnxt_qplib_set_func_resources(struct bnxt_qplib_res *res,
242242
struct bnxt_qplib_rcfw *rcfw,
243243
struct bnxt_qplib_ctx *ctx);
244-
int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah);
244+
int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah,
245+
bool block);
245246
int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah);
246247
int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res,
247248
struct bnxt_qplib_mrw *mrw);

0 commit comments

Comments
 (0)