diff mbox series

[ovs-dev,v12,05/10] acinclude: Add configure option to enable actions autovalidator at build time.

Message ID 20220715101623.1509885-6-emma.finn@intel.com
State Accepted
Headers show
Series Actions Infrastructure + Optimizations | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/intel-ovs-compilation fail test: fail
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Emma Finn July 15, 2022, 10:16 a.m. UTC
From: Kumar Amber <kumar.amber@intel.com>

This commit adds a new command to allow the user to enable the
actions autovalidator by default at build time thus allowing for
running unit test by default.

 $ ./configure --enable-actions-default-autovalidator

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
---
 NEWS              |  2 ++
 acinclude.m4      | 20 ++++++++++++++++++++
 configure.ac      |  1 +
 lib/odp-execute.c |  4 ++++
 4 files changed, 27 insertions(+)
diff mbox series

Patch

diff --git a/NEWS b/NEWS
index 0b95c0bf2..cf8e8a290 100644
--- a/NEWS
+++ b/NEWS
@@ -59,6 +59,8 @@  Post-v2.17.0
        implementations against default implementation.
      * Add command line option to switch between different actions
        implementations available at run time.
+     * Add build time configure command to enable auto-validator as default
+       actions implementation at build time.
    - Linux datapath:
      * Add offloading meter tc police.
      * Add support for offloading the check_pkt_len action.
diff --git a/acinclude.m4 b/acinclude.m4
index d15f11a4e..21c505fbd 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -14,6 +14,26 @@ 
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+dnl Set OVS Actions Autovalidator as the default action implementation
+dnl at compile time. This enables automatically running all unit tests
+dnl with all actions implementations.
+AC_DEFUN([OVS_CHECK_ACTIONS_AUTOVALIDATOR], [
+  AC_ARG_ENABLE([actions-default-autovalidator],
+                [AC_HELP_STRING([--enable-actions-default-autovalidator],
+                                [Enable actions autovalidator as default
+                                 ovs actions implementation.])],
+                [autovalidator=yes],[autovalidator=no])
+  AC_MSG_CHECKING([whether actions Autovalidator is default implementation])
+  if test "$autovalidator" != yes; then
+    AC_MSG_RESULT([no])
+  else
+    AC_DEFINE([ACTIONS_AUTOVALIDATOR_DEFAULT], [1],
+              [Autovalidator for actions is a default implementation.])
+    AC_MSG_RESULT([yes])
+  fi
+])
+
+
 dnl Set OVS MFEX Autovalidator as default miniflow extract at compile time?
 dnl This enables automatically running all unit tests with all MFEX
 dnl implementations.
diff --git a/configure.ac b/configure.ac
index 6f8679d7c..6c51e48ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,6 +184,7 @@  OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
 OVS_ENABLE_WERROR_TOP
 OVS_ENABLE_SPARSE
 OVS_CTAGS_IDENTIFIERS
+OVS_CHECK_ACTIONS_AUTOVALIDATOR
 OVS_CHECK_DPCLS_AUTOVALIDATOR
 OVS_CHECK_DPIF_AVX512_DEFAULT
 OVS_CHECK_MFEX_AUTOVALIDATOR
diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index 63fac3fcf..d974b8e11 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -925,7 +925,11 @@  odp_execute_init(void)
     static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
     if (ovsthread_once_start(&once)) {
         odp_execute_action_init();
+#ifdef ACTIONS_AUTOVALIDATOR_DEFAULT
+        odp_actions_impl_set("autovalidator");
+#else
         odp_actions_impl_set("scalar");
+#endif
         odp_execute_unixctl_init();
         ovsthread_once_done(&once);
     }