These modules only needed for FTP/TFTP conntrack tests.  These tests
are already calling CHECK_CONNTRACK_ALG() and so the module loading
should happen in there.

Loading and, more importantly, unloading of these two modules are very
time consuming operations.  On my test VM each takes about 3 seconds
to unload, significantly increasing the test suite run time.

This change reduces the total time required for 'make check-kernel'
on my test VM from 30 to 20 minutes.  And seem to provide a similar
speed up for our tests in GitHub Actions as well.

Signed-off-by: Ilya Maximets <[email protected]>
---
 tests/system-kmod-macros.at | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
index c29ea82ed..421bec677 100644
--- a/tests/system-kmod-macros.at
+++ b/tests/system-kmod-macros.at
@@ -64,8 +64,7 @@ m4_define([CONFIGURE_VETH_OFFLOADS],
 # kernel conntrack tables when the test is finished.
 #
 m4_define([CHECK_CONNTRACK],
-    [m4_foreach([mod], [[nf_conntrack_ipv4], [nf_conntrack_ipv6], [nf_nat_ftp],
-                        [nf_nat_tftp]],
+    [m4_foreach([mod], [[nf_conntrack_ipv4], [nf_conntrack_ipv6]],
                 [modprobe mod || echo "Module mod not loaded."
                  on_exit 'modprobe -r mod'
                 ])
@@ -77,9 +76,13 @@ m4_define([CHECK_CONNTRACK],
 # CHECK_CONNTRACK_ALG()
 #
 # Perform requirements checks for running conntrack ALG tests. The kernel
-# supports ALG, so no check is needed.
+# supports ALG, so no check is needed.  But we need to load the modules.
 #
-m4_define([CHECK_CONNTRACK_ALG])
+m4_define([CHECK_CONNTRACK_ALG],
+    [m4_foreach([mod], [[nf_nat_ftp], [nf_nat_tftp]],
+                [modprobe mod || echo "Module mod not loaded."
+                 on_exit 'modprobe -r mod'])]
+)
 
 # CHECK_CONNTRACK_LOCAL_STACK()
 #
-- 
2.54.0

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

Reply via email to