]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
qed: rdma - don't wait for resources under hw error recovery flow
authorShai Malin <smalin@marvell.com>
Wed, 22 Sep 2021 10:53:26 +0000 (13:53 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:20:16 +0000 (10:20 +0100)
BugLink: https://bugs.launchpad.net/bugs/1949640
[ Upstream commit 1ea7812326004afd2803cc968a4776ae5120a597 ]

If the HW device is during recovery, the HW resources will never return,
hence we shouldn't wait for the CID (HW context ID) bitmaps to clear.
This fix speeds up the error recovery flow.

Fixes: 64515dc899df ("qed: Add infrastructure for error detection and recovery")
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/qlogic/qed/qed_iwarp.c
drivers/net/ethernet/qlogic/qed/qed_roce.c

index a99861124630a5e59ed6263d7b219b4ef8ea5a5b..68fbe536a1f32bc5b56576cc3cc69725fef18074 100644 (file)
@@ -1297,6 +1297,14 @@ qed_iwarp_wait_cid_map_cleared(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap)
        prev_weight = weight;
 
        while (weight) {
+               /* If the HW device is during recovery, all resources are
+                * immediately reset without receiving a per-cid indication
+                * from HW. In this case we don't expect the cid_map to be
+                * cleared.
+                */
+               if (p_hwfn->cdev->recov_in_prog)
+                       return 0;
+
                msleep(QED_IWARP_MAX_CID_CLEAN_TIME);
 
                weight = bitmap_weight(bmap->bitmap, bmap->max_count);
index f16a157bb95a08d58b84541921cdd16fac960d84..cf5baa5e59bcc91573ff5859f7826629c27767f8 100644 (file)
@@ -77,6 +77,14 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
         * Beyond the added delay we clear the bitmap anyway.
         */
        while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) {
+               /* If the HW device is during recovery, all resources are
+                * immediately reset without receiving a per-cid indication
+                * from HW. In this case we don't expect the cid bitmap to be
+                * cleared.
+                */
+               if (p_hwfn->cdev->recov_in_prog)
+                       return;
+
                msleep(100);
                if (wait_count++ > 20) {
                        DP_NOTICE(p_hwfn, "cid bitmap wait timed out\n");