From a7e21843f0f6067ebe36eafff9b8319092db3fc4 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Wed, 17 Nov 2021 08:42:06 +0530 Subject: [PATCH] net/bnxt: fix Rx next consumer index in mbuf alloc fail The driver internal variable to track the next consumer index on the Rx ring was not being set if there was an mbuf allocation failure. In that scenario, eventually it would fall out of sync with the actual consumer index and raise a false alarm on Thor needlessly causing a segmentation fault with testpmd Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Signed-off-by: Ajit Khaparde Reviewed-by: Kalesh AP --- drivers/net/bnxt/bnxt_rxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 157297bc64..e2f09ad3a0 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -986,6 +986,7 @@ reuse_rx_mbuf: goto rx; } rxr->rx_raw_prod = raw_prod; +rx: rxr->rx_next_cons = RING_IDX(rxr->rx_ring_struct, RING_NEXT(cons)); if (BNXT_TRUFLOW_EN(bp) && (BNXT_VF_IS_TRUSTED(bp) || BNXT_PF(bp)) && @@ -1004,7 +1005,6 @@ reuse_rx_mbuf: * All MBUFs are allocated with the same size under DPDK, * no optimization for rx_copy_thresh */ -rx: *rx_pkt = mbuf; next_rx: -- 2.20.1