DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc
@ 2015-05-11 23:15 Paul Emmerich
  2015-07-20  1:00 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Emmerich @ 2015-05-11 23:15 UTC (permalink / raw)
  To: dev

this improves the throughput of a simple tx-only application by 11% in
the full-featured ixgbe tx path and by 14% in the simple tx path.
---
 lib/librte_mbuf/rte_mbuf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index ab6de67..f6895b4 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -538,6 +538,7 @@ static inline struct rte_mbuf *__rte_mbuf_raw_alloc(struct rte_mempool *mp)
 	if (rte_mempool_get(mp, &mb) < 0)
 		return NULL;
 	m = (struct rte_mbuf *)mb;
+	rte_prefetch0(&m->cacheline1);
 	RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(m) == 0);
 	rte_mbuf_refcnt_set(m, 1);
 	return (m);
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc
  2015-05-11 23:15 [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc Paul Emmerich
@ 2015-07-20  1:00 ` Thomas Monjalon
  2015-07-20  8:02   ` Olivier MATZ
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2015-07-20  1:00 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev

Please Olivier,
What is the status of this patch?

2015-05-12 01:15, Paul Emmerich:
> this improves the throughput of a simple tx-only application by 11% in
> the full-featured ixgbe tx path and by 14% in the simple tx path.
> ---
>  lib/librte_mbuf/rte_mbuf.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index ab6de67..f6895b4 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -538,6 +538,7 @@ static inline struct rte_mbuf *__rte_mbuf_raw_alloc(struct rte_mempool *mp)
>  	if (rte_mempool_get(mp, &mb) < 0)
>  		return NULL;
>  	m = (struct rte_mbuf *)mb;
> +	rte_prefetch0(&m->cacheline1);
>  	RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(m) == 0);
>  	rte_mbuf_refcnt_set(m, 1);
>  	return (m);
> 

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

* Re: [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc
  2015-07-20  1:00 ` Thomas Monjalon
@ 2015-07-20  8:02   ` Olivier MATZ
  2017-02-15  8:44     ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Olivier MATZ @ 2015-07-20  8:02 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

Hi Thomas,


On 07/20/2015 03:00 AM, Thomas Monjalon wrote:
> Please Olivier,
> What is the status of this patch?

>From what I remember, the last mail was a comment from Konstantin
on another thread (but same topic):
http://dpdk.org/ml/archives/dev/2015-May/017633.html


Regards,
Olivier


> 
> 2015-05-12 01:15, Paul Emmerich:
>> this improves the throughput of a simple tx-only application by 11% in
>> the full-featured ixgbe tx path and by 14% in the simple tx path.
>> ---
>>  lib/librte_mbuf/rte_mbuf.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>> index ab6de67..f6895b4 100644
>> --- a/lib/librte_mbuf/rte_mbuf.h
>> +++ b/lib/librte_mbuf/rte_mbuf.h
>> @@ -538,6 +538,7 @@ static inline struct rte_mbuf *__rte_mbuf_raw_alloc(struct rte_mempool *mp)
>>  	if (rte_mempool_get(mp, &mb) < 0)
>>  		return NULL;
>>  	m = (struct rte_mbuf *)mb;
>> +	rte_prefetch0(&m->cacheline1);
>>  	RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(m) == 0);
>>  	rte_mbuf_refcnt_set(m, 1);
>>  	return (m);
>>
> 
> 

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

