DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/bnxt: fix to advance producer index
@ 2020-05-20 17:39 Kalesh A P
  2020-05-20 22:08 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Kalesh A P @ 2020-05-20 17:39 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

From: Rahul Gupta <rahul.gupta@broadcom.com>

When a queue is started after deferred_start, then increment raw_prod
irrespective of new mbuf is allocated or old mbufs are used.

Fixes: d256c73c1122 ("net/bnxt: fix memory leak during queue restart")
Cc: stable@dpdk.org

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index d2955ba..ee1acb1 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -987,9 +987,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
 					    rxq->queue_id, i, ring->ring_size);
 				break;
 			}
-			rxr->rx_prod = prod;
-			prod = RING_NEXT(rxr->rx_ring_struct, prod);
 		}
+		rxr->rx_prod = prod;
+		prod = RING_NEXT(rxr->rx_ring_struct, prod);
 	}
 
 	ring = rxr->ag_ring_struct;
@@ -1005,9 +1005,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
 					    rxq->queue_id, i, ring->ring_size);
 				break;
 			}
-			rxr->ag_prod = prod;
-			prod = RING_NEXT(rxr->ag_ring_struct, prod);
 		}
+		rxr->ag_prod = prod;
+		prod = RING_NEXT(rxr->ag_ring_struct, prod);
 	}
 	PMD_DRV_LOG(DEBUG, "AGG Done!\n");
 
-- 
2.10.1


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

* Re: [dpdk-dev] [PATCH] net/bnxt: fix to advance producer index
  2020-05-20 17:39 [dpdk-dev] [PATCH] net/bnxt: fix to advance producer index Kalesh A P
@ 2020-05-20 22:08 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-05-20 22:08 UTC (permalink / raw)
  To: Kalesh A P; +Cc: dpdk-dev, Ferruh Yigit

On Wed, May 20, 2020 at 10:23 AM Kalesh A P <
kalesh-anakkur.purayil@broadcom.com> wrote:

> From: Rahul Gupta <rahul.gupta@broadcom.com>
>
> When a queue is started after deferred_start, then increment raw_prod
> irrespective of new mbuf is allocated or old mbufs are used.
>
> Fixes: d256c73c1122 ("net/bnxt: fix memory leak during queue restart")
> Cc: stable@dpdk.org
>
> Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
Patch applied to dpdk-next-net-brcm. Thanks


> ---
>  drivers/net/bnxt/bnxt_rxr.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index d2955ba..ee1acb1 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -987,9 +987,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
>                                             rxq->queue_id, i,
> ring->ring_size);
>                                 break;
>                         }
> -                       rxr->rx_prod = prod;
> -                       prod = RING_NEXT(rxr->rx_ring_struct, prod);
>                 }
> +               rxr->rx_prod = prod;
> +               prod = RING_NEXT(rxr->rx_ring_struct, prod);
>         }
>
>         ring = rxr->ag_ring_struct;
> @@ -1005,9 +1005,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
>                                             rxq->queue_id, i,
> ring->ring_size);
>                                 break;
>                         }
> -                       rxr->ag_prod = prod;
> -                       prod = RING_NEXT(rxr->ag_ring_struct, prod);
>                 }
> +               rxr->ag_prod = prod;
> +               prod = RING_NEXT(rxr->ag_ring_struct, prod);
>         }
>         PMD_DRV_LOG(DEBUG, "AGG Done!\n");
>
> --
> 2.10.1
>
>

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

end of thread, other threads:[~2020-05-20 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 17:39 [dpdk-dev] [PATCH] net/bnxt: fix to advance producer index Kalesh A P
2020-05-20 22:08 ` Ajit Khaparde

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git