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 7FD2B5A for ; Wed, 29 Aug 2018 17:58:18 +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 w7TFwH42011565 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 29 Aug 2018 08:58:17 -0700 (PDT) Received: from yow-ezhang-lx.wrs.com (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; Wed, 29 Aug 2018 08:58:16 -0700 From: eric zhang To: , CC: , , Date: Wed, 29 Aug 2018 11:58:09 -0400 Message-ID: <1535558289-10336-1-git-send-email-eric.zhang@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [128.224.56.213] Subject: [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, 29 Aug 2018 15:58:18 -0000 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 --- lib/librte_eal/linuxapp/eal/eal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index e0b5ae1..bee4aed 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -805,6 +805,7 @@ static void rte_eal_init_alert(const char *msg) return -1; } +#ifndef RTE_EAL_IOVA_MODE_PA /* autodetect the iova mapping mode (default is iova_pa) */ rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); @@ -816,6 +817,12 @@ static void rte_eal_init_alert(const char *msg) "Some devices want IOVA as VA but PA will be used because.. " "KNI module inserted\n"); } +#else + /* Force iova mapping mode to be physical address */ + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; + RTE_LOG(WARNING, EAL, + "Force the iova mapping mode to be physical address\n"); +#endif if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY && -- 1.8.3.1