From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by dpdk.org (Postfix) with ESMTP id 69CC52C3F for ; Thu, 30 Nov 2017 03:57:27 +0100 (CET) Received: by mail-qt0-f193.google.com with SMTP id u10so7109419qtg.2 for ; Wed, 29 Nov 2017 18:57:27 -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=vKLuvoN9RbGEJLAOl/mwpOAmxtOT9ZUJ2Sdlch2EHAsehY2fot+vNSliQ7Js7z0opD rNgwk1Mqu+lTXlJafgZ3q3F2a247fDJxZx3B5Ud5+wIjJktYuvo8jmC9Lhynn1fSGWdZ PhX7MgIrjRATDDSvv35wPGC/N226V2ggnUn8m0Mpdh5Ph9CtoiSuWHUxC1rHjm5QDDeA CQ/2fst7duNmfKZFPGBQQwxQFIaAm6IoXbp4msabvukly1DiOzUa1Vj28ROFMb2x9SEv Fnwn/RgnO37tCcOVXgyUO+uDImtMEgn/9+7c2lUlmiCtsXkqioVnc7seXHm70A3ya3c/ rDxw== 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=cC/NFYRoOCS6k4BinXly/dfjwU6gCKLSz9ZCu6Y/U0NPgbEs/rq9xIxRHHGKseONnY jODKxrjMfOU2MUuAqJXSKWvQp7otKuvfBfVRrjtEM7f8xDm6SszgfygFc7H4898VnbQK XVD0LSDhhrtn/tSRizN+u51SfO1a6VCO9auoB70lRJak//WKc6cX7iKiASQJiLZLxMJy oxYqviVcmmvjzRPQDIy/OZhcySMuQVdEZqZQYNymKZOmpgFKR6GnIo6ZEx+QKM8kkzLu N+Wr1eUiQt154pL/0RURrZKVvmdZHhnCnd2BdtPnnajElxR6kgW572BNcwaN4sLx26Z/ It7A== X-Gm-Message-State: AKGB3mLDHmqyp8v9dqmpDwZN1OTMFhR4P7ZmdnNXvElFETNAxc4aMenZ scULe9pf2dJze31Ryl2k+L9xzg== X-Google-Smtp-Source: AGs4zMbhaDRKIxVIYhACBAJ9YHEIIMFnmKMaaM0+ewF+Jfs0bdfPLWIf6YoijecgwuUs30+45zuRuA== X-Received: by 10.200.37.3 with SMTP id 3mr1437760qtm.21.1512010646787; Wed, 29 Nov 2017 18:57:26 -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 m50sm2341272qtm.31.2017.11.29.18.57.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 18:57:26 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: skhare@vmware.com, Chas Williams Date: Wed, 29 Nov 2017 21:57:21 -0500 Message-Id: <20171130025721.4301-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:27 -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