* Re: [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc
  2015-07-20  8:02   ` Olivier MATZ
@ 2017-02-15  8:44     ` Thomas Monjalon
  2017-02-16 15:16       ` Olivier Matz
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2017-02-15  8:44 UTC (permalink / raw)
  To: Olivier MATZ, konstantin.ananyev, bruce.richardson
  Cc: dev, Paul Emmerich, Mike A. Polehn

Do we need to discuss again the prefetch calls inside DPDK
or can we definitely close this kind of request?
	mbuf: http://dpdk.org/patch/4678/
	ethdev: http://dpdk.org/patch/8867/


2015-07-20 10:02, Olivier MATZ:
> Hi Thomas,
> 
> 
> On 07/20/2015 03:00 AM, Thomas Monjalon wrote:
> > Please Olivier,
> > What is the status of this patch?
> 
> From what I remember, the last mail was a comment from Konstantin
> on another thread (but same topic):
> http://dpdk.org/ml/archives/dev/2015-May/017633.html
> 
> 
> Regards,
> Olivier
> 
> 
> > 
> > 2015-05-12 01:15, Paul Emmerich:
> >> this improves the throughput of a simple tx-only application by 11% in
> >> the full-featured ixgbe tx path and by 14% in the simple tx path.
> >> ---
> >>  lib/librte_mbuf/rte_mbuf.h | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> >> index ab6de67..f6895b4 100644
> >> --- a/lib/librte_mbuf/rte_mbuf.h
> >> +++ b/lib/librte_mbuf/rte_mbuf.h
> >> @@ -538,6 +538,7 @@ static inline struct rte_mbuf *__rte_mbuf_raw_alloc(struct rte_mempool *mp)
> >>  	if (rte_mempool_get(mp, &mb) < 0)
> >>  		return NULL;
> >>  	m = (struct rte_mbuf *)mb;
> >> +	rte_prefetch0(&m->cacheline1);
> >>  	RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(m) == 0);
> >>  	rte_mbuf_refcnt_set(m, 1);
> >>  	return (m);
> >>
> > 
> > 

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

* Re: [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc
  2017-02-15  8:44     ` Thomas Monjalon
@ 2017-02-16 15:16       ` Olivier Matz
  0 siblings, 0 replies; 5+ messages in thread
From: Olivier Matz @ 2017-02-16 15:16 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: konstantin.ananyev, bruce.richardson, dev, Paul Emmerich, Mike A. Polehn

On Wed, 15 Feb 2017 09:44:35 +0100, Thomas Monjalon
<thomas.monjalon@6wind.com> wrote:
> Do we need to discuss again the prefetch calls inside DPDK
> or can we definitely close this kind of request?
> 	mbuf: http://dpdk.org/patch/4678/
> 	ethdev: http://dpdk.org/patch/8867/
> 

About the mbuf prefetch, I suggest the topic can be closed:
The rte_pkt_mbuf_alloc() function is not necessarily called in a place
where we will write the second cache line, so the prefetch is not always
useful. Having prefetches in generic functions does not look to be a
good idea, especially in that case, knowing it's easy to do it in the
application.


Olivier


> 
> 2015-07-20 10:02, Olivier MATZ:
> > Hi Thomas,
> > 
> > 
> > On 07/20/2015 03:00 AM, Thomas Monjalon wrote:  
> > > Please Olivier,
> > > What is the status of this patch?  
> > 
> > From what I remember, the last mail was a comment from Konstantin
> > on another thread (but same topic):
> > http://dpdk.org/ml/archives/dev/2015-May/017633.html
> > 
> > 
> > Regards,
> > Olivier
> > 
> >   
> > > 
> > > 2015-05-12 01:15, Paul Emmerich:  
> > >> this improves the throughput of a simple tx-only application by
> > >> 11% in the full-featured ixgbe tx path and by 14% in the simple
> > >> tx path. ---
> > >>  lib/librte_mbuf/rte_mbuf.h | 1 +
> > >>  1 file changed, 1 insertion(+)
> > >>
> > >> diff --git a/lib/librte_mbuf/rte_mbuf.h
> > >> b/lib/librte_mbuf/rte_mbuf.h index ab6de67..f6895b4 100644
> > >> --- a/lib/librte_mbuf/rte_mbuf.h
> > >> +++ b/lib/librte_mbuf/rte_mbuf.h
> > >> @@ -538,6 +538,7 @@ static inline struct rte_mbuf
> > >> *__rte_mbuf_raw_alloc(struct rte_mempool *mp) if
> > >> (rte_mempool_get(mp, &mb) < 0) return NULL;
> > >>  	m = (struct rte_mbuf *)mb;
> > >> +	rte_prefetch0(&m->cacheline1);
> > >>  	RTE_MBUF_ASSERT(rte_mbuf_refcnt_read(m) == 0);
> > >>  	rte_mbuf_refcnt_set(m, 1);
> > >>  	return (m);
> > >>  
> > > 
> > >   
> 
> 

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

end of thread, other threads:[~2017-02-16 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 23:15 [dpdk-dev] [PATCH] prefetch second cacheline of mbufs on alloc Paul Emmerich
2015-07-20  1:00 ` Thomas Monjalon
2015-07-20  8:02   ` Olivier MATZ
2017-02-15  8:44     ` Thomas Monjalon
2017-02-16 15:16       ` Olivier Matz

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