From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0072.outbound.protection.outlook.com [104.47.38.72]) by dpdk.org (Postfix) with ESMTP id 54B4558EB for ; Mon, 24 Oct 2016 13:59:31 +0200 (CEST) Received: from BN3PR0301CA0024.namprd03.prod.outlook.com (10.160.180.162) by BY2PR0301MB1621.namprd03.prod.outlook.com (10.163.28.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16; Mon, 24 Oct 2016 11:59:30 +0000 Received: from BY2FFO11FD040.protection.gbl (2a01:111:f400:7c0c::109) by BN3PR0301CA0024.outlook.office365.com (2a01:111:e400:4000::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12 via Frontend Transport; Mon, 24 Oct 2016 11:59:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD040.mail.protection.outlook.com (10.1.14.225) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.669.7 via Frontend Transport; Mon, 24 Oct 2016 11:59:28 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u9OBwEMS008267; Mon, 24 Oct 2016 04:59:26 -0700 From: Shreyansh Jain To: CC: , , , Shreyansh Jain , Hemant Agrawal Date: Mon, 24 Oct 2016 17:29:27 +0530 Message-ID: <1477310380-17944-9-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> References: <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131217839691869884; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(5660300001)(626004)(36756003)(305945005)(50226002)(5890100001)(50466002)(8666005)(81156014)(81166006)(110136003)(2950100002)(48376002)(7846002)(356003)(87936001)(8676002)(6916009)(19580395003)(19580405001)(85426001)(47776003)(33646002)(189998001)(586003)(50986999)(76176999)(86362001)(2906002)(105606002)(4326007)(5003940100001)(77096005)(8936002)(68736007)(106466001)(104016004)(97736004)(92566002)(2351001)(229853001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1621; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD040; 1:amoxYxHkfi3LWloQtUYsBAT/LFPeDwj7x/W8LCyIzpjoeZO6w7wa/LNycO5nzNd/6IgrsXoc9ZQcPyxEUIvnPfRzlOUZKCBzGYk7n0YHDE9ys4WPcWQB5JtjCfrrrMnTGmV2UsAxLkniYZFGpKcfjC850Ohp5mJWuKWUzcp70hj1p2nJCJDuGMjB+wuYAhRuqL8SDtaEP49JvounSstOyNGhoxZeXAhwieKAphqHYcAhCqOSgdRIxLz3DpkpagLfEE+A5vkfNWzHzCITPkm7GCwwRz35wRbnz7JZ6c9Cb5oGpFm+D9U0F/a8Vpwyk9+QcfDjbDRJVP3mE25MfO8gtoabL3cPFODIexpRl1TKqKXjhJS0qe8sBPTC5jLzXqiWwpKtWUEVmHGO1ttFDKWQNWWGsEf4BcEpRqd87YInrl1PoW077U+ipcyLb7+Z++0o5oAIyiybRJPfV/JXPiEO5RAW/vPACpIrK6SaS+ecEEjwhIOvUP9srwuNucwONC3nW/kioXEAmMukxuFdg7lqB1d4yH9N03w1Vzur6UkrNNEBhsi2GEvIxmkC5wqQ/Se1IsSxNao6YfFyyfnPry/vNF7Z9068bKwXqzVMf6DViCOLyh0EU9S7khiqlsPmzXfMuf2Gf+gHUEEgvfSKWbyhZad4L6aUDz7G+7PFvI/vfK3XQU0fVJh/jDS8Kv3hufyYlrHS7T4bG0DMZ2te+gSxA7Z0w/E0wmK5f8zZfHdPs8Y= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 953a01d8-913d-4ac7-2ebc-08d3fc05357e X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1621; 2:NTE1i2K2gpmeLUA/mF2P1xkdQY2+ncpebRIWeeDIyypWul42aUijioQdRz5pexCTZS5vWPN2qauFSWNfxM8YVyKLDzzOP/6tnmjk7c0WToObUIQ3nHxJKr9qgc4nWP9NfHilKgLYX1DvfHm0QvxYigaCJdc1VSQavrLTJVlpGzXQsWA/znpuGzI2zMQ2WrqNqlPTBGqE4fzHCQn8NXLsSw==; 3:UfjTJXaVz9TduktvIWtRyb5SgoLIaFoGoOpz+XLHSW3cMdsCRQYw8U/E0q1cQ+rOBtAZGgnKuA/rypGXsnYhn76OPb9d83aQOriaMjVc7LuHBqRMgbrAPOlaOTYkzmSDkPval22Nd8TPKrLY+Lwqo8bYqPAEsSxT3u1YDvNtF1cWsjF1996irBGJPkd4QgszMemxhdXKBt22L8eAF2oh7YmBVejtNZdMrh4UU2BMD3h3VlpM/EBpZoU9C3/2i0K9; 25:BQQzFX82s296Ud1+GfVoEFnwi5s3132fCz4Sj66YzQFPZPmPv/WNpD80JIYxUeovpZPXw0vsjgWEiLgRBHYBhx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jAfOCE8tpbW0Qwer1ubBkoqDivO0W2PJA8Ezjhz56482Rc8ZqRTHPUMMQFxTvKD3WjiaIkX9MFUah/VoAeh4l3Dg87uICHga8MTwM7nnYQntpi57Da9xMZTG4+RRsaXmn8Gh3ko+fqi9jBldROPkwcIBWfB2Vl5KYk2/F/hKjlNl2e9wLOxzkGIpHDKYyMba238xvOAPdXEsB8l+QULhh4o6zKlUNI9Tm1+STC5qK3YXuy+Y9PTR0XP4YNWCZJVojfIlbdi8t4TsQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13023025)(13018025)(13024025)(13015025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB1621; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB1621; X-Forefront-PRVS: 0105DAA385 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1621; 23:HV+0x2pcQN+BUAHtYUhV21Whl0SMgVXu4KI5k2r?= =?us-ascii?Q?PI6E8ozW2Wks/5oUbmOWllNwMuQ1jzwbD6rn0QSjtbJInoSaFQNnqdKaFmwT?= =?us-ascii?Q?TyvsyqBj/L5ljHEELn6VNVaxGRpiBPYZNXfgI4mUHk2pOxj2XYbwTmPg/BkL?= =?us-ascii?Q?ormM18b8y1k3L7LHsaXN28i3btcmy2Yxow/xtNTA8rnF60RFR+JuUcrPXWqw?= =?us-ascii?Q?PLMwycHcpDiK862DBX0rtm0R5LId6odfZSxemjCRodUvAtd0LrIH/gvkQJRk?= =?us-ascii?Q?sCUrK3op9mwSJrS4NqVGAuTlHUmbTecg1iMLtLTcMCiFNFAr9K7oMzd2SafC?= =?us-ascii?Q?+Hu4jKttIHxURyspCr8DhFwFEdkWDq35EK1k8OXl6Oe3Nide2bg8JGGrj7xA?= =?us-ascii?Q?02SMILTAsjlnb0KzjMpCnPy0lIWLd+dRCACEishjoDtUHpHoZjQBLBjUQejb?= =?us-ascii?Q?Ej9XbmC8X32UtK2g9nP50mFRdWaw+gpOY9laVHmmFw0bKyHY/BLXfVXSNTPw?= =?us-ascii?Q?UQ++6zDC/fZWikqGrd7KlZaNTnq5v44q9LWFW9aBmFPiNtK4IiYjXcnKsWN6?= =?us-ascii?Q?rc2uCcNh5KI98T4/1+kJN0fw9omr80SisR/ddgIpkUlS8ZUGGGtinHndJ96K?= =?us-ascii?Q?kRrFmIDYMT0+t+PCdT0nHJX5m3hg8Ic4t8iII3le9p8jHIuY6qHlT81y00k7?= =?us-ascii?Q?EVNJXK0cnJfeHCkZagjmLQ4gotgNlZ9swDG925pdEOzga2lB45DYTCx42LNC?= =?us-ascii?Q?WcvJfGoaTrlRc+HYIRnwraBmkd9xLkC22IB7j5lvPiny+U0FYM2cAS+p9Npo?= =?us-ascii?Q?XVYyx5h4hw/sFgLgfOktze7dN93EizSqw9dg/LSzwNaOubYtA8t/hCsP2aLr?= =?us-ascii?Q?zkGQmCLH0+wTfbwhduoP79ro+SSz+X//h1TMyx/rBvtnAFkYCvblw6QQ5snF?= =?us-ascii?Q?BYSVCg15FGtds/1sTZ8JFKjo2WG77bWXk4C/KMwDIoCEBMQn0lI6GRaN4yQT?= =?us-ascii?Q?pAAbm1+/aX3hhGMtVysCQbv0ILwjoIHeiVBX+hmurujDOZYlGq87aoTL5oTP?= =?us-ascii?Q?PYrU+hud61xQCwfR6eMxL4GlBlnvihpffdPkqiYvar+flqJ/Y8akBZ38UgzJ?= =?us-ascii?Q?aB8A5J3lcaNkDD1XpxCfDi61T0R4c+lDnJJhTuc0P0bt6iF6tbE1Yw1y/q76?= =?us-ascii?Q?PvsMolludXzSXKLo=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1621; 6:zhWufF5ztvKxsC12LcOA0szwz2/OpoCQ80fXQDEkMBRcOvrHfHVvo05a/O/r+PffdjIZq6sVMPPg5gBG+5naOICxngpRDuU3351iZT0Krl6bbco1KQRBlQy7/xgFv1mQ8hojhtpTQFkJDCmFFf87Glw8tBajS0nTspqPgVLjzSub7dUgE6o2fFMP208gMebSDujBJigV+fEdj425MTzsBQ/WpyMPml9V6ksq2YTvSKKXn11CY3flstcQ6QAZMsvUpTOXJLcwEwQErAW/A0pgs75N4Fl6bp25Oa7BgjaRA09An4mYfAt2D7gujanje0q6; 5:MmwYPL23F7O3Z++keQi/1xwx9lTzBrJoZF+3V5jW64pUxo503L5uHOMTE2Vyspbfpto4l9PSBi6MdUDDyo8H8k3UiCOLHxusC77zxw09kvAqFcq7SKr9a49+vT+m0G6zq1/glBux5MmPCyKvp+RpLXqdUUiOIbgnZ1o1o8rkxHqRN8VjiQepMM2yEa4Bfibq; 24:asff2L0EU85kPoyftMZvwX4boRP0hxB8axrI4sNsP3wD4i9idGO++s1uOEl8uJYI4Sagjd7/24iBtEOVdy5KEhl3Pvpkf8pEOX93OAzk2pI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1621; 7:deuWmtjy7XCN03VYsm8xqrSaYiNVBtE3+APM9QRKw5FtQghQnl+XnOqcCCK3GnUQoiUkR0cE5A5qs6/HPkhdMHziD5xHI43Gig3taFwW6tRhGAPbTTazdvhBQSGAxvqEUikV+EU8tcbkQvkVndwHL3QIBpGMesr9hEFRyicJygBK5KaYMoIwUwXjtSTZUxjWK+PJrt/3Ua1bbxG17NfEI/dsflLJkV9XiIKjd3KipF3OrI4q2sBRovpd5eerOhlQd71tEiBm3FXnh69Two3SGXP7frR4F8j41AnHbyRYDZ5Pr1gwezbEgSxezBvmkHNpVH6N4TQk9q5Cmc8mLwi8IzPaGapg5ADg6zaLl8P3WbU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2016 11:59:28.9841 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1621 Subject: [dpdk-dev] [PATCH v5 08/21] eal/soc: implement SoC device list and dump X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 11:59:32 -0000 From: Jan Viktorin SoC devices would be linked in a separate list (from PCI). This is used for probe function. A helper for dumping the device list is added. Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain Signed-off-by: Hemant Agrawal --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 2 ++ lib/librte_eal/common/eal_common_soc.c | 34 +++++++++++++++++++++++++ lib/librte_eal/common/include/rte_soc.h | 9 +++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 ++ 4 files changed, 47 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index cf6fb8e..86e3cfd 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -171,11 +171,13 @@ DPDK_16.11 { rte_eal_dev_attach; rte_eal_dev_detach; rte_eal_map_resource; + rte_eal_soc_dump; rte_eal_soc_register; rte_eal_soc_unregister; rte_eal_unmap_resource; rte_eal_vdrv_register; rte_eal_vdrv_unregister; + soc_device_list; soc_driver_list; } DPDK_16.07; diff --git a/lib/librte_eal/common/eal_common_soc.c b/lib/librte_eal/common/eal_common_soc.c index 56135ed..5dcddc5 100644 --- a/lib/librte_eal/common/eal_common_soc.c +++ b/lib/librte_eal/common/eal_common_soc.c @@ -31,6 +31,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include #include #include @@ -40,6 +42,38 @@ /* Global SoC driver list */ struct soc_driver_list soc_driver_list = TAILQ_HEAD_INITIALIZER(soc_driver_list); +struct soc_device_list soc_device_list = + TAILQ_HEAD_INITIALIZER(soc_device_list); + +/* dump one device */ +static int +soc_dump_one_device(FILE *f, struct rte_soc_device *dev) +{ + int i; + + fprintf(f, "%s", dev->addr.name); + fprintf(f, " - fdt_path: %s\n", + dev->addr.fdt_path ? dev->addr.fdt_path : "(none)"); + + for (i = 0; dev->id && dev->id[i].compatible; ++i) + fprintf(f, " %s\n", dev->id[i].compatible); + + return 0; +} + +/* dump devices on the bus to an output stream */ +void +rte_eal_soc_dump(FILE *f) +{ + struct rte_soc_device *dev = NULL; + + if (!f) + return; + + TAILQ_FOREACH(dev, &soc_device_list, next) { + soc_dump_one_device(f, dev); + } +} /* register a driver */ void diff --git a/lib/librte_eal/common/include/rte_soc.h b/lib/librte_eal/common/include/rte_soc.h index d17b20f..4a01af5 100644 --- a/lib/librte_eal/common/include/rte_soc.h +++ b/lib/librte_eal/common/include/rte_soc.h @@ -56,8 +56,12 @@ extern "C" { extern struct soc_driver_list soc_driver_list; /**< Global list of SoC Drivers */ +extern struct soc_device_list soc_device_list; +/**< Global list of SoC Devices */ TAILQ_HEAD(soc_driver_list, rte_soc_driver); /**< SoC drivers in D-linked Q. */ +TAILQ_HEAD(soc_device_list, rte_soc_device); /**< SoC devices in D-linked Q. */ + struct rte_soc_id { const char *compatible; /**< OF compatible specification */ @@ -142,6 +146,11 @@ rte_eal_compare_soc_addr(const struct rte_soc_addr *a0, } /** + * Dump discovered SoC devices. + */ +void rte_eal_soc_dump(FILE *f); + +/** * Register a SoC driver. */ void rte_eal_soc_register(struct rte_soc_driver *driver); diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index ab6b985..0155025 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -175,11 +175,13 @@ DPDK_16.11 { rte_eal_dev_attach; rte_eal_dev_detach; rte_eal_map_resource; + rte_eal_soc_dump; rte_eal_soc_register; rte_eal_soc_unregister; rte_eal_unmap_resource; rte_eal_vdrv_register; rte_eal_vdrv_unregister; + soc_device_list; soc_driver_list; } DPDK_16.07; -- 2.7.4