From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id CCAAD1559 for ; Wed, 5 Sep 2018 05:40:43 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id w853ecss012006 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 4 Sep 2018 20:40:38 -0700 (PDT) Received: from [128.224.56.213] (128.224.56.213) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 4 Sep 2018 20:40:36 -0700 To: santosh , , =?UTF-8?Q?Ga=c3=abtan_Rivet?= , "Burakov, Anatoly" CC: , , , References: <1535558289-10336-1-git-send-email-eric.zhang@windriver.com> <20180830094323.37xkgud4fz3mflbg@bidouze.vm.6wind.com> <0f19de06-fccd-eff2-b33e-71d49a005dbb@nxp.com> From: Eric Zhang Message-ID: <9ae6e3dd-5f33-d874-9a58-730435b58de3@windriver.com> Date: Tue, 4 Sep 2018 23:40:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [128.224.56.213] Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA mode to physical X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2018 03:40:44 -0000 On 08/30/2018 08:59 AM, santosh wrote: > On Thursday 30 August 2018 05:43 PM, Hemant wrote: >> External Email >> >> Hi, >> >> On 8/30/2018 3:13 PM, Gaƫtan Rivet wrote: >>> Hi, >>> >>> On Thu, Aug 30, 2018 at 10:09:04AM +0100, Burakov, Anatoly wrote: >>>> On 29-Aug-18 4:58 PM, eric zhang wrote: >>>>> This patch adds a configuration option to force the IOVA mode to >>>>> physical address (PA). There exists virtual devices that are not >>>>> directly attached to the PCI bus, and therefore the auto detection >>>>> of the IOVA mode based on probing the PCI bus and IOMMU configuration >>>>> may not report the required addressing mode. Having the configuration >>>>> option permits the mode to be explicitly configured in this scenario. >>>>> >>>>> Signed-off-by: eric zhang >>>>> --- >>>> Defining this at compile-time seems like an overkill. Wouldn't it be better >>>> to just add an EAL command-line option to force IOVA mode to a particular >>>> value? >> That is a good suggestion. >>>> -- >>>> Thanks, >>>> Anatoly >>> What is the bus of these devices and why not implement get_iommu_class >>> in it? >> There are cases, where you are using dpdk libraries with external >> libraries and you need to change the default behavior DPDK lib to use >> physical address instead of virtual address. >> Providing an option to user will help. >> >> > More appropriate solution could be: > * Either fix it at bus layer .. i.e.. get_iommu_class().. > * Or introduce something like [1] --iova-mode= param. > > Former is better solution than latter if autodetection is a key criteria. > Thanks. > > [1] http://patchwork.dpdk.org/patch/25192/ > It's not generic which couldn't be fixed at bus layer. So what's the preference of EAL option or compile time solution? Adding --iova-mode as patch [1] will overrivde auto-detection rte_bus_get_iommu_class() make it no use; compile time solution will align with upstream and keep new atuodetection solution in #ifndef. Thanks Eric