net/bnxt: fix crash after port stop/start
authorSomnath Kotur <somnath.kotur@broadcom.com>
Mon, 23 Aug 2021 15:44:53 +0000 (21:14 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Wed, 25 Aug 2021 01:13:52 +0000 (03:13 +0200)
commit61cd4384fabf67d487a3ae85cff5babcdb41558f
tree74e1fac4b5fa3c0c291883d2e90c77739a9e607f
parent08d4d507df0da15aeaa567ea60511caeb9717eea
net/bnxt: fix crash after port stop/start

On chips like Thor, port stop/start sequence could result in a crash
in the application. This is because of false detection of a bad
opaque in the Rx completion and the subsequent kicking-in of the ring
reset code to recover from the condition.
The root cause being that the port stop/start would result in the HW
starting with fresh values, while the driver internal tracker variable
`rx_next_cons` is still pointing to a stale value.
Fix this by resetting rx_next_cons to 0 in bnxt_init_one_rx_ring()

Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_rxr.c