net/bnxt: fix to set Rx next cons in mbuf alloc fail case
PATCH 1/1 net/bnxt: fix to set Rx next cons in mbuf alloc fail case
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")
Signed-off-by Somnath Kotur <[email protected]>
Signed-off-by Ajit Khaparde <[email protected]>
Reviewed-by Ajit Khaparde <[email protected]>
Reviewed-by Kalesh Anakkur Purayil <[email protected]>
--- drivers/net/bnxt/bnxt_rxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -1008,6 +1008,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, 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)) &&
@@ -1026,7 +1027,6 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,* All MBUFs are allocated with the same size under DPDK, * no optimization for rx_copy_thresh */ -rx: *rx_pkt = mbuf; next_rx:
Signature · 1 line
2.28.0.497.g54e85e7
Quoted 7 lines · Somnath Kotur
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
Quoted 7 lines
Fixes 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")Signed-off-by Somnath Kotur <[email protected]>Signed-off-by Ajit Khaparde <[email protected]>Reviewed-by Ajit Khaparde <[email protected]>Reviewed-by Kalesh Anakkur Purayil <[email protected]>
Patch applied to dpdk-next-net-brcm. Thanks
Quoted 27 lines
--- drivers/net/bnxt/bnxt_rxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bnxt/bnxt_rxr.c +1
-2@@ -1008,6 +1008,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, 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)) &&@@ -1026,7 +1027,6 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,* All MBUFs are allocated with the same size under DPDK, * no optimization for rx_copy_thresh */ -rx: *rx_pkt = mbuf; next_rx: --2.28.0.497.g54e85e7