From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0072.outbound.protection.outlook.com [104.47.36.72]) by dpdk.org (Postfix) with ESMTP id 15AB1326B for ; Thu, 31 Aug 2017 05:27:19 +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=2Q7Ua0SPJrQVPUywOkWRqjRlhXLJDY+yiOSWmFPhiEM=; b=NbEUtLd5BZxxB9RbJu1+SQIf70NzWZklK5yqHDlBSVA5NXEX/l4scuU2S3CUbYTRQuXMneYPlGljvJ8cXzerX5Z4ccEWbv7FAv3WeHvUS+8hEm1dcHsCN7/UP/yadKHP9C727+LIcL9U/q7dDFa+BUb4ZOhBYvwjZHMC1PclZG0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (111.93.218.67) by BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Thu, 31 Aug 2017 03:27:15 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, olivier.matz@6wind.com, maxime.coquelin@redhat.com, sergio.gonzalez.monroy@intel.com, bruce.richardson@intel.com, shreyansh.jain@nxp.com, gaetan.rivet@6wind.com, anatoly.burakov@intel.com, stephen@networkplumber.org, aconole@redhat.com, Santosh Shukla Date: Thu, 31 Aug 2017 03:26:14 +0000 Message-Id: <20170831032618.7120-6-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170831032618.7120-1-santosh.shukla@caviumnetworks.com> References: <20170814161059.6684-1-santosh.shukla@caviumnetworks.com> <20170831032618.7120-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0118.INDPRD01.PROD.OUTLOOK.COM (10.174.144.34) To BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c95bf6aa-7a92-43d6-bc01-08d4f0202f37 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:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:mf7RbNXiQiLQuJN81Nq6zNavFl+2DRDg8cTz8CX8VQNwws/WVFoh0oFTukY7t4b1CFbCqT63NJA8kIyiOw64WvLX0ydOkuDJGR6jtYvKcwPF46+LaWm/s0JHg901hBeDTkIGbF9TmIyOWW3rbveQ7DiYDsmZwDk04COq8wlRrJz+u7tG9MVnODRJHVjDkn98zXCyJ0WN0moehX1y84mmErClspPsKAV/Pvqgf2tWg4ZoyLsStUjY7v/Sn9IbeaFc; 25:V1yLSNQbZcLTFvQC+/4SSY3OdeKAKOGIHY10aW251roZWmT9LP7GrbAXjSWp2YTf/uHN4jwSa6cT4b3hZB8roo51R3e618eoOWk+910j7uzszTkLgu+XqJ5KwZqbX4k7/nLWPtz/FuztUQ0Z0R2IY0fuAwIP0Wlhy32uemdRrbf4tiQ/qIkPwpWZAXEMj6BZ96vmDFG4gozDp6YVQLLDLP+ZbZvd1sdrBoTthTUbjdN/toebJFLZNqNgeBT6vI6BrRe980EJLNJwqFsR6ehpQSQYNrXfgz0+6M6sbgW7GPJx9MeeOy51yqQQqs0Jl9TOcQWojtV8ZeD1alM09jRsvQ==; 31:u2Q2QwcyZ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tybodSnM5pORaIu9oKZ4wQbfed3AQpltPKKUMuwVB83ks78/cfTLCA0am6kezlwpComyv7PWw9SNbKy28BedJtt7gJ/BTHRzmNnTkR 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)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3089; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3089; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(199003)(189002)(81156014)(8936002)(81166006)(8676002)(7736002)(5003940100001)(305945005)(2950100002)(7416002)(2906002)(6916009)(42882006)(76176999)(50986999)(101416001)(50226002)(5660300001)(6486002)(6506006)(48376002)(50466002)(72206003)(36756003)(97736004)(478600001)(189998001)(42186005)(2361001)(2351001)(33646002)(106356001)(105586002)(110136004)(107886003)(5009440100003)(8656003)(6512007)(53936002)(4326008)(68736007)(1076002)(6116002)(3846002)(66066001)(47776003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3089; 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; BN6PR07MB3089; 23:z80gDQLUFogzpLUh75dJbcT5jyIKEuPXV8x/Mkecp?= =?us-ascii?Q?LF0CbT0Rd4jL7dDp4vGrkM/MN/xTyDObTmbHzx82m+KaSmTm50JS5OluRQwz?= =?us-ascii?Q?S3ykcWRHzw3UVScMZ/uZY57QcWF88zaV9v6a3oR+BKZ1soVsZvgBFukSiBSe?= =?us-ascii?Q?3gHaCByDE5qbyG6Vg9L/bWQN5Kx1NArQM4+lHpctG3w9KryrcPSFbskO8q/f?= =?us-ascii?Q?A9rAzMEXXqMWy8Hg4Rz1LIjtD/0f+MEcfptf5A/IhAIvVCkFUGxaDAKw9Whj?= =?us-ascii?Q?hPTHQUpxAqmBGMZwzl5zvP4aA7bJyDVNdy6v9NdGJ6R980ZGcV9gbBGXJoV2?= =?us-ascii?Q?u6CryqqsDerLbPUls09OORvd7NyiATEr59xm+C0agfcRxB3ws0VyAO0YWu01?= =?us-ascii?Q?i24ce+3txGNOgNCXSVD2NhH0p2RrhB03ykiopymjyE1cb4ZnRO56ebKH2KxE?= =?us-ascii?Q?k6FRpcvwyeLtWVUODQhGaFomRGJG+o2VnRCcXTIujs4hHB+RnanKi4vUPMdG?= =?us-ascii?Q?4x3yi1yXPpSN3hONerLU5jCe/+eZySSF97GKlxQHM8IHfnkya446foChyx02?= =?us-ascii?Q?gw+bZg64gdRv+TPZr5xf0BGW9taPH3PtrROSOj9b9uqzGztt2Nz7rLGZ+FZN?= =?us-ascii?Q?4z8YsJYzZ3sTVKkoCPAANOD2rbsiahrp+VE+RqG/Z7A1mbKqT8ZstxDBbFBf?= =?us-ascii?Q?CqLts3N+VBilCXORkK/Nl1X85MESHDeIovWhs9UOK8T/V1nQk0ehInK/63EK?= =?us-ascii?Q?NTuC9snZ2g0IWzS2a0LjbSs7mbi93YnS62LzP2ziuN9CG3EoWc+QbzMwQho+?= =?us-ascii?Q?75mq9IsZWbr/xsx0PTPHmvrJRM4A8fUdk78Y97cYpqboM43N1eZB1nDrvhRf?= =?us-ascii?Q?c5m3wlemx6q+hxHSUBYW+DU46eRFA4p5eFT40nEqsQuGMCQGJFLR64CjtSkT?= =?us-ascii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fWFZLBWCXjMUCim/mOR0mf7ylVRK4fG9FZUR7hmRDLjL9E0iZd48AiTdSyayGA0wRxoo3OGKAv6mwYiQWmTQa/nee70ucXCzeFnbwdN56Z0u0UQpTsoxYAuVWvinZgFpJO3ciKFU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 03:27:15.1039 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3089 Subject: [dpdk-dev] [PATCH v7 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: Thu, 31 Aug 2017 03:27:20 -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 9942f47aa..1a63f3f05 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -244,5 +244,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 f35031746..c99f1ed44 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -249,5 +249,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.13.0