From patchwork Thu Nov 30 02:56:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chas Williams <3chas3@gmail.com> X-Patchwork-Id: 31764 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22C682C55; Thu, 30 Nov 2017 03:56:54 +0100 (CET) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by dpdk.org (Postfix) with ESMTP id D5B8A2C3F for ; Thu, 30 Nov 2017 03:56:52 +0100 (CET) Received: by mail-qt0-f196.google.com with SMTP id u10so7108246qtg.2 for ; Wed, 29 Nov 2017 18:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WXcG0yJFYCE/nol8TGxgO5ZIhtd2B6AcT+1NSV7lapw=; b=o3a8O+EqdxO6G4AkaK8lfDjseFgzCtwv0+xmVKW36OfDrHtmQ2L7tqj6YF77dEiabh UlaIrG/QUxpy3xwtO9QreTr3qI+WAMSRXsAPXm5mcI4mKeiLuyLo3D8P/WmHRwHUGOJJ bDv24NMvTsuOC1/jurFEu+JiNaBAkYLOxc6+sehF/vipML+zoai4qkyaVenFutTZpPO2 IqcD9xM/HFBJE8ug7Z1RUQyfcGR35AI/4e958ez5z8gLQ35nq9LpLSOgqBVb2sy/U+fj f1XcFWTu4oDdmpAx6+dFqFZIXLTxJmO4NKiDIU9sJTlmDrA4jTK3cE/9r6aVn1JxaNkX qXkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WXcG0yJFYCE/nol8TGxgO5ZIhtd2B6AcT+1NSV7lapw=; b=WxvZJEGwamSdgaPbiaOQa4jqevUa3ukkaB7FOUqYYqazfHa7Wyzxp402tO4JRd7K3F O+XGhjugnbtFfvocWz2sMtzE0FJcS8o7lfSkI9QNsxiU99qw2E9dJBfymzsJ8cXaezDp J3x+15Cv/+HTG0q7h0kEPEyUpIo93cDtSgrWdcMiRHNJFrQDJTtpBIPqOM5mw27HSh/e NXLOXE+B0I6+LAU0t1fsmou/rfdt0987SfBoVjZp3xauy/VRzsOtNLj86xw67ZCIphYj cf3AlwApVa5y2FTSZ+TCmul4WPa4WJyHi6kHAq9JPy57Z89tQbBgnhJkl0IdEG2XnIWH 1IFg== X-Gm-Message-State: AKGB3mLZG+efhAKU9VKJjPec+my/SquCvzEdxBD/5nERrhkGLiH327m/ W3ib2+WBx4RQdDRIpxP4X3OKKQ== X-Google-Smtp-Source: AGs4zMYyog78fUdXs7CfkMl37vGIFaNGqBenNpUmFkzgpSAJTyRibF6OT4iTCRX/Ht0ZIQG6uMMlBA== X-Received: by 10.200.1.20 with SMTP id e20mr1578042qtg.2.1512010612077; Wed, 29 Nov 2017 18:56:52 -0800 (PST) Received: from monolith.home (pool-173-79-224-159.washdc.fios.verizon.net. [173.79.224.159]) by smtp.gmail.com with ESMTPSA id v17sm2236582qtj.35.2017.11.29.18.56.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 18:56:51 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: skhare@vmware.com, Chas Williams Date: Wed, 29 Nov 2017 21:56:47 -0500 Message-Id: <20171130025647.4199-1-3chas3@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] eal: add option to force IOVA as PA mode 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" From: Chas Williams The IOMMU in some machines report that they can only support limited widths. IOVA virtual addresses may exceed this width making the use of IOVA virtual addresses difficult. The option CONFIG_RTE_LIBRTE_USE_PHYS_IOVA can used to force IOVA physical address usage. Signed-off-by: Chas Williams --- config/common_base | 5 +++++ lib/librte_eal/bsdapp/eal/eal.c | 4 ++++ lib/librte_eal/linuxapp/eal/eal.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/config/common_base b/config/common_base index e74febe..06b3ded 100644 --- a/config/common_base +++ b/config/common_base @@ -820,3 +820,8 @@ CONFIG_RTE_APP_CRYPTO_PERF=y # Compile the eventdev application # CONFIG_RTE_APP_EVENTDEV=y + +# +# Force IOVA physical addresses in VFIO +# +CONFIG_RTE_LIBRTE_USE_PHYS_IOVA=n diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 369a682..b396285 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -569,8 +569,12 @@ rte_eal_init(int argc, char **argv) return -1; } +#ifdef RTE_LIBRTE_USE_PHYS_IOVA + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; +#else /* autodetect the iova mapping mode (default is iova_pa) */ rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); +#endif if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY && diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 229eec9..13b02fd 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -804,8 +804,12 @@ rte_eal_init(int argc, char **argv) return -1; } +#ifdef RTE_LIBRTE_USE_PHYS_IOVA + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; +#else /* autodetect the iova mapping mode (default is iova_pa) */ rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); +#endif /* Workaround for KNI which requires physical address to work */ if (rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA &&