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 52E6942415; Thu, 19 Jan 2023 11:16:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F369A410DD; Thu, 19 Jan 2023 11:16:41 +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 24BD64068E for ; Thu, 19 Jan 2023 11:16:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674123399; 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=qg+0CgAfuqzXmSTBJ7PzG2MVEuntnH1DHkpSac9Qt+o=; b=f3SxOF7LDfu1RcDOIcaBNdQvcBdbffcRLcK72hPQoRQtz2ifYWpt+DckeVnjG/1nnklt7u Cm6dbNEaJCtjV7asZfPL1yHG3XI1Gq2Uy148Xvpi1AjHXjYMGyu9ozYeBej7+1GS60hqv8 knr2HiK3Msyd0Up4wKolTLQPEokPbC8= 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-142-eUh4THIBPgS82zPRHWzjgw-1; Thu, 19 Jan 2023 05:16:35 -0500 X-MC-Unique: eUh4THIBPgS82zPRHWzjgw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4ED343C1014F; Thu, 19 Jan 2023 10:16:35 +0000 (UTC) Received: from [10.39.208.26] (unknown [10.39.208.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5436D1121318; Thu, 19 Jan 2023 10:16:33 +0000 (UTC) Message-ID: <0fc3de1f-a81a-2896-abdf-1c02ccb23826@redhat.com> Date: Thu, 19 Jan 2023 11:16:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v4] examples/vdpa: support running in nested virtualization environment To: Hao Chen , dev@dpdk.org Cc: zy@yusur.tech, Chenbo Xia References: <20221025061939.3229676-1-chenh@yusur.tech> <20221114030426.1363561-1-chenh@yusur.tech> From: Maxime Coquelin In-Reply-To: <20221114030426.1363561-1-chenh@yusur.tech> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 11/14/22 04:04, Hao Chen wrote: > When we run dpdk vdpa in the nested virtual machine vm-L1 and ping > test in vm-L2, the ping is not good. The reason for troubleshooting is > that the virtio net in vm-L2 sends control information to the vring, > and the qemu back-end device in vm-L1 cannot obtain correct data > from the vring. This problem is related to the opening of the vIOMMU. > > This patch add flag RTE_VHOST_USER_IOMMU_SUPPORT to use vhost vIOMMU > , VIRTIO_F_IOMMU_PLATFORM feature will be negotiated successfully if > virtio iommu is used in a nested virtualization environment. > > The configuration is as follows: > The host starts iommu, and the kernel parameter is added with > 'intel_iommu=on iommu=pt'. > VM-L1's xml add viommu and virtio device adds iommu='on' ats='on'. > VM-L2's xml enables viommu, and adds parameters > 'intel_iommu=on iommu=pt' to kernel. > > Then the ping test in vm-L2 is OK. > > Signed-off-by: Hao Chen > --- > v4: > *Simplify the patch. Set the flags RTE_VHOST_USER_IOMMU_SUPPORT default. > > v3: > *Modify mail title. > > v2: > *fprintf all string including the eal one. > *remove exit(1). > > examples/vdpa/main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c > index 4c7e81d7b6..4d3203f3a7 100644 > --- a/examples/vdpa/main.c > +++ b/examples/vdpa/main.c > @@ -214,6 +214,8 @@ start_vdpa(struct vdpa_port *vport) > if (client_mode) > vport->flags |= RTE_VHOST_USER_CLIENT; > > + vport->flags |= RTE_VHOST_USER_IOMMU_SUPPORT; > + > if (access(socket_path, F_OK) != -1 && !client_mode) { > RTE_LOG(ERR, VDPA, > "%s exists, please remove it or specify another file and try again.\n", Reviewed-by: Maxime Coquelin Thanks, Maxime