diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2021-08-03 19:36:39 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2021-08-05 11:46:33 +0200 |
commit | a3bd383e94a9ecfeeeed7b1b09cd5fee2328bf9c (patch) | |
tree | 60009994222e11e178c356a003ce24ca2a2ba3aa /acinclude.m4 | |
parent | e21e9dcec24101648918e49e0b609106048e0850 (diff) | |
download | openvswitch-a3bd383e94a9ecfeeeed7b1b09cd5fee2328bf9c.tar.gz |
acinclude: Don't set AVX512-related configuration via CFLAGS.
The correct way to pass configuration options is to define them
inside the config.h. Additionally, few long lines wrapped and
fixed the unnecessary double check for -mavx512f.
Fixes: abb807e27dd4 ("dpif-netdev: Add command to switch dpif implementation.")
Fixes: 5324b54e606a ("dpif-netdev: Add configure to enable autovalidator at build time.")
Fixes: e90e115a01af ("dpif-netdev: implement subtable lookup validation.")
Fixes: 352b6c7116cd ("dpif-lookup: add avx512 gather implementation.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Cian Ferriter <cian.ferriter@intel.com>
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 5a48f0335..dba365ea1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -19,13 +19,16 @@ dnl This enables automatically running all unit tests with all MFEX dnl implementations. AC_DEFUN([OVS_CHECK_MFEX_AUTOVALIDATOR], [ AC_ARG_ENABLE([mfex-default-autovalidator], - [AC_HELP_STRING([--enable-mfex-default-autovalidator], [Enable MFEX autovalidator as default miniflow_extract implementation.])], + [AC_HELP_STRING([--enable-mfex-default-autovalidator], + [Enable MFEX autovalidator as default + miniflow_extract implementation.])], [autovalidator=yes],[autovalidator=no]) AC_MSG_CHECKING([whether MFEX Autovalidator is default implementation]) if test "$autovalidator" != yes; then AC_MSG_RESULT([no]) else - OVS_CFLAGS="$OVS_CFLAGS -DMFEX_AUTOVALIDATOR_DEFAULT" + AC_DEFINE([MFEX_AUTOVALIDATOR_DEFAULT], [1], + [Autovalidator for miniflow_extract is a default implementation.]) AC_MSG_RESULT([yes]) fi ]) @@ -35,13 +38,17 @@ dnl This enables automatically running all unit tests with all DPCLS dnl implementations. AC_DEFUN([OVS_CHECK_DPCLS_AUTOVALIDATOR], [ AC_ARG_ENABLE([autovalidator], - [AC_HELP_STRING([--enable-autovalidator], [Enable DPCLS autovalidator as default subtable search implementation.])], + [AC_HELP_STRING([--enable-autovalidator], + [Enable DPCLS autovalidator as default subtable + search implementation.])], [autovalidator=yes],[autovalidator=no]) AC_MSG_CHECKING([whether DPCLS Autovalidator is default implementation]) if test "$autovalidator" != yes; then AC_MSG_RESULT([no]) else - OVS_CFLAGS="$OVS_CFLAGS -DDPCLS_AUTOVALIDATOR_DEFAULT" + AC_DEFINE([DPCLS_AUTOVALIDATOR_DEFAULT], [1], + [Autovalidator for the userspace datapath classifier is a + default implementation.]) AC_MSG_RESULT([yes]) fi ]) @@ -50,17 +57,34 @@ dnl Set OVS DPIF default implementation at configure time for running the unit dnl tests on the whole codebase without modifying tests per DPIF impl AC_DEFUN([OVS_CHECK_DPIF_AVX512_DEFAULT], [ AC_ARG_ENABLE([dpif-default-avx512], - [AC_HELP_STRING([--enable-dpif-default-avx512], [Enable DPIF AVX512 implementation as default.])], + [AC_HELP_STRING([--enable-dpif-default-avx512], + [Enable DPIF AVX512 implementation as default.])], [dpifavx512=yes],[dpifavx512=no]) AC_MSG_CHECKING([whether DPIF AVX512 is default implementation]) if test "$dpifavx512" != yes; then AC_MSG_RESULT([no]) else - OVS_CFLAGS="$OVS_CFLAGS -DDPIF_AVX512_DEFAULT" + AC_DEFINE([DPIF_AVX512_DEFAULT], [1], + [DPIF AVX512 is a default implementation of the userspace + datapath interface.]) AC_MSG_RESULT([yes]) fi ]) +dnl OVS_CHECK_AVX512 +dnl +dnl Checks if compiler and binutils supports AVX512. +AC_DEFUN([OVS_CHECK_AVX512], [ + OVS_CHECK_BINUTILS_AVX512 + OVS_CHECK_CC_OPTION( + [-mavx512f], [ovs_have_cc_mavx512f=yes], [ovs_have_cc_mavx512f=no]) + AM_CONDITIONAL([HAVE_AVX512F], [test $ovs_have_cc_mavx512f = yes]) + if test "$ovs_have_cc_mavx512f" = yes; then + AC_DEFINE([HAVE_AVX512F], [1], + [Define to 1 if compiler supports AVX512.]) + fi +]) + dnl OVS_ENABLE_WERROR AC_DEFUN([OVS_ENABLE_WERROR], [AC_ARG_ENABLE( |