[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Thomas Monjalon
pushed thank you all -- Thomas

[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Adrien Mazarguil
On Mon, May 06, 2013 at 06:00:01PM +0200, Thomas Monjalon wrote: > From: Dongsu Han > > test-pmd txonly leaks mbuf from the pool. > The function tx_mbuf_alloc() does not change the refcnt > and the refcnt is 0 when it is first allocated. > However, rte_pktmbuf_free_seg called by the driver's xmit

[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Thomas Monjalon
From: Dongsu Han test-pmd txonly leaks mbuf from the pool. The function tx_mbuf_alloc() does not change the refcnt and the refcnt is 0 when it is first allocated. However, rte_pktmbuf_free_seg called by the driver's xmit code decrements reference count to -1. So mbuf never goes back to the pool.

[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Adrien Mazarguil
Hi all (replying below) On Mon, May 06, 2013 at 09:28:33AM -0400, Han, Dongsu wrote: > Sounds good. With the two bug fixes I submitted txonly now runs perfectly. > Thanks! > -Dongsu > On May 6, 2013 8:47 AM, "Thomas Monjalon" > wrote: > > > Hi Dongsu Han, > > > > I think your fix is right. > >

[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Thomas Monjalon
Hi Dongsu Han, I think your fix is right. I've just removed tx_mbuf_alloc() and directly called rte_pktmbuf_alloc() instead. Is it OK for you ? Could you also review this (modified) description ? Thank you --- From: Dongsu Han test-pmd txonly leaks mbuf from the pool. The function tx_mbuf_al

[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Han, Dongsu
In addition to this, we should probably clone pkt mbuf using rte_pktmbuf_clone() and transmit the cloned packet. This will avoid having to copy the mac and IP headers. -Dongsu On Mon, May 6, 2013 at 9:56 AM, Adrien Mazarguil wrote: > Hi all (replying below) > > On Mon, May 06, 2013 at 09:28:33A

[dpdk-dev] [PATCH] app: fix refcnt in mbuf allocation

2013-05-06 Thread Han, Dongsu
Sounds good. With the two bug fixes I submitted txonly now runs perfectly. Thanks! -Dongsu On May 6, 2013 8:47 AM, "Thomas Monjalon" wrote: > Hi Dongsu Han, > > I think your fix is right. > I've just removed tx_mbuf_alloc() and directly called rte_pktmbuf_alloc() > instead. > Is it OK for you ? >