From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by dpdk.org (Postfix) with ESMTP id C6E5B2C55 for ; Thu, 30 Nov 2017 03:57:44 +0100 (CET) Received: by mail-qk0-f194.google.com with SMTP id t187so7181984qkh.3 for ; Wed, 29 Nov 2017 18:57:44 -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=oLMNd0aSwSm2TIOsa44/XUFR2on2jq62p08kEG7liypoZpJBzG9kS1Knr3JpjO/Pdo nxuMxbozChhx25BGvIcNNCryV2Xk3owf1zbtbVxPTbXl2Bg6dho7KyVS1TVZrY4xs8wY T2B4w7s2wUje6G9IvdmgOPqJ9i3rd48oLRFtDMeKm1QuJmW6besiHhbXL6tC+4+GSifU H5ICYZoKzh3VvUzlEfNdgH9CqOIwQDaQdzh9dNbLOKMrfA+MSmgZ8uzgtE6v3UIv7MeU 9bTT9QFwmtEpnXcEYq5KTbSwhTyTsFAQbWrctMSSw2UMbhBO0EF8UwzwSUXpDjLaYUpY j3ug== 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=qEQ/7aJL7whiJ1C1jQ9xk9M1TQK1TCkXLOstYf88oR8sYpduI+JZ0u+NUyJtsmJDMD 4jRg/dYJ0K7wwDw9ooC7Fo2Ox0BeHnvWOclqZk0gbbN1lG0LudG2dltZkS2BEp5lwY18 oDXzxwMqsEMwKKgwtIkJBPQAlTo3nZyjV7j8pIvcXXtdkWGoUmvlFmftLuferlbR4cpV 54XMzioyMDCw6UK1tWZA9+GpMTYoR+zCbEBZBjaZJ1VyrPLTfJApkp0dg/pkZ8aqiAT9 i64H3urN9jNBul0fVEnqBcLjyl1ZJad/PWXSStBpIzBYtpocfwphsD7INlPYqBDPso/c vHWQ== X-Gm-Message-State: AKGB3mKpORDv0NyrDjL0xunEHctkKo+JMrMMN4kOvl2yvpwo3pSSa1eD 5Ax117rJsS8wkZnVLwS96WQEtQ== X-Google-Smtp-Source: AGs4zMaVILJcr1gU09J6q9CFT7lueByKHjGvFyryQ35wFguJI3uPxAMzI708h8qn7URA0dpJ5lccvg== X-Received: by 10.55.221.209 with SMTP id u78mr784756qku.68.1512010664146; Wed, 29 Nov 2017 18:57:44 -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 h32sm2291444qtk.8.2017.11.29.18.57.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 18:57:43 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: anatoly.burakov@intel.com, thomas@monjalon.net, Chas Williams Date: Wed, 29 Nov 2017 21:57:39 -0500 Message-Id: <20171130025739.4349-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: , X-List-Received-Date: Thu, 30 Nov 2017 02:57:45 -0000 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 && -- 2.9.5