octeon_ep: update BQL sent bytes before ringing doorbell
authorShinas Rasheed <srasheed@marvell.com>
Tue, 17 Oct 2023 10:50:30 +0000 (03:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:07 +0000 (12:03 +0200)
commitf0ab9b0922fc07a22e112df4694d77b3df38c5f2
tree86893262ee3332edb10f82ffa4d1814512a618d3
parent1a68d440112ab0de771a9db974271d1a8616681e
octeon_ep: update BQL sent bytes before ringing doorbell

commit a0ca6b9dfef0b3cc83aa8bb485ed61a018f84982 upstream.

Sometimes Tx is completed immediately after doorbell is updated, which
causes Tx completion routing to update completion bytes before the
same packet bytes are updated in sent bytes in transmit function, hence
hitting BUG_ON() in dql_completed(). To avoid this, update BQL
sent bytes before ringing doorbell.

Fixes: 37d79d059606 ("octeon_ep: add Tx/Rx processing and interrupt support")
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Link: https://lore.kernel.org/r/20231017105030.2310966-1-srasheed@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/octeon_ep/octep_main.c