patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 19.11] net/bnxt: fix Rx next consumer index in mbuf alloc fail
@ 2021-12-01  5:55 Somnath Kotur
  2021-12-01 10:31 ` Christian Ehrhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Somnath Kotur @ 2021-12-01  5:55 UTC (permalink / raw)
  To: stable; +Cc: Somnath Kotur, Ajit Khaparde, Kalesh AP

[ upstream commit a7e21843f0f6067ebe36eafff9b8319092db3fc4 ]

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 <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 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 f830bb6702..1e0640829f 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -684,12 +684,12 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 		goto rx;
 	}
 	rxr->rx_prod = prod;
+rx:
 	rxr->rx_next_cons = RING_NEXT(rxr->rx_ring_struct, cons);
 	/*
 	 * 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 19.11] net/bnxt: fix Rx next consumer index in mbuf alloc fail
  2021-12-01  5:55 [PATCH 19.11] net/bnxt: fix Rx next consumer index in mbuf alloc fail Somnath Kotur
@ 2021-12-01 10:31 ` Christian Ehrhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2021-12-01 10:31 UTC (permalink / raw)
  To: Somnath Kotur; +Cc: stable, Ajit Khaparde, Kalesh AP

On Wed, Dec 1, 2021 at 7:02 AM Somnath Kotur <somnath.kotur@broadcom.com> wrote:
>
> [ upstream commit a7e21843f0f6067ebe36eafff9b8319092db3fc4 ]
>

Thanks, applied

> 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 <somnath.kotur@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> ---
>  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 f830bb6702..1e0640829f 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -684,12 +684,12 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
>                 goto rx;
>         }
>         rxr->rx_prod = prod;
> +rx:
>         rxr->rx_next_cons = RING_NEXT(rxr->rx_ring_struct, cons);
>         /*
>          * 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
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-01 10:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  5:55 [PATCH 19.11] net/bnxt: fix Rx next consumer index in mbuf alloc fail Somnath Kotur
2021-12-01 10:31 ` Christian Ehrhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).