Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-15 Thread Yuanhan Liu
On Wed, Jan 11, 2017 at 10:56:20AM -0800, Stephen Hemminger wrote: > Please write generic code. Something like the following (untested). Despite there are few compile errors (which are easy to fix), it works fine. More importantly, it saves near 2000 cycles if I apply the bulk free to virtio_xmit

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Stephen Hemminger
nstantin ; Stephen Hemminger > >> > >> Cc: Sergey Vyazmitinov ; > >> olivier.m...@6wind.com; dev@dpdk.org > >> Subject: Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and > >> free mbufs > >> > >> On 1/11/2017 5:

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ferruh Yigit
phen Hemminger [mailto:step...@networkplumber.org] >>>> Sent: Wednesday, January 11, 2017 5:36 PM >>>> To: Ananyev, Konstantin >>>> Cc: Sergey Vyazmitinov ; >>>> olivier.m...@6wind.com; Yigit, Ferruh ; >> dev@dpdk.org >>>> Subject: Re: [

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ananyev, Konstantin
: Ananyev, Konstantin > >> Cc: Sergey Vyazmitinov ; > >> olivier.m...@6wind.com; Yigit, Ferruh ; > dev@dpdk.org > >> Subject: Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and > >> free mbufs > >> > >> On Wed, 11 Jan 2017 17:28:2

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ferruh Yigit
livier.m...@6wind.com; Yigit, Ferruh ; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free >> mbufs >> >> On Wed, 11 Jan 2017 17:28:21 + >> "Ananyev, Konstantin" wrote: >> >>>> -Origina

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ananyev, Konstantin
t; Sent: Wednesday, January 11, 2017 4:18 PM > > > To: Sergey Vyazmitinov > > > Cc: olivier.m...@6wind.com; Yigit, Ferruh ; > > > dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and > > > free mbufs > > &g

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Stephen Hemminger
c: olivier.m...@6wind.com; Yigit, Ferruh ; > > dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and > > free mbufs > > > > On Fri, 30 Dec 2016 04:50:16 +0700 > > Sergey Vyazmitinov wrote: > > > > > /** > >

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ananyev, Konstantin
> -Original Message- > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Wednesday, January 11, 2017 4:18 PM > To: Sergey Vyazmitinov > Cc: olivier.m...@6wind.com; Yigit, Ferruh ; > dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] kni:

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ferruh Yigit
Hi Sergey, On 1/11/2017 4:17 PM, Stephen Hemminger wrote: > On Fri, 30 Dec 2016 04:50:16 +0700 > Sergey Vyazmitinov wrote: > >> /** >> + * Free n packets mbuf back into its original mempool. >> + * >> + * Free each mbuf, and all its segments in case of chained buffers. Each >> + * segment is ad

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Olivier MATZ
On Wed, 11 Jan 2017 08:17:59 -0800, Stephen Hemminger wrote: > On Fri, 30 Dec 2016 04:50:16 +0700 > Sergey Vyazmitinov wrote: > > > /** > > + * Free n packets mbuf back into its original mempool. > > + * > > + * Free each mbuf, and all its segments in case of chained > > buffers. Each > > + * s

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Stephen Hemminger
On Fri, 30 Dec 2016 04:50:16 +0700 Sergey Vyazmitinov wrote: > /** > + * Free n packets mbuf back into its original mempool. > + * > + * Free each mbuf, and all its segments in case of chained buffers. Each > + * segment is added back into its original mempool. > + * > + * @param mp > + * The

Re: [dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-11 Thread Ananyev, Konstantin
Hi Sergey, ... > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 4476d75..707c300 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -1261,6 +1261,38 @@ static inline void rte_pktmbuf_free(struct rte_mbuf *m) > } > > /** > + * Free n p

[dpdk-dev] [PATCH] kni: use bulk functions to allocate and free mbufs

2017-01-10 Thread Sergey Vyazmitinov
Optimized kni_allocate_mbufs and kni_free_mbufs by using mbuf bulk functions. This can improve performance more than two times. Signed-off-by: Sergey Vyazmitinov --- lib/librte_kni/rte_kni.c | 44 +--- lib/librte_kni/rte_kni_fifo.h| 18