vhost: prepare sync for descriptor to mbuf refactoring
authorXuan Ding <xuan.ding@intel.com>
Mon, 16 May 2022 11:10:37 +0000 (11:10 +0000)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 1 Jun 2022 09:50:09 +0000 (11:50 +0200)
commit6d823bb302c76fd66817b65d22592c4ec032a8c6
treeeb056abc4576ca2979adffb1f4dbc92eb3b9acae
parent0a8363efdbeb92446d0fc1f11788a76f8b969daf
vhost: prepare sync for descriptor to mbuf refactoring

This patch extracts the descriptors to buffers filling from
copy_desc_to_mbuf() into a dedicated function. Besides, enqueue
and dequeue path are refactored to use the same function
sync_fill_seg() for preparing batch elements, which simplifies
the code without performance degradation.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/vhost/virtio_net.c