On 14 Jun 2022, at 13:57, 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 | 3 +++
> acinclude.m4 | 21 +++++++++++++++++++++
> configure.ac | 1 +
> lib/odp-execute.c | 4 ++++
> 4 files changed, 29 insertions(+)
>
> diff --git a/NEWS b/NEWS
> index 90ceabd63..7ae4d87bb 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -37,6 +37,9 @@ 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.
> +
>
>
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 7b2889a40..98f4599b1 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([MFEX_AUTOVALIDATOR_DEFAULT], [1],
Guess you did not test this patch at all :(
This would also imply you have to re-run all your validation testing...
diff --git a/acinclude.m4 b/acinclude.m4
index 98f4599b1..18e61b522 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -28,7 +28,7 @@ AC_DEFUN([OVS_CHECK_ACTIONS_AUTOVALIDATOR], [
if test "$autovalidator" != yes; then
AC_MSG_RESULT([no])
else
- AC_DEFINE([MFEX_AUTOVALIDATOR_DEFAULT], [1],
+ AC_DEFINE([ACTIONS_AUTOVALIDATOR_DEFAULT], [1],
[Autovalidator for actions is a default implementation.])
AC_MSG_RESULT([yes])
fi
> + [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 eff80d93f..a49b331ef 100644
> --- a/lib/odp-execute.c
> +++ b/lib/odp-execute.c
> @@ -870,7 +870,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.32.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev