diff mbox series

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

Message ID 20220707153900.3147694-6-emma.finn@intel.com
State Changes Requested
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
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Finn, Emma July 7, 2022, 3:38 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>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 NEWS              |  2 ++
 acinclude.m4      | 21 +++++++++++++++++++++
 configure.ac      |  1 +
 lib/odp-execute.c |  4 ++++
 4 files changed, 28 insertions(+)

Comments

Pai G, Sunil July 12, 2022, 11:18 a.m. UTC | #1
Hi Amber/Emma, 

Thanks for the patch, couple of minor nits below.

> -----Original Message-----
> From: dev <ovs-dev-bounces@openvswitch.org> On Behalf Of Emma Finn
> Sent: Thursday, July 7, 2022 9:09 PM
> To: dev@openvswitch.org; echaudro@redhat.com; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Amber, Kumar <kumar.amber@intel.com>
> Cc: i.maximets@ovn.org
> Subject: [ovs-dev] [v8 05/10] dpif-netdev: Add configure option to enable
> actions autovalidator at build time.

I think the title should have "acinclude" instead of "dpif-netdev" here.

> 
> 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>
> ---
>  NEWS              |  2 ++
>  acinclude.m4      | 21 +++++++++++++++++++++
>  configure.ac      |  1 +
>  lib/odp-execute.c |  4 ++++
>  4 files changed, 28 insertions(+)
> 
> diff --git a/NEWS b/NEWS
> index a279cbc29..607514874 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -47,6 +47,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.
> 
> 
>  v2.17.0 - 17 Feb 2022
> diff --git a/acinclude.m4 b/acinclude.m4 index b518aa624..e63494e1d 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -14,6 +14,27 @@
>  # See the License for the specific language governing permissions and  #
> limitations under the License.
> 
> +dnl Set OVS Actions Autovalidator as the default action implementation
> +at compile time?

Typo above - "?" instead of "."

<snipped>

Thanks and regards
Sunil
Finn, Emma July 12, 2022, 11:46 a.m. UTC | #2
> -----Original Message-----
> From: Pai G, Sunil <sunil.pai.g@intel.com>
> Sent: Tuesday 12 July 2022 12:18
> To: Finn, Emma <emma.finn@intel.com>; Amber, Kumar
> <kumar.amber@intel.com>; dev@openvswitch.org
> Cc: i.maximets@ovn.org; echaudro@redhat.com; Van Haaren, Harry
> <harry.van.haaren@intel.com>
> Subject: RE: [ovs-dev] [v8 05/10] dpif-netdev: Add configure option to enable
> actions autovalidator at build time.
> 
> Hi Amber/Emma,
> 
> Thanks for the patch, couple of minor nits below.
> 
> > -----Original Message-----
> > From: dev <ovs-dev-bounces@openvswitch.org> On Behalf Of Emma Finn
> > Sent: Thursday, July 7, 2022 9:09 PM
> > To: dev@openvswitch.org; echaudro@redhat.com; Van Haaren, Harry
> > <harry.van.haaren@intel.com>; Amber, Kumar <kumar.amber@intel.com>
> > Cc: i.maximets@ovn.org
> > Subject: [ovs-dev] [v8 05/10] dpif-netdev: Add configure option to
> > enable actions autovalidator at build time.
> 
> I think the title should have "acinclude" instead of "dpif-netdev" here.
> 
> >
> > 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>
> > ---
> >  NEWS              |  2 ++
> >  acinclude.m4      | 21 +++++++++++++++++++++
> >  configure.ac      |  1 +
> >  lib/odp-execute.c |  4 ++++
> >  4 files changed, 28 insertions(+)
> >
> > diff --git a/NEWS b/NEWS
> > index a279cbc29..607514874 100644
> > --- a/NEWS
> > +++ b/NEWS
> > @@ -47,6 +47,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.
> >
> >
> >  v2.17.0 - 17 Feb 2022
> > diff --git a/acinclude.m4 b/acinclude.m4 index b518aa624..e63494e1d
> > 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -14,6 +14,27 @@
> >  # See the License for the specific language governing permissions and
> > # limitations under the License.
> >
> > +dnl Set OVS Actions Autovalidator as the default action
> > +implementation at compile time?
> 
> Typo above - "?" instead of "."
> 
Yes, will fix in next revision. 

> <snipped>
> 
> Thanks and regards
> Sunil
diff mbox series

Patch

diff --git a/NEWS b/NEWS
index a279cbc29..607514874 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,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.
 
 
 v2.17.0 - 17 Feb 2022
diff --git a/acinclude.m4 b/acinclude.m4
index b518aa624..e63494e1d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -14,6 +14,27 @@ 
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+dnl Set OVS Actions Autovalidator as the default action implementation
+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
+    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 59ea0a281..ab8e1bd12 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
 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 6f8beae7d..49d92f012 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -928,7 +928,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);
     }