DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e
@ 2016-08-29 16:50 Yury Kylulin
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release Yury Kylulin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yury Kylulin @ 2016-08-29 16:50 UTC (permalink / raw)
  To: helin.zhang, konstantin.ananyev, jingjing.wu
  Cc: wenzhuo.lu, dev, Yury Kylulin

This patch set fixes problem when mbufs are not released back to the
original memory pool during Rx queue relese call leading to mbufs
"leakage".

This issue happens when device stop (rte_eth_dev_stop()) will be called
after device start (rte_eth_dev_start()) without any incoming packets
received since device start. In this case both rxq->rx_tail and
rxq->rxrearm_start equal to 0 and release cycle will not be executed.
On the next device start (rte_eth_dev_start()) new set of mbufs for the
RX queue will be allocated.

Yury Kylulin (2):
  net/ixgbe: fix mbufs leakage during Rx queue release
  net/i40e: fix mbufs leakage during Rx queue release

 drivers/net/i40e/i40e_rxtx_vec.c          | 16 ++++++++++++++--
 drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 16 ++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)

-- 
2.7.4

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

* [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release
  2016-08-29 16:50 [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Yury Kylulin
@ 2016-08-29 16:50 ` Yury Kylulin
  2016-08-30  2:00   ` Lu, Wenzhuo
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 2/2] net/i40e: " Yury Kylulin
  2016-09-19 13:29 ` [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Bruce Richardson
  2 siblings, 1 reply; 8+ messages in thread
From: Yury Kylulin @ 2016-08-29 16:50 UTC (permalink / raw)
  To: helin.zhang, konstantin.ananyev, jingjing.wu
  Cc: wenzhuo.lu, dev, Yury Kylulin

For the vector PMD release all mbufs from the Rx queue if no packets
received after device start.

Fixes: 11b220c6498d ("ixgbe: fix release queue mbufs")

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index 62b8201..3c3c009 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -204,8 +204,20 @@ _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
 		return;
 
 	/* free all mbufs that are valid in the ring */
-	for (i = rxq->rx_tail; i != rxq->rxrearm_start; i = (i + 1) & mask)
-		rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
+	if (rxq->rxrearm_nb == 0) {
+		for (i = 0; i < rxq->nb_rx_desc; i++) {
+			if (rxq->sw_ring[i].mbuf != NULL)
+				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
+		}
+	} else {
+		for (i = rxq->rx_tail;
+		     i != rxq->rxrearm_start;
+		     i = (i + 1) & mask) {
+			if (rxq->sw_ring[i].mbuf != NULL)
+				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
+		}
+	}
+
 	rxq->rxrearm_nb = rxq->nb_rx_desc;
 
 	/* set all entries to NULL */
-- 
2.7.4

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

* [dpdk-dev] [PATCH 2/2] net/i40e: fix mbufs leakage during Rx queue release
  2016-08-29 16:50 [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Yury Kylulin
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release Yury Kylulin
@ 2016-08-29 16:50 ` Yury Kylulin
  2016-09-01  2:38   ` Xing, Beilei
  2016-09-19 13:29 ` [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Bruce Richardson
  2 siblings, 1 reply; 8+ messages in thread
From: Yury Kylulin @ 2016-08-29 16:50 UTC (permalink / raw)
  To: helin.zhang, konstantin.ananyev, jingjing.wu
  Cc: wenzhuo.lu, dev, Yury Kylulin

For the vector PMD release all mbufs from the Rx queue if no packets
received after device start.

Fixes: 9ed94e5bb04e ("i40e: add vector Rx")

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_vec.c
index 51fb282..82571ee 100644
--- a/drivers/net/i40e/i40e_rxtx_vec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec.c
@@ -692,8 +692,20 @@ i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq)
 		return;
 
 	/* free all mbufs that are valid in the ring */
-	for (i = rxq->rx_tail; i != rxq->rxrearm_start; i = (i + 1) & mask)
-		rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
+	if (rxq->rxrearm_nb == 0) {
+		for (i = 0; i < rxq->nb_rx_desc; i++) {
+			if (rxq->sw_ring[i].mbuf != NULL)
+				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
+		}
+	} else {
+		for (i = rxq->rx_tail;
+		     i != rxq->rxrearm_start;
+		     i = (i + 1) & mask) {
+			if (rxq->sw_ring[i].mbuf != NULL)
+				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
+		}
+	}
+
 	rxq->rxrearm_nb = rxq->nb_rx_desc;
 
 	/* set all entries to NULL */
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release Yury Kylulin
@ 2016-08-30  2:00   ` Lu, Wenzhuo
  0 siblings, 0 replies; 8+ messages in thread
From: Lu, Wenzhuo @ 2016-08-30  2:00 UTC (permalink / raw)
  To: Kylulin, Yury, Zhang, Helin, Ananyev, Konstantin, Wu, Jingjing; +Cc: dev

Hi,

> -----Original Message-----
> From: Kylulin, Yury
> Sent: Tuesday, August 30, 2016 12:51 AM
> To: Zhang, Helin; Ananyev, Konstantin; Wu, Jingjing
> Cc: Lu, Wenzhuo; dev@dpdk.org; Kylulin, Yury
> Subject: [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release
> 
> For the vector PMD release all mbufs from the Rx queue if no packets received
> after device start.
> 
> Fixes: 11b220c6498d ("ixgbe: fix release queue mbufs")
> 
> Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>

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

* Re: [dpdk-dev] [PATCH 2/2] net/i40e: fix mbufs leakage during Rx queue release
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 2/2] net/i40e: " Yury Kylulin
@ 2016-09-01  2:38   ` Xing, Beilei
  0 siblings, 0 replies; 8+ messages in thread
From: Xing, Beilei @ 2016-09-01  2:38 UTC (permalink / raw)
  To: Kylulin, Yury, Zhang, Helin, Ananyev, Konstantin, Wu, Jingjing
  Cc: Lu, Wenzhuo, dev, Kylulin, Yury

Hi,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yury Kylulin
> Sent: Tuesday, August 30, 2016 12:51 AM
> To: Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org; Kylulin, Yury
> <yury.kylulin@intel.com>
> Subject: [dpdk-dev] [PATCH 2/2] net/i40e: fix mbufs leakage during Rx
> queue release
> 
> For the vector PMD release all mbufs from the Rx queue if no packets
> received after device start.
> 
> Fixes: 9ed94e5bb04e ("i40e: add vector Rx")
> 
> Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>

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

* Re: [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e
  2016-08-29 16:50 [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Yury Kylulin
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release Yury Kylulin
  2016-08-29 16:50 ` [dpdk-dev] [PATCH 2/2] net/i40e: " Yury Kylulin
@ 2016-09-19 13:29 ` Bruce Richardson
  2016-09-19 13:52   ` Christian Ehrhardt
  2 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2016-09-19 13:29 UTC (permalink / raw)
  To: Yury Kylulin
  Cc: helin.zhang, konstantin.ananyev, jingjing.wu, wenzhuo.lu, dev

On Mon, Aug 29, 2016 at 07:50:46PM +0300, Yury Kylulin wrote:
> This patch set fixes problem when mbufs are not released back to the
> original memory pool during Rx queue relese call leading to mbufs
> "leakage".
> 
> This issue happens when device stop (rte_eth_dev_stop()) will be called
> after device start (rte_eth_dev_start()) without any incoming packets
> received since device start. In this case both rxq->rx_tail and
> rxq->rxrearm_start equal to 0 and release cycle will not be executed.
> On the next device start (rte_eth_dev_start()) new set of mbufs for the
> RX queue will be allocated.
> 
> Yury Kylulin (2):
>   net/ixgbe: fix mbufs leakage during Rx queue release
>   net/i40e: fix mbufs leakage during Rx queue release
> 
Applied to dpdk-next-net/rel_16_11

Thanks,
/Bruce

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

* Re: [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e
  2016-09-19 13:29 ` [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Bruce Richardson
@ 2016-09-19 13:52   ` Christian Ehrhardt
  2016-09-19 14:47     ` [dpdk-dev] [dpdk-stable] " Yuanhan Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Ehrhardt @ 2016-09-19 13:52 UTC (permalink / raw)
  To: Bruce Richardson, stable
  Cc: Yury Kylulin, helin.zhang, Ananyev, Konstantin, jingjing.wu,
	wenzhuo.lu, dev

On Mon, Sep 19, 2016 at 3:29 PM, Bruce Richardson <
bruce.richardson@intel.com> wrote:

> > This patch set fixes problem when mbufs are not released back to the
> > original memory pool during Rx queue relese call leading to mbufs
> > "leakage".
> >
> > This issue happens when device stop (rte_eth_dev_stop()) will be called
> > after device start (rte_eth_dev_start()) without any incoming packets
> > received since device start. In this case both rxq->rx_tail and
> > rxq->rxrearm_start equal to 0 and release cycle will not be executed.
> > On the next device start (rte_eth_dev_start()) new set of mbufs for the
> > RX queue will be allocated.
> >
> > Yury Kylulin (2):
> >   net/ixgbe: fix mbufs leakage during Rx queue release
> >   net/i40e: fix mbufs leakage during Rx queue release
> >
> Applied to dpdk-next-net/rel_16_11
>

I don't know the underlying code well enough, but given the description I'd
expect that qualifies for the stable tree?
Set stable@dpdk on cc.

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e
  2016-09-19 13:52   ` Christian Ehrhardt
@ 2016-09-19 14:47     ` Yuanhan Liu
  0 siblings, 0 replies; 8+ messages in thread
From: Yuanhan Liu @ 2016-09-19 14:47 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: Bruce Richardson, stable, Yury Kylulin, helin.zhang, Ananyev,
	Konstantin, jingjing.wu, wenzhuo.lu, dev

On Mon, Sep 19, 2016 at 03:52:25PM +0200, Christian Ehrhardt wrote:
> On Mon, Sep 19, 2016 at 3:29 PM, Bruce Richardson <
> bruce.richardson@intel.com> wrote:
> 
> > > This patch set fixes problem when mbufs are not released back to the
> > > original memory pool during Rx queue relese call leading to mbufs
> > > "leakage".
> > >
> > > This issue happens when device stop (rte_eth_dev_stop()) will be called
> > > after device start (rte_eth_dev_start()) without any incoming packets
> > > received since device start. In this case both rxq->rx_tail and
> > > rxq->rxrearm_start equal to 0 and release cycle will not be executed.
> > > On the next device start (rte_eth_dev_start()) new set of mbufs for the
> > > RX queue will be allocated.
> > >
> > > Yury Kylulin (2):
> > >   net/ixgbe: fix mbufs leakage during Rx queue release
> > >   net/i40e: fix mbufs leakage during Rx queue release
> > >
> > Applied to dpdk-next-net/rel_16_11
> >
> 
> I don't know the underlying code well enough,

Me, neither.

> but given the description I'd
> expect that qualifies for the stable tree?

But, yes, I agree with Christian.

> Set stable@dpdk on cc.

Thanks for doing that.

	--yliu

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

end of thread, other threads:[~2016-09-19 14:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 16:50 [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Yury Kylulin
2016-08-29 16:50 ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release Yury Kylulin
2016-08-30  2:00   ` Lu, Wenzhuo
2016-08-29 16:50 ` [dpdk-dev] [PATCH 2/2] net/i40e: " Yury Kylulin
2016-09-01  2:38   ` Xing, Beilei
2016-09-19 13:29 ` [dpdk-dev] [PATCH 0/2] fix mbufs leakage during Rx queue release on ixgbe/i40e Bruce Richardson
2016-09-19 13:52   ` Christian Ehrhardt
2016-09-19 14:47     ` [dpdk-dev] [dpdk-stable] " Yuanhan Liu

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).