[PATCH v5 5/5] tests/migration: Add integration test for 'qatzip' compression method

Yichen Wang posted 5 patches 4 months, 2 weeks ago
Maintainers: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH v5 5/5] tests/migration: Add integration test for 'qatzip' compression method
Posted by Yichen Wang 4 months, 2 weeks ago
From: Bryan Zhang <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>
Signed-off-by: Yichen Wang <yichen.wang@bytedance.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Yichen Wang <yichen.wang@bytedance.com>
---
 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 70b606b888..b796dd21cb 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -32,6 +32,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"
@@ -2992,6 +2996,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
+
 #ifdef CONFIG_QPL
 static void *
 test_migrate_precopy_tcp_multifd_qpl_start(QTestState *from,
@@ -3089,6 +3109,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_QPL
 static void test_multifd_tcp_qpl(void)
 {
@@ -3992,6 +4023,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_QPL
     migration_test_add("/migration/multifd/tcp/plain/qpl",
                        test_multifd_tcp_qpl);
-- 
Yichen Wang
Re: [PATCH v5 5/5] tests/migration: Add integration test for 'qatzip' compression method
Posted by Peter Xu 4 months, 2 weeks ago
On Wed, Jul 10, 2024 at 07:52:29PM -0700, Yichen Wang wrote:
> From: Bryan Zhang <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>
> Signed-off-by: Yichen Wang <yichen.wang@bytedance.com>
> Reviewed-by: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Yichen Wang <yichen.wang@bytedance.com>
> ---
>  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 70b606b888..b796dd21cb 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -32,6 +32,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"
> @@ -2992,6 +2996,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);

Shouldn't this already crash when without the parameter?

> +
> +    return test_migrate_precopy_tcp_multifd_start_common(from, to, "qatzip");
> +}
> +#endif
> +
>  #ifdef CONFIG_QPL
>  static void *
>  test_migrate_precopy_tcp_multifd_qpl_start(QTestState *from,
> @@ -3089,6 +3109,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_QPL
>  static void test_multifd_tcp_qpl(void)
>  {
> @@ -3992,6 +4023,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_QPL
>      migration_test_add("/migration/multifd/tcp/plain/qpl",
>                         test_multifd_tcp_qpl);
> -- 
> Yichen Wang
> 

-- 
Peter Xu
Re: [External] Re: [PATCH v5 5/5] tests/migration: Add integration test for 'qatzip' compression method
Posted by Yichen Wang 4 months, 2 weeks ago
On Thu, Jul 11, 2024 at 7:23 AM Peter Xu <peterx@redhat.com> wrote:
>
> On Wed, Jul 10, 2024 at 07:52:29PM -0700, Yichen Wang wrote:
> > From: Bryan Zhang <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>
> > Signed-off-by: Yichen Wang <yichen.wang@bytedance.com>
> > Reviewed-by: Fabiano Rosas <farosas@suse.de>
> > Signed-off-by: Yichen Wang <yichen.wang@bytedance.com>
> > ---
> >  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 70b606b888..b796dd21cb 100644
> > --- a/tests/qtest/migration-test.c
> > +++ b/tests/qtest/migration-test.c
> > @@ -32,6 +32,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"
> > @@ -2992,6 +2996,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);
>
> Shouldn't this already crash when without the parameter?
Ah, my bad. I tested the features manually with two machines, and
didn't run this. I will fix it in my next version.
>
> > +
> > +    return test_migrate_precopy_tcp_multifd_start_common(from, to, "qatzip");
> > +}
> > +#endif
> > +
> >  #ifdef CONFIG_QPL
> >  static void *
> >  test_migrate_precopy_tcp_multifd_qpl_start(QTestState *from,
> > @@ -3089,6 +3109,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_QPL
> >  static void test_multifd_tcp_qpl(void)
> >  {
> > @@ -3992,6 +4023,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_QPL
> >      migration_test_add("/migration/multifd/tcp/plain/qpl",
> >                         test_multifd_tcp_qpl);
> > --
> > Yichen Wang
> >
>
> --
> Peter Xu
>