From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 0D6D64C74; Tue, 11 Sep 2018 11:25:06 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 676EC40200B8; Tue, 11 Sep 2018 09:25:05 +0000 (UTC) Received: from [10.36.112.31] (ovpn-112-31.ams2.redhat.com [10.36.112.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABCF62156889; Tue, 11 Sep 2018 09:25:03 +0000 (UTC) To: Ilya Maximets , dev@dpdk.org Cc: Tiwei Bie , Zhihong Wang , stable@dpdk.org References: <20180817113354.16140-1-i.maximets@samsung.com> <20180903101059eucas1p2030d1e9077a03bc5d0613ba0311e1eab~Q3BXc1AtS3196731967eucas1p2z@eucas1p2.samsung.com> From: Maxime Coquelin Message-ID: Date: Tue, 11 Sep 2018 11:25:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180903101059eucas1p2030d1e9077a03bc5d0613ba0311e1eab~Q3BXc1AtS3196731967eucas1p2z@eucas1p2.samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 11 Sep 2018 09:25:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 11 Sep 2018 09:25:05 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v2] vhost-user: drop connection on message handling failures X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2018 09:25:06 -0000 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: stable@dpdk.org > > Signed-off-by: Ilya Maximets > --- > > 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(-) Applied to dpdk-next-virtio/master. Thanks! Maxime