DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pcap: fix memory leak in jumbo frames
@ 2016-09-20 10:39 Dror Birkman
  2016-09-20 10:58 ` Yuanhan Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Dror Birkman @ 2016-09-20 10:39 UTC (permalink / raw)
  To: nicolas.pernas.maradei, ferruh.yigit; +Cc: dev, Dror Birkman

If rte_pktmbuf_alloc() fails on any segment that is not the initial
segment, previously allocated mbufs are not freed.

Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index b7a3b03..db19a66 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -229,8 +229,10 @@ eth_pcap_rx(void *queue,
 			if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool,
 						       mbuf,
 						       packet,
-						       header.caplen) == -1))
+						       header.caplen) == -1)) {
+				rte_pktmbuf_free(mbuf);
 				break;
+			}
 		}
 
 		mbuf->pkt_len = (uint16_t)header.caplen;
-- 
2.3.0

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

* Re: [dpdk-dev] [PATCH] pcap: fix memory leak in jumbo frames
  2016-09-20 10:39 [dpdk-dev] [PATCH] pcap: fix memory leak in jumbo frames Dror Birkman
@ 2016-09-20 10:58 ` Yuanhan Liu
  2016-09-20 11:16   ` Dror Birkman
  0 siblings, 1 reply; 4+ messages in thread
From: Yuanhan Liu @ 2016-09-20 10:58 UTC (permalink / raw)
  To: Dror Birkman; +Cc: nicolas.pernas.maradei, ferruh.yigit, dev, stable

On Tue, Sep 20, 2016 at 01:39:23PM +0300, Dror Birkman wrote:
> If rte_pktmbuf_alloc() fails on any segment that is not the initial
> segment, previously allocated mbufs are not freed.

You should put a "fixline" here.

Besides that, I think it's a good candidate for stable branch. Thus,
stable@dpdk.org cc'ed.

	--yliu

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

* Re: [dpdk-dev] [PATCH] pcap: fix memory leak in jumbo frames
  2016-09-20 10:58 ` Yuanhan Liu
@ 2016-09-20 11:16   ` Dror Birkman
  2016-09-20 11:57     ` [dpdk-dev] [dpdk-stable] " Yuanhan Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Dror Birkman @ 2016-09-20 11:16 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: Nicolas Pernas Maradei, ferruh.yigit, dev, stable

Cool!
Adding fixline:

If rte_pktmbuf_alloc() fails on any segment that is not the initial
segment, previously allocated mbufs are not freed.

Fixes: 6db141c91e1f ("pcap: support jumbo frames")

Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_
pcap.c
index b7a3b03..db19a66 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -229,8 +229,10 @@ eth_pcap_rx(void *queue,
        if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool,
              mbuf,
              packet,
-             header.caplen) == -1))
+             header.caplen) == -1)) {
+       rte_pktmbuf_free(mbuf);
        break;
+       }
        }

        mbuf->pkt_len = (uint16_t)header.caplen;
--
2.3.0



On Tue, Sep 20, 2016 at 1:58 PM, Yuanhan Liu <yuanhan.liu@linux.intel.com>
wrote:

> On Tue, Sep 20, 2016 at 01:39:23PM +0300, Dror Birkman wrote:
> > If rte_pktmbuf_alloc() fails on any segment that is not the initial
> > segment, previously allocated mbufs are not freed.
>
> You should put a "fixline" here.
>
> Besides that, I think it's a good candidate for stable branch. Thus,
> stable@dpdk.org cc'ed.
>
>         --yliu
>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] pcap: fix memory leak in jumbo frames
  2016-09-20 11:16   ` Dror Birkman
@ 2016-09-20 11:57     ` Yuanhan Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Yuanhan Liu @ 2016-09-20 11:57 UTC (permalink / raw)
  To: Dror Birkman; +Cc: Nicolas Pernas Maradei, ferruh.yigit, dev, stable

On Tue, Sep 20, 2016 at 02:16:48PM +0300, Dror Birkman wrote:
> Cool!
> Adding fixline:

You might want to send a v2: the following diff is malformed.

> 
> If rte_pktmbuf_alloc() fails on any segment that is not the initial
> segment, previously allocated mbufs are not freed.
> 
> Fixes: 6db141c91e1f ("pcap: support jumbo frames")

And put a line "Cc: <stable@dpdk.org>" just before your Signed-off-by.

	--yliu
> 
> Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
> ---
>  drivers/net/pcap/rte_eth_pcap.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_
> pcap.c
> index b7a3b03..db19a66 100644
> --- a/drivers/net/pcap/rte_eth_pcap.c
> +++ b/drivers/net/pcap/rte_eth_pcap.c
> @@ -229,8 +229,10 @@ eth_pcap_rx(void *queue,
>         if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool,
>               mbuf,
>               packet,
> -             header.caplen) == -1))
> +             header.caplen) == -1)) {
> +       rte_pktmbuf_free(mbuf);
>         break;
> +       }
>         }
> 
>         mbuf->pkt_len = (uint16_t)header.caplen;
> --
> 2.3.0
> 
> 
> 
> On Tue, Sep 20, 2016 at 1:58 PM, Yuanhan Liu <yuanhan.liu@linux.intel.com>
> wrote:
> 
> > On Tue, Sep 20, 2016 at 01:39:23PM +0300, Dror Birkman wrote:
> > > If rte_pktmbuf_alloc() fails on any segment that is not the initial
> > > segment, previously allocated mbufs are not freed.
> >
> > You should put a "fixline" here.
> >
> > Besides that, I think it's a good candidate for stable branch. Thus,
> > stable@dpdk.org cc'ed.
> >
> >         --yliu
> >

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

end of thread, other threads:[~2016-09-20 11:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-20 10:39 [dpdk-dev] [PATCH] pcap: fix memory leak in jumbo frames Dror Birkman
2016-09-20 10:58 ` Yuanhan Liu
2016-09-20 11:16   ` Dror Birkman
2016-09-20 11:57     ` [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).