From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30A8B41C61; Fri, 10 Feb 2023 16:28:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13E6C410EA; Fri, 10 Feb 2023 16:28:22 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1B824410D3 for ; Fri, 10 Feb 2023 16:28:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676042899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DB5ldjEOKK+X+heJRCyIbeuBxxkCgvXpI7Ot+SR6iRI=; b=L0OxGoUTu0J/Afk4u9F9HvVZLSJkNeNvwF/32byQxb7C8SBW6nCm3rYJVX3lB2MYiFgcVt AVcrS3PJ+/CR3SxiKJi29UV6T5v8g8tfdzeMSuSDZ7D1ZYWOWXYGM57dbDwc7Ox/PwAdjw 2gPJO1MLbmxUp+5OcUkuZL+gcKPpxVI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-5ZfQly9zOYKWxSYxFgDi0g-1; Fri, 10 Feb 2023 10:28:16 -0500 X-MC-Unique: 5ZfQly9zOYKWxSYxFgDi0g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EDCAC1C07820; Fri, 10 Feb 2023 15:28:15 +0000 (UTC) Received: from [10.39.208.22] (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C5F340398A0; Fri, 10 Feb 2023 15:28:14 +0000 (UTC) Message-ID: <97b3e577-517c-fa13-1f24-0a273c53b397@redhat.com> Date: Fri, 10 Feb 2023 16:28:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] net/virtio-user: fix number of vrings calculation To: dev@dpdk.org, chenbo.xia@intel.com, david.marchand@redhat.com, eperezma@redhat.com References: <20230210151044.229324-1-maxime.coquelin@redhat.com> From: Maxime Coquelin In-Reply-To: <20230210151044.229324-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/10/23 16:10, Maxime Coquelin wrote: > When moving to dynamic allocation of vrings metadata, the > number of vrings to allocate was incremented if the backend > supports control queue. > > The problem is that the control queue metadata have to be > allocated even if the backend does not use it directly, > since the control queue is managed by the Virtio-user layer > as soon as multiqueue is negotiated.. > > This patch fixes this by incrementing the number of vrings > as soon as the device features have VIRTIO_NET_F_MQ. > > Fixes: d57c3a601e44 ("net/virtio-user: remove max queues limitation") > > Signed-off-by: Maxime Coquelin > --- > > I plan to squash it with faulty commit in the Virtio branch > since it has not been pulled yet by Thomas once acked and > if no objection. > > drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c > index cf58b63029..ccb4d7326b 100644 > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c > @@ -575,7 +575,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev) > bool packed_ring = !!(dev->device_features & (1ull << VIRTIO_F_RING_PACKED)); > > nr_vrings = dev->max_queue_pairs * 2; > - if (dev->hw_cvq) > + if (dev->device_features & (1ull << VIRTIO_NET_F_MQ)) > nr_vrings++; > > dev->callfds = rte_zmalloc("virtio_user_dev", nr_vrings * sizeof(*dev->callfds), 0); Squashed with d57c3a601e44 and pushed to next-virtio. Thanks, Maxime