From: Somnath Kotur Date: Mon, 23 Aug 2021 15:44:53 +0000 (+0530) Subject: net/bnxt: fix crash after port stop/start X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=61cd4384fabf67d487a3ae85cff5babcdb41558f;p=dpdk.git 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 Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index aea71703d1..73fbdd17d1 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -1379,6 +1379,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq) } PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n"); + /* Explicitly reset this driver internal tracker on a ring init */ + rxr->rx_next_cons = 0; + return 0; }