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 23E40A0547; Wed, 29 Sep 2021 11:28:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94810410D7; Wed, 29 Sep 2021 11:28:06 +0200 (CEST) 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 3F7DA40E3C for ; Wed, 29 Sep 2021 11:28:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632907684; 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=Lr9V3sb/iAwZ17RB6+zavt47w6Wx8RxVD0p9cTp7+j8=; b=ddoLpwQdlQamMjxVCJF9CQ0s5gr+6ifI6rEzyzWva+yDuBlNVQZ9hXnAgobP+KUHrd/OTI DhD/hax+32/M7WRfHocFY8fjN+3dRDeeTnjmKgd5u1G31YjabSN8O7Z8YnQOuzxmuYnTgp CtqhFKL8t9SQyC4t/akghEx1C1JUL1k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-7BNYuSVPOlSP0o6EnsT3Qg-1; Wed, 29 Sep 2021 05:27:58 -0400 X-MC-Unique: 7BNYuSVPOlSP0o6EnsT3Qg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A60A8015C7; Wed, 29 Sep 2021 09:27:57 +0000 (UTC) Received: from [10.39.208.26] (unknown [10.39.208.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DA35109B6E0; Wed, 29 Sep 2021 09:27:42 +0000 (UTC) Message-ID: <8f07939a-1caf-eb1e-7da9-b624bde2800e@redhat.com> Date: Wed, 29 Sep 2021 11:27:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 To: Olivier Matz , dev@dpdk.org, Chenbo Xia Cc: David Marchand References: From: Maxime Coquelin In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com 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 Subject: Re: [dpdk-dev] cannot use virtio-user pmd in IOVA=PA mode anymore 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 Sender: "dev" Hi Olivier, On 9/24/21 10:21, Olivier Matz wrote: > Hello, > > I recently tested a use-case with our application using the main > branch of dpdk.org. > > - the application runs inside a standard x86 VM (no IOMMU) > - there are emulated physical NICs inside the VM > - we use virtio-user pmds connected to tap interfaces through the > vhost-net backend for exception path > > This use-case works with the the stable 20.11 branch, but not with the > current main dpdk.org branch. The virtio-user driver refuses to start in > IOVA=PA mode: > > vdev_probe_all_drivers(): virtio_user0 requires VA IOVA mode but current mode is PA, not initializing > EAL: Driver cannot attach the device (virtio_user0) > > This is likely due to these commits: > > 8d935fff5546 ("bus/vdev: add driver IOVA VA mode requirement") > 17043a2909bb ("net/virtio: force IOVA as VA mode for virtio-user") > > We didn't see this problem before because we are only testing dpdk.org > main branch on physical machines that have an IOMMU. > > I'm not sure to understand the reasons for which the ability to run a > virtio-user pmd in IOVA=PA mode was removed. > > The commitlog of 17043a2909bb says: > > At least Vhost-user backend of Virtio-user PMD requires > IOVA as VA mode. Until now, it was implemented as a hack > by forcing to use mbuf's buf_addr field instead of buf_iova. > > I don't get why vhost-user backend would require IOVA=VA. Note that we > also have a use-case where a virtio-user pmd is connected to our > pmd-vhost in another application, which was working with 20.11. > > If there is a constraint with vhost-user backend, what about vhost-net > backend? > > Would it make sense to re-allow this feature by somehow reverting > 17043a2909bb with some additional cleanup? I think so. > I am aware that a solution can be to configure qemu to enable a vIOMMU, > but it is not my preferred solution yet, as it would impact our users > that do not do this currently. The initial purpose of this change was to simplify the code, I did not thought about this adverse side-effect. While moving to VFIO with IOMMU enabled would be a wise decision :), I will work on reverting that patch to restore the old behavior as that was not something that was agreed when the patch was submitted. Thanks for reporting the issue, Maxime > Thanks! > Olivier >