]> git.droids-corp.org - dpdk.git/commit
vhost: improve IO vector logic
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 26 Oct 2021 16:28:57 +0000 (18:28 +0200)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 29 Oct 2021 10:32:30 +0000 (12:32 +0200)
commitd5d25cfd855d57f450cbf17113f88fba675ca6e9
treebbbd230a6696fea5fe03d35338b8e90d1d96c4fb
parent0af9f992211cc0f59d6c3bb670510a746b4f3e16
vhost: improve IO vector logic

IO vectors and their iterators arrays were part of the
async metadata but not their indexes.

In order to makes this more consistent, the patch adds the
indexes to the async metadata. Doing that, we can avoid
triggering DMA transfer within the loop as it IO vector
index overflow is now prevented in the async_mbuf_to_desc()
function.

Note that previous detection mechanism was broken
since the overflow already happened when detected, so OOB
memory access would already have happened.

With this changes done, virtio_dev_rx_async_submit_split()
and virtio_dev_rx_async_submit_packed() can be further
simplified.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
lib/vhost/vhost.h
lib/vhost/virtio_net.c