Hi, Here's a new patch series that incorporates all the suggested changes from v2.
I have tried my best to deduplicate the implementation. Please let me know if I have missed something. I'll also test these changes out by following the suggestions given in response to v1. I'll have more confidence once I know these changes work. Thanks, Sahil v1: https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg03417.html v2: https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg06196.html Changes v2 -> v3: * vhost-shadow-virtqueue.c - Move parts common to "vhost_svq_add_split" and "vhost_svq_add_packed" to "vhost_svq_add". (vhost_svq_add_packed): - Refactor to minimize duplicate code between this and "vhost_svq_add_split" - Fix code style issues. (vhost_svq_add_split): - Merge with "vhost_svq_vring_write_descs()" - Refactor to minimize duplicate code between this and "vhost_svq_add_packed" (vhost_svq_add): - Refactor to minimize duplicate code between split and packed version of "vhost_svq_add" (vhost_svq_memory_packed): New function (vhost_svq_start): - Remove common variables out of if-else branch. (vhost_svq_stop): - Add support for packed vq. (vhost_svq_get_vring_addr): Revert changes (vhost_svq_get_vring_addr_packed): Likwise. * vhost-shadow-virtqueue.h - Revert changes made to "vhost_svq_get_vring_addr*" functions. * vhost-vdpa.c: Revert changes. Sahil Siddiq (3): vhost: Introduce packed vq and add buffer elements vhost: Data structure changes to support packed vqs vhost: Allocate memory for packed vring hw/virtio/vhost-shadow-virtqueue.c | 230 ++++++++++++++++++++--------- hw/virtio/vhost-shadow-virtqueue.h | 70 ++++++--- 2 files changed, 206 insertions(+), 94 deletions(-) -- 2.45.2