bnxt: make sure xmit_more + errors does not miss doorbells
authorJakub Kicinski <kuba@kernel.org>
Thu, 12 Aug 2021 21:42:41 +0000 (14:42 -0700)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:45 +0000 (08:35 -0400)
commit296fe765dd02d8d8423f078b8c82b3882dd9adda
tree1fd644e21aff21d24eafc9607ea31a71b6f1a381
parentd913d5cc3ba5d1ca9fb723288147a098158b55c9
bnxt: make sure xmit_more + errors does not miss doorbells

[ Upstream commit e8d8c5d80f5e9d4586c68061b62c642752289095 ]

skbs are freed on error and not put on the ring. We may, however,
be in a situation where we're freeing the last skb of a batch,
and there is a doorbell ring pending because of xmit_more() being
true earlier. Make sure we ring the door bell in such situations.

Since errors are rare don't pay attention to xmit_more() and just
always flush the pending frames.

The busy case should be safe to be left alone because it can
only happen if start_xmit races with completions and they
both enable the queue. In that case the kick can't be pending.

Noticed while reading the code.

Fixes: 4d172f21cefe ("bnxt_en: Implement xmit_more.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h