Adds the skeleton to support uadk compression method.
Complete functionality will be added in subsequent patches.
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
---
hw/core/qdev-properties-system.c | 2 +-
migration/meson.build | 1 +
migration/multifd-uadk.c | 20 ++++++++++++++++++++
migration/multifd.h | 5 +++--
qapi/migration.json | 5 ++++-
5 files changed, 29 insertions(+), 4 deletions(-)
create mode 100644 migration/multifd-uadk.c
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 6ccd7224f6..f13350b4fb 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -659,7 +659,7 @@ const PropertyInfo qdev_prop_fdc_drive_type = {
const PropertyInfo qdev_prop_multifd_compression = {
.name = "MultiFDCompression",
.description = "multifd_compression values, "
- "none/zlib/zstd/qpl",
+ "none/zlib/zstd/qpl/uadk",
.enum_table = &MultiFDCompression_lookup,
.get = qdev_propinfo_get_enum,
.set = qdev_propinfo_set_enum,
diff --git a/migration/meson.build b/migration/meson.build
index 1d432d5328..ed687ae286 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -44,6 +44,7 @@ if get_option('live_block_migration').allowed()
endif
system_ss.add(when: zstd, if_true: files('multifd-zstd.c'))
system_ss.add(when: qpl, if_true: files('multifd-qpl.c'))
+system_ss.add(when: uadk, if_true: files('multifd-uadk.c'))
specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
if_true: files('ram.c',
diff --git a/migration/multifd-uadk.c b/migration/multifd-uadk.c
new file mode 100644
index 0000000000..c2bb07535b
--- /dev/null
+++ b/migration/multifd-uadk.c
@@ -0,0 +1,20 @@
+/*
+ * Multifd UADK compression accelerator implementation
+ *
+ * Copyright (c) 2024 Huawei Technologies R & D (UK) Ltd
+ *
+ * Authors:
+ * Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/module.h"
+
+static void multifd_uadk_register(void)
+{
+ /* noop for now */
+}
+migration_init(multifd_uadk_register);
diff --git a/migration/multifd.h b/migration/multifd.h
index 5b7d9b15f8..0ecd6f47d7 100644
--- a/migration/multifd.h
+++ b/migration/multifd.h
@@ -34,13 +34,14 @@ MultiFDRecvData *multifd_get_recv_data(void);
/* Multifd Compression flags */
#define MULTIFD_FLAG_SYNC (1 << 0)
-/* We reserve 3 bits for compression methods */
-#define MULTIFD_FLAG_COMPRESSION_MASK (7 << 1)
+/* We reserve 4 bits for compression methods */
+#define MULTIFD_FLAG_COMPRESSION_MASK (0xf << 1)
/* we need to be compatible. Before compression value was 0 */
#define MULTIFD_FLAG_NOCOMP (0 << 1)
#define MULTIFD_FLAG_ZLIB (1 << 1)
#define MULTIFD_FLAG_ZSTD (2 << 1)
#define MULTIFD_FLAG_QPL (4 << 1)
+#define MULTIFD_FLAG_UADK (8 << 1)
/* This value needs to be a multiple of qemu_target_page_size() */
#define MULTIFD_PACKET_SIZE (512 * 1024)
diff --git a/qapi/migration.json b/qapi/migration.json
index 854e8609bd..0eaea9b0c3 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -632,12 +632,15 @@
# the deflate compression algorithm and use the Intel In-Memory Analytics
# Accelerator(IAA) accelerated compression and decompression. (Since 9.1)
#
+# @uadk: use UADK library compression method. (Since 9.1)
+#
# Since: 5.0
##
{ 'enum': 'MultiFDCompression',
'data': [ 'none', 'zlib',
{ 'name': 'zstd', 'if': 'CONFIG_ZSTD' },
- { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] }
+ { 'name': 'qpl', 'if': 'CONFIG_QPL' },
+ { 'name': 'uadk', 'if': 'CONFIG_UADK' } ] }
##
# @MigMode:
--
2.17.1
Shameer Kolothum via <qemu-devel@nongnu.org> writes: > Adds the skeleton to support uadk compression method. > Complete functionality will be added in subsequent patches. > > Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Fabiano Rosas <farosas@suse.de>
Please cc: maintainers on patches. You can use
scripts/get_maintainer.pl to find them.
Shameer Kolothum via <qemu-devel@nongnu.org> writes:
> Adds the skeleton to support uadk compression method.
> Complete functionality will be added in subsequent patches.
>
> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
[...]
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 854e8609bd..0eaea9b0c3 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -632,12 +632,15 @@
> # the deflate compression algorithm and use the Intel In-Memory Analytics
> # Accelerator(IAA) accelerated compression and decompression. (Since 9.1)
> #
> +# @uadk: use UADK library compression method. (Since 9.1)
Two spaces after '.' for consistency, please.
> +#
> # Since: 5.0
> ##
> { 'enum': 'MultiFDCompression',
> 'data': [ 'none', 'zlib',
> { 'name': 'zstd', 'if': 'CONFIG_ZSTD' },
> - { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] }
> + { 'name': 'qpl', 'if': 'CONFIG_QPL' },
> + { 'name': 'uadk', 'if': 'CONFIG_UADK' } ] }
>
> ##
> # @MigMode:
QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>
> -----Original Message-----
> From: Markus Armbruster <armbru@redhat.com>
> Sent: Wednesday, May 29, 2024 12:11 PM
> To: Shameer Kolothum via <qemu-devel@nongnu.org>
> Cc: peterx@redhat.com; farosas@suse.de; yuan1.liu@intel.com; Shameerali
> Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>; Linuxarm
> <linuxarm@huawei.com>; linwenkai (C) <linwenkai6@hisilicon.com>;
> zhangfei.gao@linaro.org; huangchenghai <huangchenghai2@huawei.com>
> Subject: Re: [PATCH 3/7] migration/multifd: add uadk compression
> framework
>
> Please cc: maintainers on patches. You can use
> scripts/get_maintainer.pl to find them.
Sure. My bad.
>
> Shameer Kolothum via <qemu-devel@nongnu.org> writes:
>
> > Adds the skeleton to support uadk compression method.
> > Complete functionality will be added in subsequent patches.
> >
> > Signed-off-by: Shameer Kolothum
> <shameerali.kolothum.thodi@huawei.com>
>
> [...]
>
> > diff --git a/qapi/migration.json b/qapi/migration.json
> > index 854e8609bd..0eaea9b0c3 100644
> > --- a/qapi/migration.json
> > +++ b/qapi/migration.json
> > @@ -632,12 +632,15 @@
> > # the deflate compression algorithm and use the Intel In-Memory
> Analytics
> > # Accelerator(IAA) accelerated compression and decompression. (Since
> 9.1)
> > #
> > +# @uadk: use UADK library compression method. (Since 9.1)
>
> Two spaces after '.' for consistency, please.
Ok.
> > +#
> > # Since: 5.0
> > ##
> > { 'enum': 'MultiFDCompression',
> > 'data': [ 'none', 'zlib',
> > { 'name': 'zstd', 'if': 'CONFIG_ZSTD' },
> > - { 'name': 'qpl', 'if': 'CONFIG_QPL' } ] }
> > + { 'name': 'qpl', 'if': 'CONFIG_QPL' },
> > + { 'name': 'uadk', 'if': 'CONFIG_UADK' } ] }
> >
> > ##
> > # @MigMode:
>
> QAPI schema
> Acked-by: Markus Armbruster <armbru@redhat.com>
Thanks,
Shameer
© 2016 - 2026 Red Hat, Inc.