From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB82FA0471 for ; Tue, 16 Jul 2019 16:26:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C27F37A2; Tue, 16 Jul 2019 16:26:56 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9558314E8 for ; Tue, 16 Jul 2019 16:26:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 07:26:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,498,1557212400"; d="scan'208";a="161437896" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.82]) ([10.237.220.82]) by orsmga008.jf.intel.com with ESMTP; 16 Jul 2019 07:26:47 -0700 To: jerinj@marvell.com, dev@dpdk.org, John McNamara , Marko Kovacevic , Igor Russkikh , Pavel Belous , Ajit Khaparde , Somnath Kotur , Wenzhuo Lu , John Daley , Hyong Youb Kim , Qi Zhang , Xiao Wang , Beilei Xing , Jingjing Wu , Qiming Yang , Konstantin Ananyev , Matan Azrad , Shahaf Shuler , Yongseok Koh , Viacheslav Ovsiienko , Alejandro Lucero , Nithin Dabilpuram , Kiran Kumar K , Rasesh Mody , Shahed Shaikh , Bruce Richardson Cc: thomas@monjalon.net, david.marchand@redhat.com References: <1562795329-16652-1-git-send-email-david.marchand@redhat.com> <20190716134609.40930-1-jerinj@marvell.com> <20190716134609.40930-3-jerinj@marvell.com> From: "Burakov, Anatoly" Message-ID: Date: Tue, 16 Jul 2019 15:26:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190716134609.40930-3-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 2/4] eal: fix IOVA mode selection as VA for pci drivers 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 16-Jul-19 2:46 PM, jerinj@marvell.com wrote: > From: David Marchand > > The incriminated commit broke the use of RTE_PCI_DRV_IOVA_AS_VA which > was intended to mean "driver only supports VA" but had been understood > as "driver supports both PA and VA" by most net drivers and used to let > dpdk processes to run as non root (which do not have access to physical > addresses on recent kernels). > > The check on physical addresses actually closed the gap for those > drivers. We don't need to mark them with RTE_PCI_DRV_IOVA_AS_VA and this > flag can retain its intended meaning. > Document explicitly its meaning. > > We can check that a driver requirement wrt to IOVA mode is fulfilled > before trying to probe a device. > > Finally, document the heuristic used to select the IOVA mode and hope > that we won't break it again. > > Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode") > > Signed-off-by: David Marchand > Reviewed-by: Jerin Jacob > Tested-by: Jerin Jacob > --- > @@ -629,12 +643,16 @@ rte_pci_get_iommu_class(void) > devices_want_va = true; > } > } > - if (devices_want_pa) { > - iova_mode = RTE_IOVA_PA; > - if (devices_want_va) > - RTE_LOG(WARNING, EAL, "Some devices want 'VA' but forcing 'PA' because other devices want it\n"); > - } else if (devices_want_va) { > + if (devices_want_va && !devices_want_pa) { > iova_mode = RTE_IOVA_VA; > + } else if (devices_want_pa && !devices_want_va) { > + iova_mode = RTE_IOVA_PA; > + } else { > + iova_mode = RTE_IOVA_DC; > + if (devices_want_va) { > + RTE_LOG(WARNING, EAL, "Some devices want 'VA' but forcing 'DC' because other devices want 'PA'.\n"); > + RTE_LOG(WARNING, EAL, "Depending on the final decision by the EAL, part of your devices won't initialise.\n"); Tiny nitpick - i generally don't like personal appeals in log messages, so perhaps drop the "your"? I.e. "Depending on final decision by EAL, not all devices may be able to initialize."? Same applies to the other instance of this error message. Otherwise, LGTM Acked-by: Anatoly Burakov -- Thanks, Anatoly