From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0059.outbound.protection.outlook.com [104.47.37.59]) by dpdk.org (Postfix) with ESMTP id 054AB5939 for ; Fri, 9 Sep 2016 10:44:51 +0200 (CEST) Received: from BY2PR03CA079.namprd03.prod.outlook.com (10.141.249.52) by CY4PR03MB2440.namprd03.prod.outlook.com (10.168.163.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Fri, 9 Sep 2016 08:44:50 +0000 Received: from BN1BFFO11FD019.protection.gbl (2a01:111:f400:7c10::1:171) by BY2PR03CA079.outlook.office365.com (2a01:111:e400:2c5d::52) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Fri, 9 Sep 2016 08:44:50 +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 BN1BFFO11FD019.mail.protection.outlook.com (10.58.144.82) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 9 Sep 2016 08:44:49 +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 u898hoYv018305; Fri, 9 Sep 2016 01:44:47 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Fri, 9 Sep 2016 14:13:47 +0530 Message-ID: <1473410639-10367-4-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131178842898419810; (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)(76176999)(8666005)(189998001)(11100500001)(305945005)(586003)(19580395003)(7846002)(87936001)(104016004)(8676002)(5003940100001)(5660300001)(36756003)(77096005)(68736007)(97736004)(19580405001)(626004)(5890100001)(356003)(85426001)(2351001)(33646002)(4326007)(48376002)(110136002)(8936002)(2950100001)(106466001)(2906002)(229853001)(50986999)(50466002)(47776003)(81156014)(86362001)(81166006)(92566002)(50226002)(105606002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2440; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD019; 1:NJQE5R5eC/P27SbpgVhuAXCbMDokw/puW2ln+E9SaVM5FxXiCqnJb+T8PDUariVmmfrnxfAzGTF7HQuEoo+9+NJWdY4SFMUYUf/TqnypIFkMi4vwaOOo7mNaVES50WSEwn2STRcvlAegNnKeaGYeGGDGraOwErI0Cc9kplLpkBG2V1m/NuWiWOV8vQCfhyj4oSUclXfnRe2XpqT5s9p8VSzXTysmXbbWQ4bFAXjA0SmEJYx0OBK+6+2y/Ip00Omybt29sZ7celzVRSix+pwdl2CN06MGIJ3jPUjTdLQcrLBBOx5ivLRC4609bR6M3ZofgcZ5Cr2qcj+XaNMhJu3nYXfThinGOf8bQgjcYCwx3UqjSYhBU4p9ZIkNKSJvIXG1YgYLreRf17Qv9wrO81gzZk12nsUHw9yq5OMsn8yO9xZengSRLhnNc8Bc+a9sXwqrnUGuImFAxPz6O/gjF0uIjs7ucE0iOSOKjsha1Nwc/py/JnAvzBqwieuZEyvNvAXEHyxtMFkR4yjVdil/s3CPWTfKbgZVFNzaoMNnTq7NO0AG4FdmO7JM5CcDgmI3gF/4k4oSd/RfSX6P8DsPpSHVEJpUTkne9DIDap25gHdYSqYLHwWtHMHT4BsgG1QJicly+hd1vsJU6oqjU0AmUhU4hbrHYPE43rDPdWw0YxUI/PDfJthAuEy0g3eXdj57c4MZb5uB8Gr/yzQk/JmT0NLgBOY9WwO3AcsHxcJgcK4KBbA= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: bc34e35a-ae38-4342-6f03-08d3d88d8f76 X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2440; 2:szrpoxsZFd4rqBp7ZRC+Hb8UZ1IowQCdxyi96k2fQcb1Cy7SG4oRPgLejnBeQrSfDHysd3Cnl3bQhwlXq6kkv+bgurvFCvORNm84qZCT25TR5PrQDkWv8CQgV/ZB8F+6wcjK9wij5tqbJ2yXJ929IvC2qVcKU69co627AE6iu/oPddlDzp/xMMonvL2lySFz; 3:h4SGXOQ1NL+uthyv7Ez6EPCT0kIQLkzQhlVN3iHT2UQ2k5Hjy07JLCONz5dcGkPnll0quVcz7oEsF36aROAQLs688vEJjbOFZZBNSnB08vGF9s+JgeDv/wXnByvGYt11L7CoZjCt6QncpakJlDSZOWkOLbeAX4qvGpVeVghGHP27qB+aWLzR+Vz02L0xzF59TNIILHv7Vzlt+zitjr61VAFKSdLA/FLNVKO7SE4hiJY=; 25:kdQp7+VqGbkUBfRSSsw9r+z92htJyhT334nop8yMGLFlY/CyZB5zcMprAsZeFi9RoDExCnnKGrkQMzQsvAXFb4NuOhzlSbpLJ+mXMKG2kk9ezM7QX8WfRlwl5EZXS2EgdOt2kBa/VTYEgFqef8EL7PJQ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T4CI8gl9kNC0TffHnOyhWFuRVhCcVZ+qs+Dpj1rzO4GB8Wr4xfcOj4NhH50mZF760= 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)(13015025)(13017025)(13023025)(13024025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY4PR03MB2440; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2440; X-Forefront-PRVS: 00603B7EEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2440; 23:APcvah7QLqHYnWUh6bQ2Ozac9qNbTvZUA0pGvMsxW?= =?us-ascii?Q?jJmqIqVtDs/wVf+AowvJSEA6a7TwwwZh9Yttn5hPE9//j6pxDn5CFuSeOE2J?= =?us-ascii?Q?A4Qz7hm6pTPRafaH1cZ9+8fPM2SowxceQwT1XBQ4WVmbPDnZT7XLvLyc30K/?= =?us-ascii?Q?7SPhVvNxlGmyaIX8u/5/dIMXbBhRfNqkKCclL4Jqt+LR8phzh1NvTg3ZgLp8?= =?us-ascii?Q?U6Jtzw97QElwam+2fvanGyjwF4a/sUyTZJSuGYvvD8ocgXy5Gk/srUNRySxW?= =?us-ascii?Q?HL17IWj3FHDEi3m1ro2Lwl+r9J8sg275fpHduffdpgvS/jKqtuYynsgtNWoO?= =?us-ascii?Q?RfwitWm2lmlYw+yJUKFOPxQyYkBlm0PfzVuJytuFwH5ALsFOtnphSB9v1HOY?= =?us-ascii?Q?J8QyAGdfVSWafF1la7W1njNDJoYrIVTzLO3k1c8C4xgXYHh/3jTh5dW/xbEG?= =?us-ascii?Q?GUxQN8GqVLc4MFZGIYqYag1SInEg5cVCYK1r5Wq/Kdfcmtm/Eok9WJ1hTE4X?= =?us-ascii?Q?34N5QTQJviR5X3gErvJFEQdV1KQRMk/Oyv29m8/EHGYd5fANlXlAE8allNxX?= =?us-ascii?Q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r+H1xmeMULP4PB3kHdbOPKz1IDUzMpdnVAGQxa5XNJ3vHRI/A=; 5:dE9mTwo+d2Rqf+t+sX7d3canoOM12CTqRHOcXwTa/0Y5tLtfjlMgMYI3fJ9id9EYvMH9nX45gHlUNf9ST2MjMrMY+0ZRn0n97EC7O2VY9F0fBPQ7aU92phcOg1WoF4Uv2BJYL0T84oXbDmwvp3f8OkdHSwAdFiW5KzBwrmg2gtI=; 24:VWhmbMJ4A68UoXhGPlpulPtrey8kX/hzDgFF/FSgOIqBinmYGwsA8BbvvfYpLBjJpqylmf3DSU5i3bc4+5C12wM+D1xVaGu52EdBQFt9Qa8=; 7:mq2vq3lD3wMXuMiZoZa2LkEzLhx1PEo60q7VLFXPsQjygPvsGW55Ihm0oJ0WyjL7Bz/x+y0vGSZQ2LzXUc0QAYL+epZJHtvV7QhxKSMiyhvA177jDvCDaQHdTfZhGKhl71G2K4PLu3OC8kxc+3oMZOx0OuDS+xW6ui++NOtms7t7DgyqqRq/mGTdSJq+LwJO1JQI+9QrhJ+sZOTWyNAq4E1diFqrp1BjcUe3Kb20LMrgm7JpykTwm5oGhZylPRav SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2016 08:44:49.6391 (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: CY4PR03MB2440 Subject: [dpdk-dev] [PATCH v3 03/15] 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: Fri, 09 Sep 2016 08:44:51 -0000 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 cda8009..de38848 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -169,7 +169,9 @@ DPDK_16.11 { rte_eal_dev_attach; rte_eal_dev_detach; soc_driver_list; + soc_device_list rte_eal_soc_register; rte_eal_soc_unregister; + rte_eal_soc_dump; } 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 16c5a1b..c6f98eb 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 66c1258..b9d1932 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -175,7 +175,9 @@ DPDK_16.11 { rte_eal_vdrv_register; rte_eal_vdrv_unregister; soc_driver_list; + soc_device_list; rte_eal_soc_register; rte_eal_soc_unregister; + rte_eal_soc_dump; } DPDK_16.07; -- 2.7.4