[v2,08/18] net/bnxt: refactor Rx doorbell during Rx flush

Message ID 20231222215659.64993-9-ajit.khaparde@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt patchset |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Dec. 22, 2023, 9:56 p.m. UTC
  Ring the Rx doorbell during the Rx ring flush processing only if
there is a valid completion.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index c5c9f9e6e6..d0706874a6 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -1713,10 +1713,11 @@  int bnxt_flush_rx_cmp(struct bnxt_cp_ring_info *cpr)
 		nb_rx++;
 	} while (nb_rx < ring_mask);
 
-	cpr->cp_raw_cons = raw_cons;
-
-	/* Ring the completion queue doorbell. */
-	bnxt_db_cq(cpr);
+	if (nb_rx) {
+		cpr->cp_raw_cons = raw_cons;
+		/* Ring the completion queue doorbell. */
+		bnxt_db_cq(cpr);
+	}
 
 	return 0;
 }