From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0072.outbound.protection.outlook.com [104.47.32.72]) by dpdk.org (Postfix) with ESMTP id 63C6E1B1A8 for ; Mon, 18 Sep 2017 12:43:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LA/xf2YGZHXixrLfBl0oOTItTD7Zv3+5/2cgRrEyq70=; b=TTFMD11URApPPpWouGeEcop4C7wEFpjUJbWZH3dJgyYAJ9sN4emLhuBm0wzM6mSBHs8HuV3FG4Y7+5z9gI5/fMLJ26hQkSsSdQafhTBExJUnMGA2OFimXVOAmDfRgpCFG4mbls1BGIudh4kKGzSlnTWsahT0p4BFg9yH/xh2LzI= Received: from localhost.localdomain (14.140.2.178) by DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9; Mon, 18 Sep 2017 10:43:44 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: olivier.matz@6wind.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, aconole@redhat.com, stephen@networkplumber.org, anatoly.burakov@intel.com, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, bruce.richardson@intel.com, sergio.gonzalez.monroy@intel.com, maxime.coquelin@redhat.com, Santosh Shukla Date: Mon, 18 Sep 2017 16:12:30 +0530 Message-Id: <20170918104234.9149-6-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170918104234.9149-1-santosh.shukla@caviumnetworks.com> References: <20170831032618.7120-1-santosh.shukla@caviumnetworks.com> <20170918104234.9149-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0093.INDPRD01.PROD.OUTLOOK.COM (10.174.144.161) To DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f861b4ef-596e-4f70-46a9-08d4fe82266f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR07MB3097; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 3:A9RYR57oixz4UVVdOFrwDTAL8kd8/LnLBwCPux865CbkPH6NTL0s7FsCX/TuZ1Z3gox7CpnHadvxqwwApB9Ho3H/NyWgSXEbGzF+6D82bmWHGTIlRGYiuRXy6lW3dYQZEVu+sKPPkTFQiP8bgUq2iZ8kjO1mU/JEIGzkNBF2swo+YJ+P8Ml2RThGLPJaK1evX1NVW3MpQi/0s3EQeF1ylk0bt8I/mkm46M/mcfN7T6TpCLKPbErzj7iydceytT0z; 25:4cbrwEP6kx1XOfy2HeCNfe6AmnecwDAWCplW0KfMRb7i16g/OKdi2ipbRZxIZwezhT2W+VYPUSAY7eIa7yaoOSs+Y4g+v0dpu8IILzZwf83EC02SahPprX7fM58tMJaSHSkVFgWBHOrAMRrNYJ4KNvDIl8Tt4oGzQoQY5RfCgSWAxz8hAoaA3BJuodZii297YycOxjYAKw5cPGen6gNddXYUUlm2rvUkYUoOQhKTrtOTreAvWfedsSU/POZFjbJ/3EaU+3EHvjle1AfoU6E7Wv0kk6N4zfqQV6sFLWilXJkctygBrqyjJegN3+Q3LrVOUMM4Amb/lggzRUiy2MzdAw==; 31:OqWFJ8lgNwtbpmtBRLXzUmEq251mnUYr/zoJx92UslxLed+v5azvLMTG6ETfZvODOj5hY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bvv0pTrQ+0h973shnCBN+zOC06jrJYXQ07V9dSRJRzuohm1Rdm5MleJxYO6wdZVYKHKOlkQkD5xF4KPW5lml3hCV22bVdke2lm58vDWTEZpIoo X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123558100)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3097; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3097; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(199003)(189002)(6486002)(76176999)(6506006)(48376002)(50466002)(25786009)(5003940100001)(107886003)(110136004)(53936002)(4326008)(101416001)(97736004)(6512007)(16586007)(106356001)(105586002)(2351001)(47776003)(305945005)(189998001)(33646002)(478600001)(5660300001)(2361001)(42882006)(6916009)(6666003)(2950100002)(7416002)(36756003)(66066001)(2906002)(7736002)(81156014)(68736007)(50986999)(8656003)(81166006)(50226002)(316002)(8676002)(3846002)(5009440100003)(8936002)(16526017)(6116002)(1076002)(72206003)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3097; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3097; 23:2F+y85aqh5NUML75BcB6/XSwXpoloOHA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J/FUpifAYCOlLVjhMBIrGg/UxxMD3Pj4kMNif5dzdDdCvhqF/0MuPBaDlUiJGq1B9m1TYkE=; 7:XbfuiorpjmPAymQSgEYC/ta7ihaCwNcCxZ5D+0ye+zDk2o89/QzTSKyUwfBeicqV6H6gsGiQHJXeJZZB3xUO5ykRBp0hIDrgDArhz1xchWvszv7apOBPl/6ZVg4XH8216k3q2BWs7PB2WxPgmQBuCNsIjU5aAy8qBjj0vMYgmEjOZktSaJn65iNnVio4XZSk9Upx1ERJNyC4XV11zEvryusr1OdhD5qaONZquicw32w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 10:43:44.1206 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3097 Subject: [dpdk-dev] [PATCH v8 5/9] eal: introduce iova mode helper api 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: Mon, 18 Sep 2017 10:43:52 -0000 Introducing rte_eal_iova_mode() helper API. This API used by non-eal library for detecting iova mode. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob Reviewed-by: Maxime Coquelin --- lib/librte_eal/bsdapp/eal/eal.c | 6 ++++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + lib/librte_eal/common/include/rte_eal.h | 12 ++++++++++++ lib/librte_eal/linuxapp/eal/eal.c | 6 ++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 + 5 files changed, 26 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 5fa598842..07e72203f 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -119,6 +119,12 @@ rte_eal_get_configuration(void) return &rte_config; } +enum rte_iova_mode +rte_eal_iova_mode(void) +{ + return rte_eal_get_configuration()->iova_mode; +} + /* parse a sysfs (or other) file containing one integer value */ int eal_parse_sysfs_value(const char *filename, unsigned long *val) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 3466eaf20..6bed74dff 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -245,5 +245,6 @@ DPDK_17.11 { rte_pci_match; rte_pci_get_iommu_class; rte_bus_get_iommu_class; + rte_eal_iova_mode; } DPDK_17.08; diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 0e7363d77..932dc1a96 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -45,6 +45,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -87,6 +88,9 @@ struct rte_config { /** Primary or secondary configuration */ enum rte_proc_type_t process_type; + /** PA or VA mapping mode */ + enum rte_iova_mode iova_mode; + /** * Pointer to memory configuration, which may be shared across multiple * DPDK instances @@ -287,6 +291,14 @@ static inline int rte_gettid(void) return RTE_PER_LCORE(_thread_id); } +/** + * Get the iova mode + * + * @return + * enum rte_iova_mode value. + */ +enum rte_iova_mode rte_eal_iova_mode(void); + #define RTE_INIT(func) \ static void __attribute__((constructor, used)) func(void) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 48f12f44c..febbafdb3 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -128,6 +128,12 @@ rte_eal_get_configuration(void) return &rte_config; } +enum rte_iova_mode +rte_eal_iova_mode(void) +{ + return rte_eal_get_configuration()->iova_mode; +} + /* parse a sysfs (or other) file containing one integer value */ int eal_parse_sysfs_value(const char *filename, unsigned long *val) diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 9115aa3e9..8e49bf5fa 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -250,5 +250,6 @@ DPDK_17.11 { rte_pci_match; rte_pci_get_iommu_class; rte_bus_get_iommu_class; + rte_eal_iova_mode; } DPDK_17.08; -- 2.14.1