net/bnxt: fix regression in non-vector mode Rx data path on Thor
PATCH 1/1 net/bnxt: fix regression in non-vector mode Rx data path on Thor
The patch introduced by
commit 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed") ended up shortening the return code path from the function thereby resulting in not executing the line of code at the end of the function that was resetting the next consumer index to 0.
This would result in an application crash when error recovery or other port stop/start scenarios were invoked on Thor which is what this commit 61cd4384fabf ("net/bnxt: fix crash after port stop/start") was addressing.
Fix it by moving the resetting line of code before the return path in the case when aggregration rings are not used (default case).
--- drivers/net/bnxt/bnxt_rxr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_rxr.c +3 -3
@@ -1369,6 +1369,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq) rxr->rx_buf_ring[i] = &rxq->fake_mbuf; } +/* Explicitly reset this driver internal tracker on a ring init */ + rxr->rx_next_cons =0 ; +if (!bnxt_need_agg_ring (rxq->bp->eth_dev))return 0 ;
@@ -1407,9 +1410,6 @@ 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 ; }
Signature · 1 line
2.28.0.497.g54e85e7
Quoted 13 lines · Somnath Kotur
The patch introduced by
commit657c2a7f1dd4("net/bnxt: create aggregation rings when needed") ended up shortening the return code path from the function thereby resulting in not executing the line of code at the end of the function that was resetting the next consumer index to 0.
This would result in an application crash when error recovery or other port stop/start scenarios were invoked on Thor which is what this commit61cd4384fabf("net/bnxt: fix crash after port stop/start") was addressing.
Fix it by moving the resetting line of code before the return path in the case when aggregration rings are not used (default case).
Quoted 3 lines
Fixes 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed")Signed-off-by Somnath Kotur <[email protected]>
Fixed typo in commit log.
Patch applied to dpdk-next-net-brcm.
Quoted 31 lines
--- drivers/net/bnxt/bnxt_rxr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/bnxt/bnxt_rxr.c +3
-4@@ -1369,6 +1369,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq) rxr->rx_buf_ring[i] = &rxq->fake_mbuf; } +/* Explicitly reset this driver internal tracker on a ring init */ + rxr->rx_next_cons =0 ; +if (!bnxt_need_agg_ring (rxq->bp->eth_dev))return 0 ;@@ -1407,9 +1410,6 @@ 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 ; } --2.28.0.497.g54e85e7