From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0052.outbound.protection.outlook.com [104.47.32.52]) by dpdk.org (Postfix) with ESMTP id B6EED568A for ; Thu, 27 Oct 2016 17:17:46 +0200 (CEST) Received: from BN6PR03CA0021.namprd03.prod.outlook.com (10.168.230.159) by CO2PR03MB2373.namprd03.prod.outlook.com (10.166.93.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Thu, 27 Oct 2016 15:17:43 +0000 Received: from BY2FFO11OLC011.protection.gbl (2a01:111:f400:7c0c::123) by BN6PR03CA0021.outlook.office365.com (2603:10b6:404:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16 via Frontend Transport; Thu, 27 Oct 2016 15:17:43 +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 BY2FFO11OLC011.mail.protection.outlook.com (10.1.15.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.679.5 via Frontend Transport; Thu, 27 Oct 2016 15:17:42 +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 u9RFGIfc027183; Thu, 27 Oct 2016 08:17:39 -0700 From: Shreyansh Jain To: Date: Thu, 27 Oct 2016 20:47:34 +0530 Message-ID: <1477581467-12588-9-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> References: <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131220550625200668; (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)(1110001)(1109001)(339900001)(189002)(199003)(4326007)(7846002)(87936001)(36756003)(105606002)(104016004)(68736007)(48376002)(50466002)(97736004)(305945005)(19580395003)(19580405001)(92566002)(86362001)(5660300001)(85426001)(356003)(189998001)(6666003)(2906002)(77096005)(47776003)(8676002)(586003)(81166006)(8936002)(50986999)(33646002)(81156014)(8666005)(11100500001)(106466001)(5890100001)(626004)(50226002)(6916009)(2351001)(2950100002)(229853001)(110136003)(76176999)(5003940100001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2373; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC011; 1:a2sOywRX+EgmRbi562S2vkdYNCUqJ4qyHk1RWjfzLa/XI9amHPn5WP/x6cbBorTQOCnBuluc2NCT1UMNwV2FF6yp+CIiW05m0xqQ+5ztA07WhdT1KYvWfSReUpUmtT1GtoCkCijIYRZdDvmaJLN5jiJjPGQI6sqlgIrcIdN60fm/2fe6P0yWA/7JM7w2/0h+/baFOvAAnu7O5vzBpENZzGab3mqmJc01kQn8uD0FK8SY/2DGBqk3ZLHuMhmeExMn455hBiyROeqL5Bqh8UQlUYcGSSktboVKJS7lKlcQ5XUsny+Sm9Jd5D1lThxP3Mof0QHmKOH40PL5sswFz70jAKGezSeTARUkAywYtDvoSTdLwaV1Ara3WM/p3aXAWbLvhDTAJDpHgno1Q4AzlpWePpWa4gZl3EyLeaDqzDVChqPm9yaPF1l7ol1hVy2w/fyVeX+sAAo7aeq4b/cc3Vl6O9b8soNjazzljiMF0tHE+VhFoddioGtmFrremyWZMpZdLdm5cumIgIvSa0/y9zUDnze3u/zbcdZpiKhdsiAO1HfdREw/AhlfhJNX+lqFN7Lp8aBXFljRBvAwk/QVIP7rzWo/S4JkGirAKrtEK3Gn6LD3g2Hj2zm4kNF8ZphhoG1V2eAXRoRWiEUyR6CuBbJ+asVZeXsJGfxbOxQRXxfj6dzOtMps5ftJSsqswxLgUAW5pXn3ot/51lWG1Jth4WJRW+doyWvtwN7HmeKYFdYPVU0= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: d7560297-9fd9-4e85-0a1c-08d3fe7c65b6 X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 2:z+I96IBIXyFutu0BjWUdAQ0kWXpWTGgEKz9H8uk04O8NaY10mJ63QLjIsQ667UAkMR8bj25igImtCXLLJFfeLjmsjQARM+u6IqlKOlDR7eSZs2G7qge2sEUzQJVsPcuSuzLgTJtGPbZkIf2HrzJ3p+NOr9qEdzmmXEX7vSgnZ9hAHHIYLfrNuK2h/4BdD5jaBC3bQF6Jak1TdhiE1eIc4A==; 3:dEkLfbXALqvnmIugy4eAD/kdVv5RZcgVHR2GlzrYa6MUzJsWgwXdON8JBGaZnXqsrXu1H1cjVuNCvqB7DcXwmKQFYZ7JpI5WULCsBVlMeb/LKRDYx7NDPkglJbfhT0br3X/DDO0CRzWmAT+EddovC8EmSaEamaeNnotSt4nZR706NRInvb+EQ32b149WJ4VkX+G4NKTu6K8zC+sd1VnCNfP/TrUBCvGeCFCtys+0iWLgP4EojnCKdLovI2g6/j2D X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2373; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 25:VFgWmwRNGys5KFyr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sJpfqP5ECYjN61ZRgo4kDcVyYqKcTyGCLBuvbzX3LCg6A=; 4:oCxZ1Pv/Sa9nMrNsmzMlckiS6j4wZOAuavgWM52ztoM3cZyI2kX3QZVaPA9J+MlswQbT02egfKZy8t0vUr0l8Scdr2MDcY/h1hGPA+K6uN5EYsAzQA1XptAsjvwezuR1xvxYLu0eyrmUmIOgBDYpN0v29wp+MC6CwGN32Wx1+IbnCf9Wv0mtDfhQUAL+fJWBCHOqQmJzZffpeCJf2CuOMeebcBk67s9oQudODbNYdYumkIPRzSQmzk7ZC1M2XyykTVh9XhC1CqQWmw+nJEJzq+uZerNfqytQdlX8Nr2Bz6TX1zz7bxHViQ4JxhSmYQZl/LPUm0Hb0wdLHcgVl+uiYdeVTiVHe9q6ZX+QXroUccrfFs0EYO4qn6BXjWZEPMrprRDNdpv4ZxuTBsObEjghLZonIMszWm0M1iDT3Ww0m5pr5Y+t9wsb6gSo7jH85OKyANv0lymlv1aU/pQ9CtKPsLWdgySovRY6uPeMVRCtkPImQG32PPq/7HaYWDUrPHT2mXVrq5nN0HUf28Bd3+vUV3Rna8HhEQoqzC2/yjfszbZesjVLMP5iqNxlEz7+bkHt 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)(13024025)(5005006)(13018025)(13017025)(13015025)(8121501046)(3002001)(10201501046)(6055026); SRVR:CO2PR03MB2373; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2373; X-Forefront-PRVS: 0108A997B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2373; 23:0iGNWpvvqxMhiXNiGYo6vTk/4Vj9UBbkTbYT3jyTL?= =?us-ascii?Q?DaglqLaz0n1oDdMEC4QC59sZ6rMGbAPLWpyDMrfgetK6O4kLOC+uZBPwQUKU?= =?us-ascii?Q?gBndMLlD4HQP2k3I3+HQp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Vw79HR?= =?us-ascii?Q?h9f9Ubqp6U5t6BEWeFXF9YAZwIzLAwLhz1+DW4fcWW9oyrnreXoxC7eeBcCu?= =?us-ascii?Q?H8TLp7zhmnXkgK91K23CCt5m6NcArZyjK+NuRBvPeUjOgvGJmseFtMvgG6ON?= =?us-ascii?Q?znh+AZw0DneAjffyKVwbacFazuDG39ZGBBQQIuAJy/rL/PGC02uYHp0y69Ww?= =?us-ascii?Q?ok7WBnO8txg9RFml7t/7TPAwiXU0E9ImjKRFq9duRNn89FcP2zDxC63Rd8mG?= =?us-ascii?Q?EPoVM1PKaxQqQskxvU=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 6:xcyeAhGxhbvVVw5rM5VPpVAMKB3leLazrKIKgjCH8uyUueMnUjSrIYXathmMlIY6IyEWjJ1gL9mdjEXvfCE5mbixUxpJ2eD7T2C9+ezp1PObllijwotkfjtpuKLId3t3i1lHjSDtMuX3zLxT33tY1IUrVBXw7lWWu74CAe/43WOq3nAy0ZrxH+PxnB+XDteNRv7TrilgzfO6ItCQIPYa5CL81PkEIE3UwaG8BndaLXIU/T2bGRg6a2KnqkiC7vvko1hi6q3fSExO33JOCeW4a6IpqROwkoC0KL4uq64hN/YLm8+ofuAV55OOptt+1b42; 5:uHAOYR4seAVhQxDch/DwU3OijUeHm9TnrKVib97J0G33bJtnEHlY6QLONVnNe3fffJT0NcRWI4CKMuXyUB5EqhJwVDtD6+MpHJqbeaNBqo6r+wszlaJRVVaWQEhbXLQZspFAg15+PEHacdrCysJaMciPnethvCfsdYAIresOoCZn5pr+Ps3NVd1Bfb1+icrD; 24:Gaz8G3HBw/tjtEqnGEIvpp51NRWRt/zBy3cb9KDLl5m7zHxBt+pWQZmg4IKK8gXSS2JFuNS3qeONVEvsHexeUuVAoozQm+UuFIHAc23Y6kA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 7:yMsLqEfmGyGdA/Dlzbf3j88sIF4fPNVb9Ic/E6eUF/VK3XWNDaiI6o7GdUUDv8Bxbdrkx/adOGb16yNvrywTI4e4NHXb4XSa/iwoRiLDcINyYOMDwUV+Qy+trRFmulmQFDrHtVQYEWUwoo/IYK2n3gi6V1HaBPotYoH9O4JqYqq2+Yr63AEiXw/Z91ous4uMt0RfuSFka4/5VmAR/Fyn0CyPlQJgQJjIHfSwFgicjPPg9x/FIsS9ll6LH7tRVnlMYCcyg+k2TH3EiJ3kZ7X2xII1EFmHH/fv9D9iTaWfdq7CUHk0TQQqsZrP/BZjPokdkSsGE9bTI+unkO3OTbNSBf9cTmd/H7s9nhVpb6LdkXw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2016 15:17:42.3172 (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: CO2PR03MB2373 Cc: Shreyansh Jain , thomas.monjalon@6wind.com, viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v6 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: Thu, 27 Oct 2016 15:17:47 -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 23b06a9..347e611 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