[v3,08/18] net/bnxt: refactor Rx doorbell during Rx flush
Checks
Commit Message
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(-)
@@ -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;
}