On 10 May 2022, at 16:21, Emma Finn wrote:

> From: Kumar Amber <[email protected]>
>
> 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 <[email protected]>
> Acked-by: Harry van Haaren <[email protected]>
> ---
>  NEWS              |  2 ++
>  acinclude.m4      | 17 +++++++++++++++++
>  configure.ac      |  1 +
>  lib/odp-execute.c |  4 ++++
>  4 files changed, 24 insertions(+)
>
> diff --git a/NEWS b/NEWS
> index eecdcda5e..73796e4d5 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -62,6 +62,8 @@ v2.17.0 - 17 Feb 2022
>         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 61e88105f..0e80a17a6 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?


I would change this to (with some line wrapping):

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])

Maybe split the long line below a bit, like the other autovalidator ones?

+                [AC_HELP_STRING([--enable-actions-default-autovalidator],
                                 [Enable actions autovalidator as default
                                  actions implementation.])],


> +  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"

Why modify the CFLAGS, we should do the same as the other autovalidators.

> +    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 a79109bda..9bb3d637b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -187,6 +187,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 c2be74454..ba532101f 100644
> --- a/lib/odp-execute.c
> +++ b/lib/odp-execute.c
> @@ -868,7 +868,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);
>      }
>  }
> -- 
> 2.25.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to