[dpdk-dev] [PATCH 1/3] examples/distributor: fix build for non-x86 arch

Ananyev, Konstantin konstantin.ananyev at intel.com
Fri Feb 5 16:15:14 CET 2016



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pattan, Reshma
> Sent: Friday, February 05, 2016 3:08 PM
> To: Thomas Monjalon
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/3] examples/distributor: fix build for non-x86 arch
> 
> Hi Thomas,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Thomas Monjalon
> > Sent: Friday, February 5, 2016 2:54 PM
> > To: Richardson, Bruce; Horton, Remy
> > Cc: dev at dpdk.org
> > Subject: [dpdk-dev] [PATCH 1/3] examples/distributor: fix build for non-x86 arch
> >
> > _mm_prefetch is defined only in x86 compilers.
> > rte_prefetch functions are defined in EAL for each arch, and must be preferred
> > over compiler intrinsics.
> >
> > Fixes: 07db4a975094 ("examples/distributor: new sample app")
> >
> > Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> > ---
> >  examples/distributor/main.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/examples/distributor/main.c b/examples/distributor/main.c index
> > 4e74f8f..87344ac 100644
> > --- a/examples/distributor/main.c
> > +++ b/examples/distributor/main.c
> > @@ -335,13 +335,13 @@ lcore_tx(struct rte_ring *in_r)
> >
> >  			/* for traffic we receive, queue it up for transmit */
> >  			uint16_t i;
> > -			_mm_prefetch((void *)bufs[0], 0);
> > -			_mm_prefetch((void *)bufs[1], 0);
> > -			_mm_prefetch((void *)bufs[2], 0);
> > +			rte_prefetch0((void *)bufs[0]);
> > +			rte_prefetch0((void *)bufs[1]);
> > +			rte_prefetch0((void *)bufs[2]);
> 
> Some time back Jerin Jacob has sent patch for replacing the _mm_prefetch  with rte_prefetch_non_temporal. This is FYI.

Yep:
http://dpdk.org/dev/patchwork/patch/9369/
http://dpdk.org/dev/patchwork/patch/9370/

And on IA _mm_prefetch(p, 0) != rte_prefetch0(p).
I think, as in Jacob implementation, it should be PREFETCHNTA.
Konstantin

> 
> Thanks,
> Reshma
> 
> >  			for (i = 0; i < nb_rx; i++) {
> >  				struct output_buffer *outbuf;
> >  				uint8_t outp;
> > -				_mm_prefetch((void *)bufs[i + 3], 0);
> > +				rte_prefetch0((void *)bufs[i + 3]);
> >  				/*
> >  				 * workers should update in_port to hold the
> >  				 * output port value
> > --
> > 2.7.0



More information about the dev mailing list