qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Zhang <bryan.zhang@bytedance.com>
To: qemu-devel@nongnu.org
Cc: peterx@redhat.com, farosas@suse.de, yuan1.liu@intel.com,
	berrange@redhat.com, nanhai.zou@intel.com, hao.xiang@linux.dev,
	Bryan Zhang <bryan.zhang@bytedance.com>
Subject: [PATCH v2 5/5] tests/migration: Add integration test for 'qatzip' compression method
Date: Tue, 26 Mar 2024 22:42:21 +0000	[thread overview]
Message-ID: <20240326224221.3623014-6-bryan.zhang@bytedance.com> (raw)
In-Reply-To: <20240326224221.3623014-1-bryan.zhang@bytedance.com>

Adds an integration test for 'qatzip'.

Signed-off-by: Bryan Zhang <bryan.zhang@bytedance.com>
Signed-off-by: Hao Xiang <hao.xiang@linux.dev>
---
Revision: This commit now does some parameter setting to test that
changing the 'multifd-qatzip-level' parameter works, and to enable
software fallback so that the QATzip test can be run even if the test
machine does not have QAT.

 tests/qtest/migration-test.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 83512bce85..997f0aa323 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -35,6 +35,10 @@
 # endif /* CONFIG_TASN1 */
 #endif /* CONFIG_GNUTLS */
 
+#ifdef CONFIG_QATZIP
+#include <qatzip.h>
+#endif /* CONFIG_QATZIP */
+
 /* For dirty ring test; so far only x86_64 is supported */
 #if defined(__linux__) && defined(HOST_X86_64)
 #include "linux/kvm.h"
@@ -2676,6 +2680,22 @@ test_migrate_precopy_tcp_multifd_zstd_start(QTestState *from,
 }
 #endif /* CONFIG_ZSTD */
 
+#ifdef CONFIG_QATZIP
+static void *
+test_migrate_precopy_tcp_multifd_qatzip_start(QTestState *from,
+                                              QTestState *to)
+{
+    migrate_set_parameter_int(from, "multifd-qatzip-level", 2);
+    migrate_set_parameter_int(to, "multifd-qatzip-level", 2);
+
+    /* SW fallback is disabled by default, so enable it for testing. */
+    migrate_set_parameter_bool(from, "multifd-qatzip-sw-fallback", true);
+    migrate_set_parameter_bool(to, "multifd-qatzip-sw-fallback", true);
+
+    return test_migrate_precopy_tcp_multifd_start_common(from, to, "qatzip");
+}
+#endif
+
 static void test_multifd_tcp_none(void)
 {
     MigrateCommon args = {
@@ -2711,6 +2731,17 @@ static void test_multifd_tcp_zstd(void)
 }
 #endif
 
+#ifdef CONFIG_QATZIP
+static void test_multifd_tcp_qatzip(void)
+{
+    MigrateCommon args = {
+        .listen_uri = "defer",
+        .start_hook = test_migrate_precopy_tcp_multifd_qatzip_start,
+    };
+    test_precopy_common(&args);
+}
+#endif
+
 #ifdef CONFIG_GNUTLS
 static void *
 test_migrate_multifd_tcp_tls_psk_start_match(QTestState *from,
@@ -3600,6 +3631,10 @@ int main(int argc, char **argv)
     migration_test_add("/migration/multifd/tcp/plain/zstd",
                        test_multifd_tcp_zstd);
 #endif
+#ifdef CONFIG_QATZIP
+    migration_test_add("/migration/multifd/tcp/plain/qatzip",
+                test_multifd_tcp_qatzip);
+#endif
 #ifdef CONFIG_GNUTLS
     migration_test_add("/migration/multifd/tcp/tls/psk/match",
                        test_multifd_tcp_tls_psk_match);
-- 
2.30.2



  parent reply	other threads:[~2024-03-26 22:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 22:42 [PATCH v2 0/5] *** Implement using Intel QAT to offload ZLIB Bryan Zhang
2024-03-26 22:42 ` [PATCH v2 1/5] meson: Introduce 'qatzip' feature to the build system Bryan Zhang
2024-03-26 22:42 ` [PATCH v2 2/5] migration: Add migration parameters for QATzip Bryan Zhang
2024-03-28  7:23   ` Liu, Yuan1
2024-06-27  0:16     ` Yichen Wang
2024-06-27  7:25       ` Liu, Yuan1
2024-04-01 15:30   ` Fabiano Rosas
2024-03-26 22:42 ` [PATCH v2 3/5] migration: Introduce unimplemented 'qatzip' compression method Bryan Zhang
2024-03-26 22:42 ` [PATCH v2 4/5] migration: Implement 'qatzip' methods using QAT Bryan Zhang
2024-04-01 15:46   ` Fabiano Rosas
2024-03-26 22:42 ` Bryan Zhang [this message]
2024-04-01 15:40   ` [PATCH v2 5/5] tests/migration: Add integration test for 'qatzip' compression method Fabiano Rosas
2024-03-28  7:32 ` [PATCH v2 0/5] *** Implement using Intel QAT to offload ZLIB Liu, Yuan1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240326224221.3623014-6-bryan.zhang@bytedance.com \
    --to=bryan.zhang@bytedance.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=hao.xiang@linux.dev \
    --cc=nanhai.zou@intel.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yuan1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).