On 09/03/2018 12:12 PM, Ilya Maximets wrote:
There are a lot of cases where vhost-user massage handling could fail and end up in a fully not recoverable state. For example, allocation failures of shadow used ring and batched copy array are not recoverable and leads to the segmentation faults like this on the receiving/transmission path: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f913fecf0 (LWP 43625)] in copy_desc_to_mbuf () at /lib/librte_vhost/virtio_net.c:760 760 batch_copy[vq->batch_copy_nb_elems].dst = This could be easily reproduced in case of low memory or big number of vhost-user ports. Fix that by propagating error to the upper layer which will end up with disconnection in case we can not report to the message sender when the error happens. Fixes: f689586bc060 ("vhost: shadow used ring update") Cc:sta...@dpdk.org Signed-off-by: Ilya Maximets<i.maxim...@samsung.com> --- v2: * Patch changed to cover most of possible failures at once. [Tiwei Bie] lib/librte_vhost/vhost_user.c | 51 +++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-)
Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com> Thanks! Maxime