vhost: make error handling consistent in Rx path
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Thu, 5 Oct 2017 08:36:10 +0000 (10:36 +0200)
committerYuanhan Liu <yliu@fridaylinux.org>
Tue, 10 Oct 2017 13:52:27 +0000 (15:52 +0200)
commit25bf7a0b093601013016c2787ff5b21bb5ac6fe8
tree731899f05126990cd7becd4c74c566d33384dbca
parent94018cf3d5c2cc7b5fccb58f7ae651afce73687c
vhost: make error handling consistent in Rx path

In the non-mergeable receive case, when copy_mbuf_to_desc()
call fails the packet is skipped, the corresponding used element
len field is set to vnet header size, and it continues with next
packet/desc. It could be a problem because it does not know why
it failed, and assume the desc buffer is large enough.

In mergeable receive case, when copy_mbuf_to_desc_mergeable()
fails, packets burst is simply stopped.

This patch makes the non-mergeable error path to behave as the
mergeable one, as it seems the safest way. Also, doing this way
will simplify pending IOTLB miss requests handling.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
lib/librte_vhost/virtio_net.c