Hi David, Thanks a lot for the patch it really does improve the testing . Please find one comment below.
> -----Original Message----- > From: David Marchand <david.march...@redhat.com> > Sent: Tuesday, November 30, 2021 8:30 PM > To: d...@openvswitch.org > Cc: i.maxim...@ovn.org; Stokes, Ian <ian.sto...@intel.com>; > tredae...@redhat.com; Amber, Kumar <kumar.am...@intel.com>; > f...@sysclose.org; echau...@redhat.com; maxime.coque...@redhat.com > Subject: [PATCH v3 4/4] tests: Move MFEX tests to dpif-netdev. > > The MFEX code and tests do not depend on DPDK anymore. > We can move the unit tests to dpif-netdev. > > Signed-off-by: David Marchand <david.march...@redhat.com> > --- > Note: this patch depends on series > https://patchwork.ozlabs.org/project/openvswitch/list/?series=274452 > > --- > Documentation/topics/dpdk/bridge.rst | 22 +-- > tests/dpif-netdev.at | 167 +++++++++++++++++++++++ > tests/system-dpdk.at | 194 --------------------------- > 3 files changed, 178 insertions(+), 205 deletions(-) > > diff --git a/Documentation/topics/dpdk/bridge.rst > b/Documentation/topics/dpdk/bridge.rst > index 648ce203eb..c88658fa91 100644 > --- a/Documentation/topics/dpdk/bridge.rst > +++ b/Documentation/topics/dpdk/bridge.rst > @@ -385,21 +385,21 @@ Unit Test Miniflow Extract > ++++++++++++++++++++++++++ > > Unit test can also be used to test the workflow mentioned above by running - > the following test-case in tests/system-dpdk.at :: > +the following test-case in tests/dpif-netdev.at :: > > - make check-dpdk TESTSUITEFLAGS='-k MFEX' > - OVS-DPDK - MFEX Autovalidator > + make check TESTSUITEFLAGS='-k MFEX' > + dpif-netdev - MFEX Autovalidator > > -The unit test uses mulitple traffic type to test the correctness of the - > implementaions. > +The unit test uses multiple traffic type to test the correctness of the > +implementations. > > The MFEX commands can also be tested for negative and positive cases to > verify that the MFEX set command does not allow for incorrect parameters. > A user can directly run the following configuration test case in > -tests/system- > dpdk.at :: > +tests/dpif-netdev.at :: > > - make check-dpdk TESTSUITEFLAGS='-k MFEX' > - OVS-DPDK - MFEX Configuration > + make check TESTSUITEFLAGS='-k MFEX' > + dpif-netdev - MFEX Configuration > > Running Fuzzy test with Autovalidator > +++++++++++++++++++++++++++++++++++++ > @@ -431,7 +431,7 @@ Unit Fuzzy test with Autovalidator > +++++++++++++++++++++++++++++++++++++ > > Unit test can also be used to test the workflow mentioned above by running - > the following test-case in tests/system-dpdk.at :: > +the following test-case in tests/dpif-netdev.at :: > > - make check-dpdk TESTSUITEFLAGS='-k MFEX' > - OVS-DPDK - MFEX Autovalidator Fuzzy > + make check TESTSUITEFLAGS='-k MFEX' > + dpif-netdev - MFEX Autovalidator Fuzzy > diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at index > 53eee185ad..fbb8fe9a71 100644 > --- a/tests/dpif-netdev.at > +++ b/tests/dpif-netdev.at > @@ -635,3 +635,170 @@ OVS_WAIT_UNTIL([grep "flow: in_port is not an > exact match" ovs-vswitchd.log]) > OVS_VSWITCHD_STOP(["/flow: in_port is not an exact match/d /failed to > put/d"]) AT_CLEANUP > + > +AT_SETUP([dpif-netdev - MFEX Autovalidator]) AT_SKIP_IF([! $PYTHON3 -c > +"import scapy"], [], []) OVS_VSWITCHD_START( > + [add-port br0 p1 \ > + -- set interface p1 type=dummy-pmd]) > + > +AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | > +grep "True"], [], [dnl > +]) Recently we identified a scenario where the MFEX AutoValidation would not operate as expected. The root cause of the issue is that the AVX512 DPIF must be active for the MFEX AutoValidator to be executed. If the AVX512 DPIF is not active, the MFEX AutoValidator unit tests currently pass, but do not actually execute. The following patch ensures that the AVX512 DPIF is used in the unit test. If the DPIF-AVX512 is not available, the unit test is skipped, as the scalar DPIF does not use the MFEX function-pointer based optimizations due to community performance concerns (https://patchwork.ozlabs.org/project/openvswitch/patch/20210712055114.3676292-13-kumar.am...@intel.com/) Please the following here : AT_SKIP_IF([! ovs-appctl dpif-netdev/dpif-impl-set dpif_avx512], [], [dnl DPIF implementation set to dpif_avx512. ]) > + > +on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'" > +($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do > + ovs-appctl netdev-dummy/receive p1 "$pkt" || break > + done) & > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], > +[0], [dnl Miniflow extract implementation set to autovalidator. > +]) > + > +OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` > +-ge 1000]) pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1' > + > +OVS_VSWITCHD_STOP > +AT_CLEANUP > + > +AT_SETUP([dpif-netdev - MFEX Autovalidator Fuzzy]) AT_SKIP_IF([! > +$PYTHON3 -c "import scapy"], [], []) OVS_VSWITCHD_START( > + [add-port br0 p1 \ > + -- set interface p1 type=dummy-pmd]) > + > +AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | > +grep "True"], [], [dnl > +]) Like mentioned above, Please the following here : AT_SKIP_IF([! ovs-appctl dpif-netdev/dpif-impl-set dpif_avx512], [], [dnl DPIF implementation set to dpif_avx512. ]) Rest all looks fine to me. Regards Amber > + > +on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz'" > +($PYTHON3 $srcdir/genpkts.py -1 fuzz | while read pkt; do > + ovs-appctl netdev-dummy/receive p1 "$pkt" || break > + done) & > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], > +[0], [dnl Miniflow extract implementation set to autovalidator. > +]) > + > +OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` > +-ge 1000]) pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz' > + > +OVS_VSWITCHD_STOP > +AT_CLEANUP > + > +AT_SETUP([dpif-netdev - MFEX Configuration]) AT_SKIP_IF([! $PYTHON3 -c > +"import scapy"], [], []) OVS_VSWITCHD_START( > + [add-port br0 p1 \ > + -- set Open_vSwitch . other_config:pmd-cpu-mask=0xC \ > + -- set interface p1 type=dummy-pmd]) > + > +on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'" > +($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do > + ovs-appctl netdev-dummy/receive p1 "$pkt" || break > + done) & > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar 1], [2], > +[], [dnl > +Error: unknown argument 1. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 6 study 300 > +xyz], [2], [], [dnl > +Error: invalid study_pkt_cnt value: xyz. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar abcd], [2], > +[], [dnl > +Error: unknown argument abcd. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 scalar > +abcd], [2], [], [dnl > +Error: unknown argument abcd. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd], [2], [], > +[dnl > +Error: -pmd option requires a thread id argument. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set tudy abcd], [2], > +[], [dnl > +Error: unknown argument abcd. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 7 study > +abcd], [2], [], [dnl > +Error: invalid study_pkt_cnt value: abcd. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study], > +[0], [dnl Miniflow extract implementation set to study, on pmd thread 3, > studying 128 packets. > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study 512], > +[0], [dnl Miniflow extract implementation set to study, on pmd thread 3, > studying 512 packets. > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study 512], [0], > +[dnl Miniflow extract implementation set to study, studying 512 packets. > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study], [0], [dnl > +Miniflow extract implementation set to study, studying 128 packets. > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 > +autovalidator], [0], [dnl Miniflow extract implementation set to > autovalidator, > on pmd thread 3. > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd zero study], > +[2], [], [dnl > +Error: miniflow extract parser not changed, PMD thread passed is not valid: > 'zero'. Pass a valid pmd thread ID. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1], [2], [], > +[dnl > +Error: no miniflow extract name provided. Output of miniflow-parser-get > shows implementation list. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 > +superstudy], [2], [], [dnl > +Error: unknown miniflow extract implementation superstudy. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set superstudy], [2], > +[], [dnl > +Error: unknown miniflow extract implementation superstudy. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 study > +-pmd], [2], [], [dnl > +Error: invalid study_pkt_cnt value: -pmd. > +ovs-appctl: ovs-vswitchd: server returned an error > +]) > + > +pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1' > + > +OVS_VSWITCHD_STOP([" > +\@Error: unknown argument 1.@d > +\@Error: invalid study_pkt_cnt value: xyz.@d > +\@Error: unknown argument abcd.@d > +\@Error: -pmd option requires a thread id argument.@d > +\@Error: invalid study_pkt_cnt value: abcd.@d > +\@Error: miniflow extract parser not changed, PMD thread passed is not > +valid: 'zero'. Pass a valid pmd thread ID.@d > +\@Error: no miniflow extract name provided. Output of > +miniflow-parser-get shows implementation list.@d > +\@Error: unknown miniflow extract implementation superstudy.@d > +\@Error: invalid study_pkt_cnt value: -pmd.@d > +"]) > +AT_CLEANUP > diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index > 76b60f3c3a..fc030ff1ec 100644 > --- a/tests/system-dpdk.at > +++ b/tests/system-dpdk.at > @@ -221,197 +221,3 @@ OVS_VSWITCHD_STOP("m4_join([], > [SYSTEM_DPDK_ALLOWED_LOGS], [ > ])") > AT_CLEANUP > dnl > -------------------------------------------------------------------------- > - > -dnl > -------------------------------------------------------------------------- > -dnl Add standard DPDK PHY port > -AT_SETUP([OVS-DPDK - MFEX Autovalidator]) > -AT_KEYWORDS([dpdk]) > -AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], []) > - > -OVS_DPDK_START() > - > -dnl Add userspace bridge and attach it to OVS -AT_CHECK([ovs-vsctl add-br br0 > -- set bridge br0 datapath_type=netdev]) -AT_CHECK([ovs-vsctl add-port br0 p1 > - > - set interface p1 type=dummy-pmd]) -AT_CHECK([ovs-vsctl show], [], [stdout]) > - > -AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep > "True"], [], [dnl > -]) > - > -on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'" > -($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do > - ovs-appctl netdev-dummy/receive p1 "$pkt" || break > - done) & > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], > [dnl > -Miniflow extract implementation set to autovalidator. > -]) > - > -OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` -ge > 1000]) -pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1' > - > -dnl Clean up > -AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr]) > -OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]") > -AT_CLEANUP > -dnl > -------------------------------------------------------------------------- > - > -dnl > -------------------------------------------------------------------------- > -dnl Add standard DPDK PHY port > -AT_SETUP([OVS-DPDK - MFEX Autovalidator Fuzzy]) > -AT_KEYWORDS([dpdk]) > -AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], []) > -OVS_DPDK_START() > - > -dnl Add userspace bridge and attach it to OVS -AT_CHECK([ovs-vsctl add-br br0 > -- set bridge br0 datapath_type=netdev]) -AT_CHECK([ovs-vsctl add-port br0 p1 > - > - set interface p1 type=dummy-pmd]) -AT_CHECK([ovs-vsctl show], [], [stdout]) > - > -AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep > "True"], [], [dnl > -]) > - > -on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz'" > -($PYTHON3 $srcdir/genpkts.py -1 fuzz | while read pkt; do > - ovs-appctl netdev-dummy/receive p1 "$pkt" || break > - done) & > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], > [dnl > -Miniflow extract implementation set to autovalidator. > -]) > - > -OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` -ge > 1000]) -pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz' > - > -dnl Clean up > -AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr]) > -OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]") > -AT_CLEANUP > -dnl > -------------------------------------------------------------------------- > - > -dnl > -------------------------------------------------------------------------- > -AT_SETUP([OVS-DPDK - MFEX Configuration]) > -AT_KEYWORDS([dpdk]) > -AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], []) > - > -OVS_DPDK_START() > -AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu- > mask=0xC]) -dnl Add userspace bridge and attach it to OVS -AT_CHECK([ovs-vsctl > add-br br0 -- set bridge br0 datapath_type=netdev]) -AT_CHECK([ovs-vsctl add- > port br0 p1 -- set interface p1 type=dummy-pmd]) -AT_CHECK([ovs-vsctl show], > [], [stdout]) > - > -on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'" > -($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do > - ovs-appctl netdev-dummy/receive p1 "$pkt" || break > - done) & > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar 1], [2], -[], > [dnl > -Error: unknown argument 1. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 6 study 300 xyz], > [2], -[], [dnl > -Error: invalid study_pkt_cnt value: xyz. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar abcd], [2], -[], > [dnl > -Error: unknown argument abcd. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 scalar abcd], > [2], -[], [dnl > -Error: unknown argument abcd. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd], [2], -[], [dnl > -Error: -pmd option requires a thread id argument. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set tudy abcd], [2], -[], > [dnl > -Error: unknown argument abcd. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 7 study abcd], [2], > -[], [dnl > -Error: invalid study_pkt_cnt value: abcd. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study], [0], [dnl > -Miniflow extract implementation set to study, on pmd thread 3, studying 128 > packets. > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study 512], [0], > [dnl -Miniflow extract implementation set to study, on pmd thread 3, studying > 512 packets. > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study 512], [0], [dnl - > Miniflow extract implementation set to study, studying 512 packets. > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study], [0], [dnl - > Miniflow extract implementation set to study, studying 128 packets. > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 autovalidator], > [0], [dnl -Miniflow extract implementation set to autovalidator, on pmd thread > 3. > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd zero study], [2], - > [], [dnl > -Error: miniflow extract parser not changed, PMD thread passed is not valid: > 'zero'. Pass a valid pmd thread ID. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1], [2], -[], [dnl > -Error: no miniflow extract name provided. Output of miniflow-parser-get shows > implementation list. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 superstudy], [2], > -[], [dnl > -Error: unknown miniflow extract implementation superstudy. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set superstudy], [2], -[], > [dnl > -Error: unknown miniflow extract implementation superstudy. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 study -pmd], > [2], -[], [dnl > -Error: invalid study_pkt_cnt value: -pmd. > -ovs-appctl: ovs-vswitchd: server returned an error > -]) > - > -pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1' > - > -dnl Clean up > -AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr]) - > OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ > -\@Error: unknown argument 1.@d > -\@Error: invalid study_pkt_cnt value: xyz.@d > -\@Error: unknown argument abcd.@d > -\@Error: -pmd option requires a thread id argument.@d > -\@Error: invalid study_pkt_cnt value: abcd.@d > -\@Error: miniflow extract parser not changed, PMD thread passed is not valid: > 'zero'. Pass a valid pmd thread ID.@d > -\@Error: no miniflow extract name provided. Output of miniflow-parser-get > shows implementation list.@d > -\@Error: unknown miniflow extract implementation superstudy.@d > -\@Error: invalid study_pkt_cnt value: -pmd.@d > -])") > -AT_CLEANUP dnl > -dnl > -------------------------------------------------------------------------- > -- > 2.23.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev