On Wed, Oct 07, 2020 at 05:10:38PM +0100, Vladimir Medvedkin wrote:
> Add new lookup implementation for DIR24_8 algorithm using
> AVX512 instruction set
> 
> Signed-off-by: Vladimir Medvedkin <vladimir.medved...@intel.com>
> Acked-by: Konstantin Ananyev <konstantin.anan...@intel.com>
> ---
>  doc/guides/rel_notes/release_20_11.rst |   3 +
>  lib/librte_fib/dir24_8.c               |  36 +++++++
>  lib/librte_fib/dir24_8_avx512.c        | 165 
> +++++++++++++++++++++++++++++++++
>  lib/librte_fib/dir24_8_avx512.h        |  24 +++++
>  lib/librte_fib/meson.build             |  34 +++++++
>  lib/librte_fib/rte_fib.c               |   2 +-
>  lib/librte_fib/rte_fib.h               |   4 +-
>  7 files changed, 266 insertions(+), 2 deletions(-)
>  create mode 100644 lib/librte_fib/dir24_8_avx512.c
>  create mode 100644 lib/librte_fib/dir24_8_avx512.h
> 
<snip>
> diff --git a/lib/librte_fib/meson.build b/lib/librte_fib/meson.build
> index 771828f..0a8adef 100644
> --- a/lib/librte_fib/meson.build
> +++ b/lib/librte_fib/meson.build
> @@ -5,3 +5,37 @@
>  sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c')
>  headers = files('rte_fib.h', 'rte_fib6.h')
>  deps += ['rib']
> +
> +# compile AVX512 version if:
> +# we are building 64-bit binary AND binutils can generate proper code
> +if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok.returncode() == 0
> +     # compile AVX512 version if either:
> +     # a. we have AVX512F supported in minimum instruction set baseline
> +     # b. it's not minimum instruction set, but supported by compiler
> +     #
> +     # in former case, just add avx512 C file to files list
> +     # in latter case, compile c file to static lib, using correct
> +     # compiler flags, and then have the .o file from static lib
> +     # linked into main lib.
> +
> +     # check if all required flags already enabled (variant a).
> +     acl_avx512_flags = ['__AVX512F__','__AVX512DQ__']
> +     acl_avx512_on = true
> +     foreach f:acl_avx512_flags
> +             if cc.get_define(f, args: machine_args) == ''
> +                     acl_avx512_on = false
> +             endif
> +     endforeach
> +
> +     if acl_avx512_on == true
> +             cflags += ['-DCC_DIR24_8_AVX512_SUPPORT']
> +             sources += files('dir24_8_avx512.c')
> +     elif cc.has_multi_arguments('-mavx512f', '-mavx512dq')
> +             dir24_8_avx512_tmp = static_library('dir24_8_avx512_tmp',
> +                             'dir24_8_avx512.c',
> +                             dependencies: static_rte_eal,
> +                             c_args: cflags + ['-mavx512f', '-mavx512dq'])
> +             objs += dir24_8_avx512_tmp.extract_objects('dir24_8_avx512.c')
> +             cflags += '-DCC_DIR24_8_AVX512_SUPPORT'
> +     endif
> +endif

This meson change looks ok to me. For the build-system part:

Acked-by: Bruce Richardson <bruce.richard...@intel.com>

Reply via email to