[dpdk-dev] [PATCH 1/3] net/iavf: enable AVX512 for legacy RX
Lu, Wenzhuo
wenzhuo.lu at intel.com
Fri Sep 11 05:06:11 CEST 2020
Hi Bruce,
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson at intel.com>
> Sent: Thursday, September 10, 2020 5:30 PM
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>
> Cc: dev at dpdk.org; Rong, Leyi <leyi.rong at intel.com>
> Subject: Re: [PATCH 1/3] net/iavf: enable AVX512 for legacy RX
>
> On Thu, Sep 10, 2020 at 01:59:03PM +0800, Wenzhuo Lu wrote:
> > To enhance the per-core performance, this patch adds some AVX512
> > instructions to the data path to handle the legacy RX descriptors.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
> > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> > Signed-off-by: Leyi Rong <leyi.rong at intel.com>
> > ---
> > drivers/net/iavf/iavf_rxtx.c | 27 +-
> > drivers/net/iavf/iavf_rxtx.h | 5 +
> > drivers/net/iavf/iavf_rxtx_vec_avx512.c | 720
> ++++++++++++++++++++++++++++++++
> > drivers/net/iavf/meson.build | 7 +
> > 4 files changed, 755 insertions(+), 4 deletions(-) create mode
> > 100644 drivers/net/iavf/iavf_rxtx_vec_avx512.c
> >
> <snip>
> > diff --git a/drivers/net/iavf/meson.build
> > b/drivers/net/iavf/meson.build index a3fad36..6427885 100644
> > --- a/drivers/net/iavf/meson.build
> > +++ b/drivers/net/iavf/meson.build
> > @@ -34,4 +34,11 @@ if arch_subdir == 'x86'
> > c_args: [cflags, '-mavx2'])
> > objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c')
> > endif
> > +
> > + if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512F')
> > + cflags += ['-DCC_AVX512_SUPPORT']
> > + cflags += ['-mavx512f']
> > + cflags += ['-march=skylake-avx512']
> > + sources += files('iavf_rxtx_vec_avx512.c')
> > + endif
>
> This logic is probably not what you want, since if the machine cpuflag value is
> set, then AVX512 instructions are already available, meaning you don't need to
> add in the mavx512 and march flags. Instead the logic should be handling the
> case where it's not enabled, but the compiler supports it.
> Use the AVX2 build logic as a reference.
Thanks for the review. I'll send a new version.
>
> > endif
> > --
> > 1.9.3
> >
More information about the dev
mailing list