diff options
author | Kashyap Desai <kashyap.desai@broadcom.com> | 2023-06-09 04:01:50 -0700 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-06-12 10:10:17 +0300 |
commit | bb8c93618fb0b8567d309f1aebc6df0cd31da1a2 (patch) | |
tree | 249e71a2e6a8d00ab011ec4bef4aaea5b4047051 /drivers/infiniband/hw/bnxt_re/ib_verbs.c | |
parent | 84911cf3b2aa8d0a1e563d346c852131582cb871 (diff) | |
download | linux-stable-bb8c93618fb0b8567d309f1aebc6df0cd31da1a2.tar.gz linux-stable-bb8c93618fb0b8567d309f1aebc6df0cd31da1a2.tar.bz2 linux-stable-bb8c93618fb0b8567d309f1aebc6df0cd31da1a2.zip |
RDMA/bnxt_re: consider timeout of destroy ah as success.
If destroy_ah is timed out, it is likely to be destroyed by firmware
but it is taking longer time due to temporary slowness
in processing the rcfw command. In worst case, there might be
AH resource leak in firmware.
Sending timeout return value can dump warning message from ib_core
which can be avoided if we map timeout of destroy_ah as success.
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/1686308514-11996-14-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/ib_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/ib_verbs.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index e86afecfbe46..053afc9f1256 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -613,12 +613,20 @@ int bnxt_re_destroy_ah(struct ib_ah *ib_ah, u32 flags) { struct bnxt_re_ah *ah = container_of(ib_ah, struct bnxt_re_ah, ib_ah); struct bnxt_re_dev *rdev = ah->rdev; + bool block = true; + int rc = 0; - bnxt_qplib_destroy_ah(&rdev->qplib_res, &ah->qplib_ah, - !(flags & RDMA_DESTROY_AH_SLEEPABLE)); + block = !(flags & RDMA_DESTROY_AH_SLEEPABLE); + rc = bnxt_qplib_destroy_ah(&rdev->qplib_res, &ah->qplib_ah, block); + if (BNXT_RE_CHECK_RC(rc)) { + if (rc == -ETIMEDOUT) + rc = 0; + else + goto fail; + } atomic_dec(&rdev->ah_count); - - return 0; +fail: + return rc; } static u8 bnxt_re_stack_to_dev_nw_type(enum rdma_network_type ntype) |