Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, michael.chan@broadcom.com,
	prashant@broadcom.com, eddie.wai@broadcom.com,
	huangjw@broadcom.com, gospo@broadcom.com,
	edwin.peer@broadcom.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net v3 2/4] bnxt: disable napi before canceling DIM
Date: Thu, 12 Aug 2021 14:42:40 -0700	[thread overview]
Message-ID: <20210812214242.578039-3-kuba@kernel.org> (raw)
In-Reply-To: <20210812214242.578039-1-kuba@kernel.org>

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")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 84aa25875050..721b5df36311 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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);
 	}
 }
 
-- 
2.31.1


  parent reply	other threads:[~2021-08-12 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 21:42 [PATCH net v3 0/4] bnxt: Tx NAPI disabling resiliency improvements Jakub Kicinski
2021-08-12 21:42 ` [PATCH net v3 1/4] bnxt: don't lock the tx queue from napi poll Jakub Kicinski
2021-08-12 21:42 ` Jakub Kicinski [this message]
2021-08-12 21:42 ` [PATCH net v3 3/4] bnxt: make sure xmit_more + errors does not miss doorbells Jakub Kicinski
2021-08-12 21:42 ` [PATCH net v3 4/4] bnxt: count Tx drops Jakub Kicinski
2021-08-12 22:07 ` [PATCH net v3 0/4] bnxt: Tx NAPI disabling resiliency improvements Michael Chan
2021-08-13 17:27   ` Jakub Kicinski
2021-08-12 22:35 ` Edwin Peer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210812214242.578039-3-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=eddie.wai@broadcom.com \
    --cc=edwin.peer@broadcom.com \
    --cc=gospo@broadcom.com \
    --cc=huangjw@broadcom.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=prashant@broadcom.com \
    --subject='Re: [PATCH net v3 2/4] bnxt: disable napi before canceling DIM' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).