Lines Matching refs:p
233 static int multifd_qpl_send_setup(MultiFDSendParams *p, Error **errp) in multifd_qpl_send_setup() argument
237 qpl = multifd_qpl_init(p->page_count, p->page_size, errp); in multifd_qpl_send_setup()
241 p->compress_data = qpl; in multifd_qpl_send_setup()
248 p->iov = g_new0(struct iovec, p->page_count + 2); in multifd_qpl_send_setup()
260 static void multifd_qpl_send_cleanup(MultiFDSendParams *p, Error **errp) in multifd_qpl_send_cleanup() argument
262 multifd_qpl_deinit(p->compress_data); in multifd_qpl_send_cleanup()
263 p->compress_data = NULL; in multifd_qpl_send_cleanup()
264 g_free(p->iov); in multifd_qpl_send_cleanup()
265 p->iov = NULL; in multifd_qpl_send_cleanup()
343 static void multifd_qpl_fill_iov(MultiFDSendParams *p, uint8_t *data, in multifd_qpl_fill_iov() argument
346 p->iov[p->iovs_num].iov_base = data; in multifd_qpl_fill_iov()
347 p->iov[p->iovs_num].iov_len = len; in multifd_qpl_fill_iov()
348 p->iovs_num++; in multifd_qpl_fill_iov()
349 p->next_packet_size += len; in multifd_qpl_fill_iov()
362 static void multifd_qpl_fill_packet(uint32_t idx, MultiFDSendParams *p, in multifd_qpl_fill_packet() argument
365 QplData *qpl = p->compress_data; in multifd_qpl_fill_packet()
368 multifd_qpl_fill_iov(p, data, len); in multifd_qpl_fill_packet()
404 static void multifd_qpl_compress_pages_slow_path(MultiFDSendParams *p) in multifd_qpl_compress_pages_slow_path() argument
406 QplData *qpl = p->compress_data; in multifd_qpl_compress_pages_slow_path()
407 uint32_t size = p->page_size; in multifd_qpl_compress_pages_slow_path()
412 for (int i = 0; i < p->pages->normal_num; i++) { in multifd_qpl_compress_pages_slow_path()
413 buf = p->pages->block->host + p->pages->offset[i]; in multifd_qpl_compress_pages_slow_path()
416 multifd_qpl_fill_packet(i, p, zbuf, job->total_out); in multifd_qpl_compress_pages_slow_path()
419 multifd_qpl_fill_packet(i, p, buf, size); in multifd_qpl_compress_pages_slow_path()
434 static void multifd_qpl_compress_pages(MultiFDSendParams *p) in multifd_qpl_compress_pages() argument
436 QplData *qpl = p->compress_data; in multifd_qpl_compress_pages()
437 MultiFDPages_t *pages = p->pages; in multifd_qpl_compress_pages()
438 uint32_t size = p->page_size; in multifd_qpl_compress_pages()
474 multifd_qpl_fill_packet(i, p, hw_job->sw_output, in multifd_qpl_compress_pages()
479 multifd_qpl_fill_packet(i, p, zbuf, hw_job->job->total_out); in multifd_qpl_compress_pages()
482 multifd_qpl_fill_packet(i, p, buf, size); in multifd_qpl_compress_pages()
498 static int multifd_qpl_send_prepare(MultiFDSendParams *p, Error **errp) in multifd_qpl_send_prepare() argument
500 QplData *qpl = p->compress_data; in multifd_qpl_send_prepare()
503 if (!multifd_send_prepare_common(p)) { in multifd_qpl_send_prepare()
508 len = p->pages->normal_num * sizeof(uint32_t); in multifd_qpl_send_prepare()
509 multifd_qpl_fill_iov(p, (uint8_t *) qpl->zlen, len); in multifd_qpl_send_prepare()
511 multifd_qpl_compress_pages(p); in multifd_qpl_send_prepare()
513 multifd_qpl_compress_pages_slow_path(p); in multifd_qpl_send_prepare()
517 p->flags |= MULTIFD_FLAG_QPL; in multifd_qpl_send_prepare()
518 multifd_send_fill_packet(p); in multifd_qpl_send_prepare()
532 static int multifd_qpl_recv_setup(MultiFDRecvParams *p, Error **errp) in multifd_qpl_recv_setup() argument
536 qpl = multifd_qpl_init(p->page_count, p->page_size, errp); in multifd_qpl_recv_setup()
540 p->compress_data = qpl; in multifd_qpl_recv_setup()
551 static void multifd_qpl_recv_cleanup(MultiFDRecvParams *p) in multifd_qpl_recv_cleanup() argument
553 multifd_qpl_deinit(p->compress_data); in multifd_qpl_recv_cleanup()
554 p->compress_data = NULL; in multifd_qpl_recv_cleanup()
599 static int multifd_qpl_decompress_pages_slow_path(MultiFDRecvParams *p, in multifd_qpl_decompress_pages_slow_path() argument
602 QplData *qpl = p->compress_data; in multifd_qpl_decompress_pages_slow_path()
603 uint32_t size = p->page_size; in multifd_qpl_decompress_pages_slow_path()
609 for (int i = 0; i < p->normal_num; i++) { in multifd_qpl_decompress_pages_slow_path()
611 addr = p->host + p->normal[i]; in multifd_qpl_decompress_pages_slow_path()
638 static int multifd_qpl_decompress_pages(MultiFDRecvParams *p, Error **errp) in multifd_qpl_decompress_pages() argument
640 QplData *qpl = p->compress_data; in multifd_qpl_decompress_pages()
641 uint32_t size = p->page_size; in multifd_qpl_decompress_pages()
647 for (int i = 0; i < p->normal_num; i++) { in multifd_qpl_decompress_pages()
648 addr = p->host + p->normal[i]; in multifd_qpl_decompress_pages()
678 for (int i = 0; i < p->normal_num; i++) { in multifd_qpl_decompress_pages()
702 static int multifd_qpl_recv(MultiFDRecvParams *p, Error **errp) in multifd_qpl_recv() argument
704 QplData *qpl = p->compress_data; in multifd_qpl_recv()
705 uint32_t in_size = p->next_packet_size; in multifd_qpl_recv()
706 uint32_t flags = p->flags & MULTIFD_FLAG_COMPRESSION_MASK; in multifd_qpl_recv()
713 p->id, flags, MULTIFD_FLAG_QPL); in multifd_qpl_recv()
716 multifd_recv_zero_page_process(p); in multifd_qpl_recv()
717 if (!p->normal_num) { in multifd_qpl_recv()
723 len = p->normal_num * sizeof(uint32_t); in multifd_qpl_recv()
725 ret = qio_channel_read_all(p->c, (void *) qpl->zlen, len, errp); in multifd_qpl_recv()
729 for (int i = 0; i < p->normal_num; i++) { in multifd_qpl_recv()
731 assert(qpl->zlen[i] <= p->page_size); in multifd_qpl_recv()
737 ret = qio_channel_read_all(p->c, (void *) qpl->zbuf, zbuf_len, errp); in multifd_qpl_recv()
743 return multifd_qpl_decompress_pages(p, errp); in multifd_qpl_recv()
745 return multifd_qpl_decompress_pages_slow_path(p, errp); in multifd_qpl_recv()