summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Amber <kumar.amber@intel.com>2021-07-15 21:36:11 +0530
committerIan Stokes <ian.stokes@intel.com>2021-07-16 10:34:49 +0100
commit5324b54e606a5e0ff2a183f23a1b203e5e0b50aa (patch)
tree5c4c5020a15fc04e1d7e8a2de427b4bc7e32d650
parent5c5c98cec21bf1e62b302c59658965e26854b9e6 (diff)
downloadopenvswitch-5324b54e606a5e0ff2a183f23a1b203e5e0b50aa.tar.gz
dpif-netdev: Add configure to enable autovalidator at build time.
This commit adds a new command to allow the user to enable autovalidatior by default at build time thus allowing for runnig unit test by default. $ ./configure --enable-mfex-default-autovalidator Signed-off-by: Kumar Amber <kumar.amber@intel.com> Co-authored-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
-rw-r--r--Documentation/topics/dpdk/bridge.rst5
-rw-r--r--NEWS2
-rw-r--r--acinclude.m416
-rw-r--r--configure.ac1
-rw-r--r--lib/dpif-netdev-private-extract.c4
5 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/topics/dpdk/bridge.rst b/Documentation/topics/dpdk/bridge.rst
index 7c96f4d5e..a47153495 100644
--- a/Documentation/topics/dpdk/bridge.rst
+++ b/Documentation/topics/dpdk/bridge.rst
@@ -307,3 +307,8 @@ implementations provide the same results.
To set the Miniflow autovalidator, use this command ::
$ ovs-appctl dpif-netdev/miniflow-parser-set autovalidator
+
+A compile time option is available in order to test it with the OVS unit
+test suite. Use the following configure option ::
+
+ $ ./configure --enable-mfex-default-autovalidator
diff --git a/NEWS b/NEWS
index b01b4bd20..7bf09f8f1 100644
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,8 @@ Post-v2.15.0
* Add study function to miniflow function table which studies packet
and automatically chooses the best miniflow implementation for that
traffic.
+ * Add build time configure command to enable auto-validatior as default
+ miniflow implementation at build time.
- ovs-ctl:
* New option '--no-record-hostname' to disable hostname configuration
in ovsdb on startup.
diff --git a/acinclude.m4 b/acinclude.m4
index 343303447..5a48f0335 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -14,6 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+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.
+AC_DEFUN([OVS_CHECK_MFEX_AUTOVALIDATOR], [
+ AC_ARG_ENABLE([mfex-default-autovalidator],
+ [AC_HELP_STRING([--enable-mfex-default-autovalidator], [Enable MFEX autovalidator as default miniflow_extract implementation.])],
+ [autovalidator=yes],[autovalidator=no])
+ AC_MSG_CHECKING([whether MFEX Autovalidator is default implementation])
+ if test "$autovalidator" != yes; then
+ AC_MSG_RESULT([no])
+ else
+ OVS_CFLAGS="$OVS_CFLAGS -DMFEX_AUTOVALIDATOR_DEFAULT"
+ AC_MSG_RESULT([yes])
+ fi
+])
+
dnl Set OVS DPCLS Autovalidator as default subtable search at compile time?
dnl This enables automatically running all unit tests with all DPCLS
dnl implementations.
diff --git a/configure.ac b/configure.ac
index e45685a6c..46c402892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,6 +186,7 @@ OVS_ENABLE_SPARSE
OVS_CTAGS_IDENTIFIERS
OVS_CHECK_DPCLS_AUTOVALIDATOR
OVS_CHECK_DPIF_AVX512_DEFAULT
+OVS_CHECK_MFEX_AUTOVALIDATOR
OVS_CHECK_BINUTILS_AVX512
AC_ARG_VAR(KARCH, [Kernel Architecture String])
diff --git a/lib/dpif-netdev-private-extract.c b/lib/dpif-netdev-private-extract.c
index f1e81a451..ceb6d1084 100644
--- a/lib/dpif-netdev-private-extract.c
+++ b/lib/dpif-netdev-private-extract.c
@@ -60,7 +60,11 @@ void
dpif_miniflow_extract_init(void)
{
atomic_uintptr_t *mfex_func = (void *)&default_mfex_func;
+#ifdef MFEX_AUTOVALIDATOR_DEFAULT
+ int mfex_idx = MFEX_IMPL_AUTOVALIDATOR;
+#else
int mfex_idx = MFEX_IMPL_SCALAR;
+#endif
/* Call probe on each impl, and cache the result. */
for (int i = 0; i < MFEX_IMPL_MAX; i++) {