]> git.proxmox.com Git - mirror_qemu.git/commit
vdpa: Use iovec for vhost_vdpa_net_load_cmd()
authorHawkins Jiawei <yin31149@gmail.com>
Fri, 7 Jul 2023 15:27:28 +0000 (23:27 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 10 Jul 2023 22:59:32 +0000 (18:59 -0400)
commit2848c6aa7536fb48a57f38dabed1dce97fb45c6f
tree9bc9cddffbea53dad24670602684a84f08de75c5
parent7c228c5f3301113ffd7cfee7f982e7ae04c8ffda
vdpa: Use iovec for vhost_vdpa_net_load_cmd()

According to VirtIO standard, "The driver MUST follow
the VIRTIO_NET_CTRL_MAC_TABLE_SET command by a le32 number,
followed by that number of non-multicast MAC addresses,
followed by another le32 number, followed by that number
of multicast addresses."

Considering that these data is not stored in contiguous memory,
this patch refactors vhost_vdpa_net_load_cmd() to accept
scattered data, eliminating the need for an addtional data copy or
packing the data into s->cvq_cmd_out_buffer outside of
vhost_vdpa_net_load_cmd().

Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Message-Id: <3482cc50eebd13db4140b8b5dec9d0cc25b20b1b.1688743107.git.yin31149@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
net/vhost-vdpa.c