From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0069.outbound.protection.outlook.com [104.47.34.69]) by dpdk.org (Postfix) with ESMTP id EAA8A72FC for ; Sat, 15 Oct 2016 15:44:30 +0200 (CEST) Received: from DM2PR03CA0027.namprd03.prod.outlook.com (10.141.96.26) by BY1PR03MB1418.namprd03.prod.outlook.com (10.162.127.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Sat, 15 Oct 2016 13:44:29 +0000 Received: from BY2FFO11FD031.protection.gbl (2a01:111:f400:7c0c::157) by DM2PR03CA0027.outlook.office365.com (2a01:111:e400:2428::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12 via Frontend Transport; Sat, 15 Oct 2016 13:44: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 BY2FFO11FD031.mail.protection.outlook.com (10.1.14.196) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.669.7 via Frontend Transport; Sat, 15 Oct 2016 13:44:29 +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 u9FDhhgK021870; Sat, 15 Oct 2016 06:44:26 -0700 From: Shreyansh Jain To: CC: , , , Shreyansh Jain , Hemant Agrawal Date: Sat, 15 Oct 2016 19:14:55 +0530 Message-ID: <1476539108-13170-5-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> References: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131210126693983830; (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)(199003)(189002)(86362001)(356003)(87936001)(5660300001)(586003)(6916009)(2950100002)(105606002)(36756003)(189998001)(110136003)(6666003)(4326007)(8936002)(2351001)(50226002)(76176999)(50986999)(33646002)(229853001)(19580395003)(5890100001)(68736007)(11100500001)(104016004)(305945005)(626004)(2906002)(7846002)(97736004)(19580405001)(5003940100001)(85426001)(92566002)(8676002)(47776003)(48376002)(50466002)(8666005)(77096005)(106466001)(81156014)(81166006)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR03MB1418; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD031; 1:910CFrI9lrixflYEXe9em3mRNe+8Xz/BJtm9nBHUpDauJVEFPBQAEJK9o5lPm3lQvJF7pei29ANWgdT3VysAuzad91hKO8Lzu03pC3cSGdnIURf4qanupNfYEcwpo4LbEBYwTMVrauh+OIJNJkdCz1oft155a2spue9v8UxHHj9nvLF7PesuCaGzZNhH064KlnTqN+lq+XSC86Ft/9lSaBYYUxE6/MKMOaUmZl/MucqTK7mBOghGFkZidOQLHS44NafCOHj/x/4U93T0Zz+b6EALq06IyM/xVc42rRUAjEA+GfGdBV+mrylulbGX7tAVbwgx+UuyYF59n1eFeYTPB3n83Z9JjQeK8pobeM/JagFx1AtFOUZlFZ2+Ur5b3I8GYb6UZr/QXpIvs5CRW+lCILdC6RL/LjefRub2WAg8vA7piJRz58P8xfJQSVgBDsNMcCFTXnatjF7NLvgtYNSGtojO6w9m37qKViUVnqz5GunWD6Ke21PP8+aE95Rvv0R7f3QgkM9R9XxJI3OjoRWopAicbkN4h5OoBcBsE4EIOQ/JObtB+d1sKjxfadFog3KDwn2Hnc2YvgElhkPdg4H+9PnFp/GoJ/OcSYDtY78yotx59REh3fsSAgAH7qJuXVfLVznfl7BnpACf7iqqEKvXqC97v0rordYpJdHjHHGvybGWi6fb4CVT1xRhhjANPxDqyKjweD8jS4k8C8jXKCFktxzk2RuwlgpPz6kJyn0tuX0= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 783ac3ca-0380-428a-04f5-08d3f50162fc X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1418; 2:Di0aKOahbSyDlmS2U+Gog4r4qbSpjX/1aZkw+k4et+XJ84w8SzE6qAPldLodzoDnMvVLsw+Kj+K8H3nr/RWmafQVl8NM5fUZS+Dpe2tu1CFeTYZ9Np18cglk6SwSS06oKaK9uodNvRywdx2+zFqEPV7Cts67XiRvssMqEoFDSD4RJ5gdJu69CoDTgm48i28s56XxlhrHVWexEJ4sJKPsOg==; 3:vaKUURi2P0YUz7h8QnRrZ/k1q39cvueuRXZsAyxDw5DgysJBV+YdVgKTnX/ljuRN7i9qo775lgFl0FWBAVt6wtrDiJmdusCzFkdpUiVacsDW6kwrpQBk6flRLj93c/eoHXTkOLrT5lTgepkqDsJekrSZvWoJl8yNZaSpuAkXLe7TWCw7IbsVEbScyjowkQwWIXc+iC1VG4d69/eMI0DSdOtSzLDuWa2GzhA/tc/wFri1LGoXnNS4L+PnwwmWg9MC; 25:TmcL0Oa1AvdMz44IKW7T4eZbGM/K3Dig5vapgmmm0YANApQajlIXnmKHb+Hgp2U1cLEJxxggE/1quDDQH69A467Duhvpiu0RiCblEbMdHU5SBxfSBa7VA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VYH5b4rdl3c0PJ23scFMxzrczrDOF4oeDXemvbjn/xXdFhpJ8mJQvikNCZR5+fmruwa+oCBJJTSED8tQEdVhLALaXNU1eh+k3BJjc48qLFmPpWEWYoleSC7QyeFMfg7eat8pXyWAuGc4igXS2CXThIE0FyUztx0S2HyaTwbdqZgmP3Uk2ugT7F234zJUHe4uspmVWwxJBnk8jOGMQdXQ/TxN4QUX+OY38awlnABjTl 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)(5005006)(8121501046)(13023025)(13024025)(13018025)(13017025)(3002001)(10201501046)(6055026); SRVR:BY1PR03MB1418; BCL:0; PCL:0; RULEID:(400006); SRVR:BY1PR03MB1418; X-Forefront-PRVS: 00963989E5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR03MB1418; 23:PvYUgERZL0mPNrP1yvtc7woFBUqYIzRtnxqFnGfch?= =?us-ascii?Q?8BhpwZO18Ff8j8Jpkf0wRSioFCxy621WfgpxBnP1imZLDVRt2LRnLYdRZPi1?= =?us-ascii?Q?EZI2Bdt7FKBapOipxx3K8M91Wzlp3Bz3ykewWZFZ3POnvyueuVkbrHgsIIiw?= =?us-ascii?Q?nZaqcfcwSBuFP5zraBtSGdSZd04KdErPczngdJVgL7Unz/2AIsV7wn9gNOZn?= =?us-ascii?Q?dV6jslbKI3Ty0nRj9dN9YqEdB9desQSHTsTsNCQZGJBvvBVAfSsQXlHoHeEv?= =?us-ascii?Q?lqor3arraZfSyg32IziaBo+sfSlqtuTNzoKhRlI2p+8ACH6fsiChNTZV9cHX?= =?us-ascii?Q?iAtL8FsFSuAFidd2/JUmbiilq6MpLD1Wq7Rd6MpPOOKCQZkc6z3XCbTtljiD?= =?us-ascii?Q?skz4FkL+T07tY/3+xdC1gD8Gj9EMOnM2IAoyfCnYCBFdNHZhUBKc9s1Z477t?= =?us-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DqnttulGUMjSDGML0mE0xG66/snirC1NRIFHLrlc3PMG4aojgEIz04gegLpNjRYfFnLrpjhUBug0v4RjKEyHPQgzb2ROlyxhKuFmI2CfoVCjZ82bOKC/jkEJqym9gVx9aC+Kni/RJqZYTSJMX8lWhTwYLPp6C+7+t9myKmaNrHbTs0b3P+IfLB5rf6+/H8ZfU+A82O7jEb6YzJONMKoHcz6Qls+gN7RNS8vXw7obIYlC3B9xy1l4MLLfcOh9dJcNwunZAUh5BD/v6q; 5:eR9cmvlxG1GCTR2ZNOkaLp4T3bxR37MILgoql88WjD+qy6QcrE/MEa8kzRqGr4JKtaf/p6lreN/5hvE7ml1VyZHgWP9zIVnn06XbfJRQcyMIAVfTUNEy1w5k12cKjmZxOBtiXmUYAl9uL06iJ8fhLxuKKz/VPS847kwTtmkbMkhZ5zx74KTPIsJmjyc0CC+B; 24:3gwIVHdalOMs7dWxha8S6mlz21yBjvxu/WdlcXRturTFAlWHBIN0A7YZO0JOBom0CbG3FMyjnE7/g3jlEYy+3ij+Nd5UqMRC2AZLwo0WfPg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1418; 7:PXz46tflbRszjv88JF/XLJ+6FeDrPGQfw1uDhzgef8UAZ2a9Gyn7CygDGjZN4YKwOO2B6P/n0Dp3HBiI3gHqJFHy/3O1nZOGwPwvYXhfO3lqDJfVcNeSBumSV5uNtmHMbLnM2QW9FMBBgJ/ORmiTBkSrzytMzoNcdaiSLirsNJnEnX1qCRwtRoBtkHG2afhuu5ItuWgWi0df9yfeUVqqYFrr9e5k4trJnUHTkMLV7WlP0+EVggLFvg6ZXQFvXWJSw6Gh+hH8Zl6jYFo0sbEY7ytGxI4hS+alOjwrmhvKas7LEvxhLl2xFk429iyh51UEjyCi1naAVcwBk9TBIOa4pcnYTGWSMP5jLciibpU881Y= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2016 13:44:29.1799 (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: BY1PR03MB1418 Subject: [dpdk-dev] [PATCH v4 04/17] 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: Sat, 15 Oct 2016 13:44:31 -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