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 EC92E41BBD; Fri, 3 Feb 2023 15:48:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B1534067B; Fri, 3 Feb 2023 15:48:07 +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 520044021E for ; Fri, 3 Feb 2023 15:48:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675435684; 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=o1xyZ29iIB8hSLx9Ml+5V53RrYtUoPpjjIsiVuf2+B8=; b=hfp81BTDsvCXQT0lhDrolK0ekIBZTEUXdGi+bwaz3sI7mT3nGrByVE58tPcjX6IftsWdZH CNJrD133krcLVe7WTNXtsZuQH93piwZqUKUY2Apx1Y6AB/JOOPi2pnxvrhigQ28GzquxlZ cee7gij6NddRnfePWn4/SqKS0qeBvWg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-192-DDwnYRV5N12J0ahOpIkQwg-1; Fri, 03 Feb 2023 09:48:01 -0500 X-MC-Unique: DDwnYRV5N12J0ahOpIkQwg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9C3380D0E8; Fri, 3 Feb 2023 14:48:00 +0000 (UTC) Received: from [10.39.208.28] (unknown [10.39.208.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A61CF492B15; Fri, 3 Feb 2023 14:47:59 +0000 (UTC) Message-ID: <09f7abe2-5ea8-4fe0-934d-e37c084b9189@redhat.com> Date: Fri, 3 Feb 2023 15:47:57 +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.10 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", Applied to dpdk-next-virtio/main. Thanks, Maxime