[dpdk-dev] [PATCH 2/3] arm64: acl: add neon based acl implementation

Ananyev, Konstantin konstantin.ananyev at intel.com
Tue Nov 3 11:23:55 CET 2015


Hi Jacob,

> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob at caviumnetworks.com]
> Sent: Tuesday, November 03, 2015 4:31 AM
> To: Ananyev, Konstantin
> Cc: dev at dpdk.org; thomas.monjalon at 6wind.com; Hunt, David; viktorin at rehivetech.com
> Subject: Re: [PATCH 2/3] arm64: acl: add neon based acl implementation
> 
> On Mon, Nov 02, 2015 at 04:54:24PM +0000, Ananyev, Konstantin wrote:
> > Hi Jacob,
> >
> > > diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
> > > index d60219f..e2fdebd 100644
> > > --- a/lib/librte_acl/rte_acl.c
> > > +++ b/lib/librte_acl/rte_acl.c
> > > @@ -55,11 +55,32 @@ rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx,
> > >  	return -ENOTSUP;
> > >  }
> > >
> > > +int __attribute__ ((weak))
> > > +rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx,
> > > +	__rte_unused const uint8_t **data,
> > > +	__rte_unused uint32_t *results,
> > > +	__rte_unused uint32_t num,
> > > +	__rte_unused uint32_t categories)
> > > +{
> > > +	return -ENOTSUP;
> > > +}
> > > +
> > > +int __attribute__ ((weak))
> > > +rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx,
> > > +	__rte_unused const uint8_t **data,
> > > +	__rte_unused uint32_t *results,
> > > +	__rte_unused uint32_t num,
> > > +	__rte_unused uint32_t categories)
> > > +{
> > > +	return -ENOTSUP;
> > > +}
> > > +
> > >  static const rte_acl_classify_t classify_fns[] = {
> > >  	[RTE_ACL_CLASSIFY_DEFAULT] = rte_acl_classify_scalar,
> > >  	[RTE_ACL_CLASSIFY_SCALAR] = rte_acl_classify_scalar,
> > >  	[RTE_ACL_CLASSIFY_SSE] = rte_acl_classify_sse,
> > >  	[RTE_ACL_CLASSIFY_AVX2] = rte_acl_classify_avx2,
> > > +	[RTE_ACL_CLASSIFY_NEON] = rte_acl_classify_neon,
> > >  };
> > >
> > >  /* by default, use always available scalar code path. */
> > > @@ -93,6 +114,9 @@ rte_acl_init(void)
> > >  {
> > >  	enum rte_acl_classify_alg alg = RTE_ACL_CLASSIFY_DEFAULT;
> > >
> > > +#ifdef RTE_ARCH_ARM64
> > > +	alg =  RTE_ACL_CLASSIFY_NEON;
> > > +#else
> 
> Hi Konstantin,
> >
> > On ARM, is there any specific cpu flag that you can use to determine is NEON
> > isa is supported or not?
> 
> Yes, on armv7(RTE_CPUFLAG_NEON). On armv8-a NEON is mandatory.
> 
> > It would be good to avoid extra conditional compilation here if possible.
> neon acl is verified/ported only on armv8. While adding the armv7 support the
> check can be extended for cpuflag based on RTE_CPUFLAG_NEON on armv7

Ok, and is there a flag that allows to distinguish between armv7 and arm8 then at runtime?
It is probably ok like that, but with all that conditional compilations it gets too messy.
Another thing - if you can distinguish between armv7 and armv8 at runtime, then you probably
can set alg = RTE_ACL_CLASSIFY_DEFAULT for armv7 and alg = RTE_ACL_CLASSIFY_NEON for arm8?
Konstantin

> 
> > Another question - did I get it right that NEON isa is supported on all
> > possible RTE_ARCH_ARM64 cpu models you plan to support?
> 
> Yes
> 
> > Konstantin
> >
> >


More information about the dev mailing list