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 52DBAA0527; Mon, 9 Nov 2020 17:32:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E899F6004; Mon, 9 Nov 2020 17:32:00 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 54B455F13 for ; Mon, 9 Nov 2020 17:31:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604939517; 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=BH5qzggCZK1DXGOFU0x35I6hz57LhwFvdh8WO6psxkU=; b=b4rb76ivkspB+ksQTZR+SOOJklhhNFEoCs2z0tJb59CaULC82YKbw/jM5V7Ln6V0UvVYEQ 2dV6Q7LEM7pjHZpzQkRHYQ9zMvRFQAbkSKenCqWqRhW+3cFET+6vQFRLYuCD0PBeulQg0r KTr2r8lnxvS4xYm63lpi/LD0JShG3/4= 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-336-ALwggAnIOnuMfIafxfz5eA-1; Mon, 09 Nov 2020 11:31:56 -0500 X-MC-Unique: ALwggAnIOnuMfIafxfz5eA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6CB50425CE; Mon, 9 Nov 2020 16:31:54 +0000 (UTC) Received: from [10.36.110.32] (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5AF760BF1; Mon, 9 Nov 2020 16:31:52 +0000 (UTC) To: 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: <0e5f7a0c-ab3e-5868-4995-9bff54fa9f92@redhat.com> Date: Mon, 9 Nov 2020 17:31:50 +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: <20201106144744.176463-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: 7bit 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/6/20 3: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 > > 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; > Applied to dpdk-next-virtio/main. Thanks, Maxime