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 600DF41B9E; Wed, 1 Feb 2023 13:24:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A2384282D; Wed, 1 Feb 2023 13:24:05 +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 F24EE406A2 for ; Wed, 1 Feb 2023 13:24:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675254243; 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=gq9JQPK1QkvvggTN7C8Me2OZci8g2fQlXZ5Fo8/Q9qw=; b=B8OUunxq0eLyBrDW/TJgm5puoypEEmFV/hiE4dvjJvqNRuUPCnN6EhFNRo8OF0llZujxl3 T6wQSDS9TFHQImhXi7t1hfTW1V9/JhPFVldQ9c3vT5S/fEPansu7xz9IrYw6IGKIqedeHY rSZEuNH+MQti5lWFV0VBHhUCDLOfYGU= 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-639-LMReQXW_OyGtLPlIGltMKQ-1; Wed, 01 Feb 2023 07:24:02 -0500 X-MC-Unique: LMReQXW_OyGtLPlIGltMKQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD29838060E1; Wed, 1 Feb 2023 12:24:01 +0000 (UTC) Received: from [10.39.208.22] (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE7B8140EBF4; Wed, 1 Feb 2023 12:24:00 +0000 (UTC) Message-ID: <053e1a53-8a99-e251-8552-d6f5dcfda030@redhat.com> Date: Wed, 1 Feb 2023 13:23:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: Hao Chen , dev@dpdk.org Cc: zy@yusur.tech, huangml@yusur.tech, Chenbo Xia References: <20230128030603.1168073-1-chenh@yusur.tech> <20230128030603.1168073-2-chenh@yusur.tech> From: Maxime Coquelin Subject: Re: [PATCH] vhost: fix vdpa driver multi-queue initialization failure In-Reply-To: <20230128030603.1168073-2-chenh@yusur.tech> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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 1/28/23 04:06, Hao Chen wrote: > When 'virtio_is_Ready' returns 1, 'vdpa_dev->ops->dev_conf' will be > called, and the vdpa driver called 'rte_vhost_get_vhost_vring' to > get the vring addr info from 'vhost_devices->virtqueue[]'. > virtio_is_ready's nr_vring is VIRTIO_BUILTIN_NUM_VQS_TO_BE_READY(2), > multi-queue's nr_vring is greater than 2. > Only 'vhost_devices->virtqueue[0]' and 'vhost_devices->virtqueue[1]' > are obtained in the for loop. Other queues of multiple queues cannot > obtain the corresponding 'vhost_devices->virtqueue[i]', which will > cause 'vdpa_dev->ops->dev_conf' to obtain QEMU vring addr information > from 'vhost_devices->virtqueue[i]' failed. > Here, nr_ving is modified to dev->nr_vring, so that multiple queues > can obtain the corresponding 'vhost_devices->virtqueue[i]'. > > Signed-off-by: Hao Chen > --- > lib/vhost/vhost_user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c > index 9902ae9944..9249eafc06 100644 > --- a/lib/vhost/vhost_user.c > +++ b/lib/vhost/vhost_user.c > @@ -1473,7 +1473,7 @@ virtio_is_ready(struct virtio_net *dev) > if (dev->nr_vring < nr_vring) > return 0; > > - for (i = 0; i < nr_vring; i++) { > + for (i = 0; i < dev->nr_vring; i++) { > vq = dev->virtqueue[i]; > > if (!vq_is_ready(dev, vq)) Nack. We can start processing the vrings as soon as the first queue pair is initialized. I think you may want to rely on vdpa_dev->ops->set_vring_state to initialize other vrings. What is the vDPA driver/device affected by this issue? Regards, Maxime