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 B99BDA0527; Mon, 9 Nov 2020 19:39:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80098697C; Mon, 9 Nov 2020 19:39:52 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 4ADEF6883 for ; Mon, 9 Nov 2020 19:39:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604947189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OnP3IPa5Hklh9Li+HgJ9VpeIlzlezzFm4QDkwtypttg=; b=VDlFb8HsncqZQxCLuSzP3zo/0eVTQ0q70U26LLSVX6SWFGaUaRVSRudCxLqVI8bV8t83T+ m2Ay81tzuUekZktki8ogVGsI1KlUBt5mXhGID/2N3o6phH/vIsHPt5qEoE7DasYzeWUO3+ muKoFaNZPYzV2s02RPnLB55a/rSzOxs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-qSnnlToVNcOD659TEgrFLQ-1; Mon, 09 Nov 2020 13:39:48 -0500 X-MC-Unique: qSnnlToVNcOD659TEgrFLQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94ABC186DD23; Mon, 9 Nov 2020 18:39:46 +0000 (UTC) Received: from [10.36.110.32] (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C94E55D9CC; Mon, 9 Nov 2020 18:39:43 +0000 (UTC) To: Ferruh Yigit , dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com Cc: stable@dpdk.org, Yu Jiang References: <20201106144744.176463-1-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <8ee41602-9275-c223-33bb-9b773d3dec77@redhat.com> Date: Mon, 9 Nov 2020 19:39:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] vhost: fix virtqueue initialization 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/9/20 7:37 PM, Ferruh Yigit wrote: > On 11/6/2020 2:47 PM, Maxime Coquelin wrote: >> 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 >> > > Since the issue is introduced in this release, there is nothing to > backport and stable tag is not required, removing it in next-net. I cc'ed stable because it is fixing a fix that was stable candidate. >> 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; >> >