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 CF57A43D66; Wed, 27 Mar 2024 10:41:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C1A6427D7; Wed, 27 Mar 2024 10:40:54 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0073041141 for ; Wed, 27 Mar 2024 10:40:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711532451; 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=okZ70ZLBNcS+dj1RGHXS/tI+BD0sFihnN5Z9BdLiCYQ=; b=Y3rdYioLlZZ4KKNtFNP1faaFL/L6uzEPfIq8TFf6JCaXMtJ90NgsIXI9Hu4xQOn7+7PpBf KceQfcCwjouC2cblWc0W2a6zFhoIsa2wvFwLbsW4yZK+6Dc3tGsIvZsdETODG0kFU6J+Br Suzw+dr2/lNH9T+NB1yw7H76b3u9H4I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-540-Tt8ds663PEiOycw5rSe7-g-1; Wed, 27 Mar 2024 05:40:48 -0400 X-MC-Unique: Tt8ds663PEiOycw5rSe7-g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E96AF811E81; Wed, 27 Mar 2024 09:40:47 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52AD4107A8; Wed, 27 Mar 2024 09:40:46 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, david.marchand@redhat.com, chenbox@nvidia.com Cc: Maxime Coquelin , stable@dpdk.org Subject: [PATCH 4/4] net/virtio: fix shadow control queue allocation Date: Wed, 27 Mar 2024 10:40:32 +0100 Message-ID: <20240327094032.2400951-5-maxime.coquelin@redhat.com> In-Reply-To: <20240327094032.2400951-1-maxime.coquelin@redhat.com> References: <20240327094032.2400951-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 It is possible to have the control queue without the vDPA device advertising VIRTIO_NET_F_MQ. Let's just rely on hw_cvq flag as in other places. Fixes: 6fdf32d1e318 ("net/virtio-user: remove max queues limitation") Cc: stable@dpdk.org Signed-off-by: Maxime Coquelin --- 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 912e87fecf..5240b44481 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -615,7 +615,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->device_features & (1ull << VIRTIO_NET_F_MQ)) + if (dev->hw_cvq) nr_vrings++; dev->callfds = rte_zmalloc("virtio_user_dev", nr_vrings * sizeof(*dev->callfds), 0); -- 2.44.0