diff mbox series

[ovs-dev,v4,6/9] dpif-netdev: Add configure option to enable actions autovalidator at build time.

Message ID 20220105165349.3447695-7-emma.finn@intel.com
State Superseded
Headers show
Series Actions Infrastructure + Optimizations | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Finn, Emma Jan. 5, 2022, 4:53 p.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>
---
 NEWS              |  2 ++
 acinclude.m4      | 17 +++++++++++++++++
 configure.ac      |  1 +
 lib/odp-execute.c |  4 ++++
 4 files changed, 24 insertions(+)

Comments

Van Haaren, Harry Jan. 6, 2022, 1:11 p.m. UTC | #1
> -----Original Message-----
> From: Finn, Emma <emma.finn@intel.com>
> Sent: Wednesday, January 5, 2022 4:54 PM
> To: dev@openvswitch.org; Van Haaren, Harry <harry.van.haaren@intel.com>;
> Amber, Kumar <kumar.amber@intel.com>
> Subject: [PATCH v4 6/9] dpif-netdev: Add configure option to enable actions
> autovalidator at build time.
> 
> 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>

Note to future reviewers, a "./boot.sh" is required after this patch to pick up the AC changes.
Failing to run boot.sh gives the following warning output:
     configure: WARNING: unrecognized options: --enable-actions-default-autovalidator

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
diff mbox series

Patch

diff --git a/NEWS b/NEWS
index af22a08bc..2e7dc1acb 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@  Post-v2.16.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.
    - Python:
      * For SSL support, the use of the pyOpenSSL library has been replaced
        with the native 'ssl' module.
diff --git a/acinclude.m4 b/acinclude.m4
index 23cd6df44..6514f2bd7 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -14,6 +14,23 @@ 
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+dnl Set OVS Actions Autovalidator as default action at compile time?
+dnl This enables automatically running all unit tests with all actions
+dnl 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
+    OVS_CFLAGS="$OVS_CFLAGS -DACTIONS_AUTOVALIDATOR_DEFAULT"
+    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 eaa9bf7ee..bfd0a9aff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,7 @@  OVS_CTAGS_IDENTIFIERS
 OVS_CHECK_DPCLS_AUTOVALIDATOR
 OVS_CHECK_DPIF_AVX512_DEFAULT
 OVS_CHECK_MFEX_AUTOVALIDATOR
+OVS_CHECK_ACTIONS_AUTOVALIDATOR
 OVS_CHECK_AVX512
 
 AC_ARG_VAR(KARCH, [Kernel Architecture String])
diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index ab051aecc..1bc9fae09 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -865,7 +865,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
         ovsthread_once_done(&once);
     }
 }