diff mbox series

migration/multifd: fix build error when qpl compression is enabled

Message ID 20241008104527.3516755-1-yuan1.liu@intel.com (mailing list archive)
State New
Headers show
Series migration/multifd: fix build error when qpl compression is enabled | expand

Commit Message

Yuan Liu Oct. 8, 2024, 10:45 a.m. UTC
The page_size member has been removed from the MultiFDSendParams
and MultiFDRecvParams. The function multifd_ram_page_size is used to
provide the page size in the multifd compressor.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
---
 migration/multifd-qpl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Peter Xu Oct. 9, 2024, 12:37 p.m. UTC | #1
On Tue, Oct 08, 2024 at 06:45:27PM +0800, Yuan Liu wrote:
> The page_size member has been removed from the MultiFDSendParams
> and MultiFDRecvParams. The function multifd_ram_page_size is used to
> provide the page size in the multifd compressor.
> 
> Signed-off-by: Yuan Liu <yuan1.liu@intel.com>

I'll queue and attach:

Fixes: 90fa121c6c ("migration/multifd: Inline page_size and page_count")

Yuan, is qpl going to be used in production?  When reaching that point, we
may want to add a build test in CI somehow.  Otherwise please help keep an
eye (or whoever can still keep an eye on this..) for at least each release
to make sure it builds and works as expected, because normal developers
(including Fabiano and myself) do no have hardware, and as of now we don't
check builds either (unless the library is packaged in most distros, then
we can try).

PS: it's definitely not 90fa121c6c to be blamed..  But I still added that
tag just to make stable lookup easier.  Looks like this is an unwanted side
effect of how we treat the compressor codes.. but I don't yet have a better
idea.

Thanks,

> ---
>  migration/multifd-qpl.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c
> index b0f1e2ba46..bbe466617f 100644
> --- a/migration/multifd-qpl.c
> +++ b/migration/multifd-qpl.c
> @@ -389,7 +389,7 @@ static void multifd_qpl_compress_pages_slow_path(MultiFDSendParams *p)
>  {
>      QplData *qpl = p->compress_data;
>      MultiFDPages_t *pages = &p->data->u.ram;
> -    uint32_t size = p->page_size;
> +    uint32_t size = multifd_ram_page_size();
>      qpl_job *job = qpl->sw_job;
>      uint8_t *zbuf = qpl->zbuf;
>      uint8_t *buf;
> @@ -420,7 +420,7 @@ static void multifd_qpl_compress_pages(MultiFDSendParams *p)
>  {
>      QplData *qpl = p->compress_data;
>      MultiFDPages_t *pages = &p->data->u.ram;
> -    uint32_t size = p->page_size;
> +    uint32_t size = multifd_ram_page_size();
>      QplHwJob *hw_job;
>      uint8_t *buf;
>      uint8_t *zbuf;
> @@ -560,7 +560,7 @@ static int multifd_qpl_decompress_pages_slow_path(MultiFDRecvParams *p,
>                                                    Error **errp)
>  {
>      QplData *qpl = p->compress_data;
> -    uint32_t size = p->page_size;
> +    uint32_t size = multifd_ram_page_size();
>      qpl_job *job = qpl->sw_job;
>      uint8_t *zbuf = qpl->zbuf;
>      uint8_t *addr;
> @@ -598,7 +598,7 @@ static int multifd_qpl_decompress_pages_slow_path(MultiFDRecvParams *p,
>  static int multifd_qpl_decompress_pages(MultiFDRecvParams *p, Error **errp)
>  {
>      QplData *qpl = p->compress_data;
> -    uint32_t size = p->page_size;
> +    uint32_t size = multifd_ram_page_size();
>      uint8_t *zbuf = qpl->zbuf;
>      uint8_t *addr;
>      uint32_t len;
> @@ -677,7 +677,7 @@ static int multifd_qpl_recv(MultiFDRecvParams *p, Error **errp)
>      }
>      for (int i = 0; i < p->normal_num; i++) {
>          qpl->zlen[i] = be32_to_cpu(qpl->zlen[i]);
> -        assert(qpl->zlen[i] <= p->page_size);
> +        assert(qpl->zlen[i] <= multifd_ram_page_size());
>          zbuf_len += qpl->zlen[i];
>      }
>  
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/migration/multifd-qpl.c b/migration/multifd-qpl.c
index b0f1e2ba46..bbe466617f 100644
--- a/migration/multifd-qpl.c
+++ b/migration/multifd-qpl.c
@@ -389,7 +389,7 @@  static void multifd_qpl_compress_pages_slow_path(MultiFDSendParams *p)
 {
     QplData *qpl = p->compress_data;
     MultiFDPages_t *pages = &p->data->u.ram;
-    uint32_t size = p->page_size;
+    uint32_t size = multifd_ram_page_size();
     qpl_job *job = qpl->sw_job;
     uint8_t *zbuf = qpl->zbuf;
     uint8_t *buf;
@@ -420,7 +420,7 @@  static void multifd_qpl_compress_pages(MultiFDSendParams *p)
 {
     QplData *qpl = p->compress_data;
     MultiFDPages_t *pages = &p->data->u.ram;
-    uint32_t size = p->page_size;
+    uint32_t size = multifd_ram_page_size();
     QplHwJob *hw_job;
     uint8_t *buf;
     uint8_t *zbuf;
@@ -560,7 +560,7 @@  static int multifd_qpl_decompress_pages_slow_path(MultiFDRecvParams *p,
                                                   Error **errp)
 {
     QplData *qpl = p->compress_data;
-    uint32_t size = p->page_size;
+    uint32_t size = multifd_ram_page_size();
     qpl_job *job = qpl->sw_job;
     uint8_t *zbuf = qpl->zbuf;
     uint8_t *addr;
@@ -598,7 +598,7 @@  static int multifd_qpl_decompress_pages_slow_path(MultiFDRecvParams *p,
 static int multifd_qpl_decompress_pages(MultiFDRecvParams *p, Error **errp)
 {
     QplData *qpl = p->compress_data;
-    uint32_t size = p->page_size;
+    uint32_t size = multifd_ram_page_size();
     uint8_t *zbuf = qpl->zbuf;
     uint8_t *addr;
     uint32_t len;
@@ -677,7 +677,7 @@  static int multifd_qpl_recv(MultiFDRecvParams *p, Error **errp)
     }
     for (int i = 0; i < p->normal_num; i++) {
         qpl->zlen[i] = be32_to_cpu(qpl->zlen[i]);
-        assert(qpl->zlen[i] <= p->page_size);
+        assert(qpl->zlen[i] <= multifd_ram_page_size());
         zbuf_len += qpl->zlen[i];
     }