From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0067.outbound.protection.outlook.com [104.47.38.67]) by dpdk.org (Postfix) with ESMTP id 6CB72378B for ; Thu, 8 Jun 2017 13:06:22 +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=tEbVYk8JeDYI9Nl7CT0lBq4n1Egmi1YUJnbdCgBVQwI=; b=iFw2azfyd8mwek8AEHbZqRruzTOvm4agjBKBSsgjyZMsk7pFl7Z/9nOaSk+1eQ/q2Imptk3yjtlY20ISFlmh6WrUzPuBKbEjIGQv5ooOAIh6Itd8rEiJ5osdXya0GG/1mQjkvPJ1iFEvpijEDNBRFqD6jTy/WyqzZt9TVixPW84= Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by DM5PR07MB3099.namprd07.prod.outlook.com (10.172.85.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Thu, 8 Jun 2017 11:06:17 +0000 From: Santosh Shukla To: thomas@monjalon.net, bruce.richardson@intel.com, dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, gaetan.rivet@6wind.com, Santosh Shukla Date: Thu, 8 Jun 2017 16:35:08 +0530 Message-Id: <20170608110513.22548-6-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170608110513.22548-1-santosh.shukla@caviumnetworks.com> References: <20170608110513.22548-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0025.INDPRD01.PROD.OUTLOOK.COM (10.174.214.11) To DM5PR07MB3099.namprd07.prod.outlook.com (10.172.85.9) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR07MB3099: X-MS-Office365-Filtering-Correlation-Id: 20cb361c-27b0-4b72-a593-08d4ae5e647d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:DM5PR07MB3099; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3099; 3:N9A3TJMpWb6xFTt849Gqhhvh9DB+SO8aLxNNcKFKMvuIhIWxkp3BNU2SH2ciIneRNmrrn8XHFIXFzo5JSbGNYmLOiEtJd2jvKkvZkCwmht0FoTs1VxJk2CzoEShC+R1ybM/4/O3IiHM9gB7fSXYuXOxtgJWmKy6mouFGDQ8ARPNLAIksj8qCPtchj8ljZ1jzB3XcAp8RfibwXWHIUuUREVsuIcesxwKRne2UMrTbtCyCqP/kd3FHYs8hzNIUueb4eKnJ8jl3dC86AsM7SVBv9M3tEkprUHHKRc3omTXRIu9Ik9gpbiFmRiU/avHwQ7rY+sftdCF+DhLXdyQyse+mbw==; 25:IngA0504buGCATYvV6+oCMyXRfzbnBguI7/ireNsZ0kkFdiF+fZID1J6YkjlrCpTWS1/odtCD0iPA+Rr0SK3cE3ZczmnUJ8qKpwQHyenWXGX0+RgzDIQg3H0SnkhImTPzoufvhQreGZ2UC8kmWsgM0kWxr6mCxIH084iNc4adhyKSmxMtWqkBiM++/2/vvJSc0D6lEDADVd/i/znltGO7PPynAd3wZU/MtwR3B/DFuwozp+sND/G0TIUAQOpOKFn+c6NXLx8MjsBrfG/LHciOucEGR6LYgagM39x3GlSnG8eiqM/mREvKDxcqKLdCtSg8CIZy/wKZIKrwG0jWopcAsXoMziYu42XMZY1SDNBFsSOJr3zI4P6OddpfcQcYqcK8dBHc9/IY5QYwxYCqWg4f4jJF0lJqGNLk7nzs93NT08U/7MpeaXTpv2m3Wz3rH6m3aMJr3AiRI37NdVwZQp0wzXFiDi6gGoOf/0bNzf8JvU= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3099; 31:stb5YNQEQuRTcE9c2C2SGBXXE+XE/c9uZmwBH/pjDx0PW5pJHrJM+CyBSmYQwvt75xuE8C8ju1pYNJ3G1wcCVpxl/tyciHuDaHhfcgEGLoWPVZX3mA9rb+fO6o4fukH/O6ZDPlJmRYbTTQlQPoqCVVlCw70wfT55XHGH08oFc0gmMEFTkYZgtC9JHbagZ4THeRiZC1SrvIHBMTOlAioPpmD3HNSoDWD56WbJUj3Pg/g=; 20:N42EhX+Lhex5s3hkxHHYFiC65aMZai+ehMPcitVNusHBv7USlp4+9oXKtwa/jFPVwG73P76adzrlvfu5P2M/tiAw+7DGxvwkeAvDwpy5UxOsVEHOv2OYi5HAJ3K5lTQJ3t4nC7nrTfwUKMqJ9y5h9bRcdxOTDtUI73+1SQNTdcfwKLEv4J4C9N1DzD/D/TSv2Zpoxa0CRYN1P4O3gVO8/kr6WwcTkYNCQ14eftcX+GZltJbcy4vAzaDgakrhSNYp39Sn6NZRHvnnr8NzbhmIxEv270VxfOSyLHxATLyXXqLNv6ruUT7r8gYcRpV9glLp6/n6IaOxM5ePagHMsz/B1B9Ha3lnMaOPsTILE9pLfBOQH99XOiysSOwTBT2svU/sn8YGT+3tLL2JiBnv+K9P+EAQZwwgH8mgP3Ff6sPADe+99f1ceAsilsh0fnxH6zVlB5xO6iL/oAGSUqM16AMFaP2dlTNZA2kUDWKn0yJw6Gbj3a4X98Ybdr7i4WwHDlyx+8GOjgAMcCSBnJPUkgjsUxDvqaRZMTHN7sGw/l1+jFXWvOHtzUW+otD1ov5yJEjolMYnOseVPbVWx1NTVZ4M9vhzTmMo3bmmgXCXSKaPRYo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123558100)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3099; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3099; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3099; 4:aqb5W57zRpJbz3yl+Ft/gsShPmpellAzDqllj5/29m?= =?us-ascii?Q?lTKGHYyaoPanqdXNeidD+gxM2JZH5N8QVsqDphuxovrz41QjhFiDqAErr0MP?= =?us-ascii?Q?pbVXWxlx4HKocYuX5u66vmnuafpJS4t8vql9/EOTkQJCRXxneydLk16PEKiS?= =?us-ascii?Q?h219TCEvV+Zk5PYvzpx4tIbOziald4zfQ/lbCZUo4DX6oaKhUNLsX8hR6u5F?= =?us-ascii?Q?eoGHdQgnfXNHqK0yRZgvu0pXtELG4dnFKfBdoQUuYZ9WsrnamieRBwEx3b90?= =?us-ascii?Q?4xygz2O1bDpM6cwn6UFD77Kzi7FGgDYUTuRm8clQYqUlvYTWB+w74QPe3nse?= =?us-ascii?Q?slRnTJOXX1ZLRMD++DQyShGV0xB62FkoKl8vxP6CAbWlMbb9TtxL/ODmwC2L?= =?us-ascii?Q?CFyy7SOSBigqc/3+Yyx4FyOm8bYJtFhRhG/4SuTHcCtVUD5Dtq3inkdDOMJX?= =?us-ascii?Q?TakFzCnzZydBautSXKrMgzxXSDJ3taLMDjgEe64EBnrnql5jvSN9cPkaeI+q?= =?us-ascii?Q?a5gPSsXC5UBtRlq4U5I27RrRXEqpKdN+m1zj/pa6XE4G/0NwnqNt7B0WJrHi?= =?us-ascii?Q?1v/PRaqXEHD7iayAoddFh8ly0RUvPd/bQqUurkblQniAsB7ZZEdQqZdNZasV?= =?us-ascii?Q?X+hfra7vx3TZxyZCrzZw648o2ohdo72IJPfkX5EY562JrjDQ2vDevaLHePEG?= =?us-ascii?Q?LtlKY+NKk0znLfy7ZqVeisxlv820rEu7amvukwSCD9DUXh0F/ruHd0x/yDuC?= =?us-ascii?Q?ILmBEheIQjXdNEscV0Au4+nfCdoEErW4o0XyQjjpxGg/P1RZ57mPhqhyI1fZ?= =?us-ascii?Q?6VC8z6b4+ur+we8zpJQItQch+ZOXPxO4nIvccral5ZFG/izEWcFkL+7/lWDp?= =?us-ascii?Q?AJTzpAdwLtijWkf3WpzmmAMH1cL/Vkr/7oSpSBP23mvfUSjQkmoHXzIvySWt?= =?us-ascii?Q?soG6slYQyYoWb+9z9IgdJ9rtCAyuogHND8ay3T5i7XQhhYlx1RLISvSdCqJg?= =?us-ascii?Q?2+nfZVPprOJ6Iei3mjsUcAjmFC3guO5GfLWWUkvil8gvGdCQHh2hyuYt5diM?= =?us-ascii?Q?7N/aeigLJDrizrNXRC7V14JCpUw3vNByd7X4biWlQQfiPMOTCnrLmDbWqRa3?= =?us-ascii?Q?WBk8IUb3A=3D?= X-Forefront-PRVS: 0332AACBC3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39850400002)(39410400002)(39400400002)(39840400002)(81166006)(8676002)(2950100002)(72206003)(6512007)(6666003)(42882006)(8656002)(5660300001)(110136004)(1076002)(38730400002)(53936002)(3846002)(7736002)(5009440100003)(25786009)(5003940100001)(305945005)(48376002)(50226002)(6506006)(478600001)(42186005)(36756003)(50986999)(6486002)(66066001)(76176999)(189998001)(33646002)(107886003)(47776003)(4326008)(2906002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3099; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3099; 23:p/83kEtg39jwtLuLixqdupB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9acDA+UEJ2Ur8ty2i5oTHb0Eq8tCLwO95y8Yui9aM4tWAPZTn3XEpMxob+Uu0XNyiRt5wBLI6/sgI+fOusCe6RGj/eQo5AzO43EE1ErL0aRR6Mx1snnVVnwY8plFnl3IpfWEP7yyJ62E0AjW0Vr3lWTS6y34M9NJ8Rr7kdzvNutOPwl2Ase+uZ7wJt6bi1fFSG82ojb/8dHL2geEis1w9yhFyaPuTCTNLZXiGWnoFx3Zk9542fcqqxow8bs4pN2cFG0MM/EEYIRc0z9gvd6vuLOc4k0YrvMLVWjNCCyqvRWUWaiS4kffzp8D7xtqWJfPVLwrtLGHudqAhZ+haAf8eQldq; 24:1bxiWxxfV/wbG2bdB3NB+DBPCD3tfIjgdmL1PpM0qhVDWK9+6XTpK7uZv4OdQj2Xn/46DvgaH0esEJmQoktFW/oZ0oo5jOJGfhQezYTvU8M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3099; 7:A61IZjOtq0qLvbPR9kIUod2jt/DPGhNaWl2uTPYxOqxyLbnzhpI8XrNRJgda3OSbwZmfEiWpAAWxuDIDl6RpZot0Tp2XUe8ShhLkXVh2P1C0zEspxoZgup3qysaxVvkoOYSH3oZLW74yBxrzcMvXMigYU2ewbDyAt8MBJJxVj0Va/lYl+AeB0uPPw/qBMi3Dk7yMjAQ0doRed5TNpKnUL9QC7HqjKcXSnKqqQP17vvyLvcsTpZHncGb48dkkBb4QHPZtiWHeJz0UdRcjB8pw/gi4UqdzaBrToBPLZYDF2InpFU55hI6WtjlGKPwqyKXM6WcRKCLOsSGrKaQpjseZzw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2017 11:06:17.4072 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3099 Subject: [dpdk-dev] [PATCH 05/10] linuxapp/eal: detect iova 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, 08 Jun 2017 11:06:23 -0000 - Moving late bus scanning to up..just after eal_parsing. - Detect iova mapping mode based on user provided eal option (rte_eal_iova_mode) and result of rte_bus_scan_iommu_class. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob --- lib/librte_eal/linuxapp/eal/eal.c | 24 ++++++++++++++++++------ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 7c78f2dc2..54f42d752 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -122,6 +122,13 @@ struct internal_config internal_config; /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; +/* Get the iova mode */ +enum rte_iova_mode +rte_eal_iova_mode(void) +{ + return internal_config.iova_mode; +} + /* Return a pointer to the configuration structure */ struct rte_config * rte_eal_get_configuration(void) @@ -793,6 +800,17 @@ rte_eal_init(int argc, char **argv) return -1; } + if (rte_bus_scan()) { + rte_eal_init_alert("Cannot scan the buses for devices\n"); + rte_errno = ENODEV; + return -1; + } + + if (rte_eal_iova_mode() == RTE_IOVA_VA && + rte_bus_get_iommu_class() == RTE_IOVA_VA) { + internal_config.iova_mode = RTE_IOVA_VA; + } + if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY && internal_config.xen_dom0_support == 0 && @@ -890,12 +908,6 @@ rte_eal_init(int argc, char **argv) return -1; } - if (rte_bus_scan()) { - rte_eal_init_alert("Cannot scan the buses for devices\n"); - rte_errno = ENODEV; - return -1; - } - RTE_LCORE_FOREACH_SLAVE(i) { /* diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 6c016c82e..79b005036 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -204,5 +204,6 @@ DPDK_17.08 { rte_pci_get_iommu_class; rte_bus_get_iommu_class; + rte_eal_iova_mode; } DPDK_17.05; -- 2.11.0