]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bnxt: disable napi before canceling DIM
authorJakub Kicinski <kuba@kernel.org>
Thu, 12 Aug 2021 21:42:40 +0000 (14:42 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Aug 2021 17:26:17 +0000 (10:26 -0700)
napi schedules DIM, napi has to be disabled first,
then DIM canceled.

Noticed while reading the code.

Fixes: 0bc0b97fca73 ("bnxt_en: cleanup DIM work on device shutdown")
Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 84aa258750508231e07f5ac3ac816416dc3648ee..721b5df363111a31e8164bba516aebb497bb50f0 100644 (file)
@@ -9134,10 +9134,9 @@ static void bnxt_disable_napi(struct bnxt *bp)
        for (i = 0; i < bp->cp_nr_rings; i++) {
                struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
 
+               napi_disable(&bp->bnapi[i]->napi);
                if (bp->bnapi[i]->rx_ring)
                        cancel_work_sync(&cpr->dim.work);
-
-               napi_disable(&bp->bnapi[i]->napi);
        }
 }