From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 556E9A0527 for ; Mon, 9 Nov 2020 19:38:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3445272ED; Mon, 9 Nov 2020 19:38:41 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2CBA06883; Mon, 9 Nov 2020 19:38:36 +0100 (CET) IronPort-SDR: WxywYQhz0Z6blxcS+UBQpnRZomgcyRa4zuTroPynyRjHfBfXg2GV6XHsvwy1oyYCUG6KlYQvhe OPZ0C8gnRQJw== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="156857063" X-IronPort-AV: E=Sophos;i="5.77,464,1596524400"; d="scan'208";a="156857063" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 10:38:34 -0800 IronPort-SDR: SfRAZk22Kxs/tbl9dsFAxW5Sx3rwdx/EZ95BQLTe1LMzSgjgH2aEmxQEDsFwsJujYFhpJ4ey8C Ekur/2If5Cdg== X-IronPort-AV: E=Sophos;i="5.77,464,1596524400"; d="scan'208";a="530867272" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.193.177]) ([10.213.193.177]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 10:38:31 -0800 To: "Jiang, YuX" , Maxime Coquelin , "dev@dpdk.org" , "Xia, Chenbo" , "amorenoz@redhat.com" Cc: "stable@dpdk.org" , "Wang, Yinan" References: <20201106144744.176463-1-maxime.coquelin@redhat.com> <3d29ed679e83421c9c3d637664f84184@intel.com> From: Ferruh Yigit Message-ID: Date: Mon, 9 Nov 2020 18:38:29 +0000 MIME-Version: 1.0 In-Reply-To: <3d29ed679e83421c9c3d637664f84184@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] vhost: fix virtqueue initialization X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 11/9/2020 5:09 AM, Jiang, YuX wrote: > Tested-by: JiangYuX > Please don't top post. Also tag should be: "Tested-by: Yu Jiang " > >> -----Original Message----- >> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com] >> Sent: Friday, November 6, 2020 10:48 PM >> To: dev@dpdk.org; Xia, Chenbo ; >> amorenoz@redhat.com >> Cc: stable@dpdk.org; Maxime Coquelin ; >> Jiang, YuX >> Subject: [PATCH] vhost: fix virtqueue initialization >> >> This patches fixes virtqueue initialization issue causing segfault or file >> descriptor being closed unexpectedly. >> >> The wrong index was passed to init_vring_queue() by >> alloc_vring_queue() when a hole in the virtqueue array was met. >> >> Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation") >> Cc: stable@dpdk.org >> >> Reported-by: Yu Jiang >> Signed-off-by: Maxime Coquelin >> --- >> lib/librte_vhost/vhost.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index >> 8a151a9c1d..b83cf639eb 100644 >> --- a/lib/librte_vhost/vhost.c >> +++ b/lib/librte_vhost/vhost.c >> @@ -605,7 +605,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t >> vring_idx) >> } >> >> dev->virtqueue[i] = vq; >> - init_vring_queue(dev, vring_idx); >> + init_vring_queue(dev, i); >> rte_spinlock_init(&vq->access_lock); >> vq->avail_wrap_counter = 1; >> vq->used_wrap_counter = 1; >> -- >> 2.26.2 >