From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0068.outbound.protection.outlook.com [104.47.42.68]) by dpdk.org (Postfix) with ESMTP id 63E1A47D0 for ; Wed, 31 Aug 2016 13:01:41 +0200 (CEST) Received: from BN3PR0301CA0022.namprd03.prod.outlook.com (10.160.180.160) by DM5PR03MB2443.namprd03.prod.outlook.com (10.168.233.13) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Wed, 31 Aug 2016 11:01:39 +0000 Received: from BL2FFO11OLC001.protection.gbl (2a01:111:f400:7c09::137) by BN3PR0301CA0022.outlook.office365.com (2a01:111:e400:4000::32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Wed, 31 Aug 2016 11:01:39 +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 BL2FFO11OLC001.mail.protection.outlook.com (10.173.161.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 31 Aug 2016 11:01:40 +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 u7VB0laU010481; Wed, 31 Aug 2016 04:01:37 -0700 From: Shreyansh Jain To: CC: Shreyansh Jain , Jan Viktorin , Hemant Agrawal Date: Wed, 31 Aug 2016 16:30:24 +0530 Message-ID: <1472641235-23626-4-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472641235-23626-1-git-send-email-shreyansh.jain@nxp.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1472641235-23626-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131171149003076840; (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)(5660300001)(76176999)(626004)(19580395003)(19580405001)(48376002)(86362001)(50986999)(104016004)(97736004)(5003940100001)(106466001)(47776003)(50466002)(11100500001)(81156014)(105606002)(92566002)(36756003)(33646002)(4326007)(81166006)(68736007)(5890100001)(356003)(2950100001)(229853001)(50226002)(2351001)(189998001)(2906002)(85426001)(8676002)(586003)(110136002)(8936002)(77096005)(305945005)(7846002)(8666005)(87936001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2443; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC001; 1:7clXpTxL6vWOfWjXr8ywsJwim40/sFh5L2HyEA5cvfwV1UvcLItqNcUWTolkSnIa7UTFdVw32+8dfGfBWp2d8QOeJA13YUH7FBAhMQjwh+WwG6LPgaJAXvXiS7TOVU99lvD0Q930QpbO+nuaUDQFENc0J/RHt4vXXda9pq/jntewPRASymMk3SthvSuZ7Top/+GV/PpfiokCjfMZjJbtjqmgB2F2i97nytojIveQwflYk4guGXs6lsHtPaZgeLPiB0I+TYxpFtJEDU7Acl+CY0kCYJ0YHfWHnM7Lm3Iq/c3KBFXD9HkCPDPT1cbYR6Wa+d8g0cS8vRLA1w6beYkl3Sr7Yx+aeVN7XxFea+UJw9yDRk65VQOFduDuAEfm0hRAvS1fSqwyudbD8AlauNpa+TKhTTy8vuZq962v6oOxBZuWYsPx7RCILqYvU4USLFekS5KOTAVW8HbS1dNGIu/74IsqLcZu/nWY3mVGBymZwIsiU0ncQtMHlP//a+6cHb54wAWHaNutVjZycEIfkmwdl3kCmAEa6c3sEHBn8BdMNxrUQFRpb4hBrQGOTg2FEkNjVlNQsI8uDu57jeiETdty16NjBVw6oibrkwRtOP2nurZXlLD1Mx74E3XOYe+aML/nidl6kbfGMAsg5C7Vbr+hmTtIBFADRKw7ZCd6u5fmg0OMQsWr3InkJ4nRDNuya5fuoW4NnRam6cvUDnxM5ZI4yfHPAAiYAjIUu2w4K9uYDLQ= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 838d699f-7e3d-4fd0-b4e8-08d3d18e2f92 X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2443; 2:FwygKJHzQv97h40SSFo0KHA8hRYg9irYEQTrvtU5p/RNBF2kNekLSFVy3vZV6nP1SK812aSatj4wklPPbhXyfDHleBCyTzLXPyhoIJT1LUlTpkROVya5+/ftl98n7K2ITDU6syzNzAtOFpE+RsQ10YIcrcde/X+5fDdydeOvmrF4P0EFAeIqqXgeisWuxpcE; 3:NyDmfpCGkklgI8oikez+dio8x24a53S5gtKReJ67M2UrsJydKhXC5rHfFT6iCZ+MLX2VMjlJ0ahH2rwLLdg9QbEtO2muxoiy6zhy7et9QMpqO/f1KW1O3UtZyl2U9h+CpoTGjAPW4zr1P36o4GwvNXkPUhESFb+jn9zDKcXN3rboLGntLU97QEjr71n9UT23SxhTSgRkunSTdgJIUMgMCx3CBD7qvx6CYA78RXsvyEI=; 25:qBUuP9iKCgwBhjD8cPqdvB26abiXKJSlk/04bELBrRpDIeFOzFxUVrc4crpvyLLOjNi3Y7otqW+kB+ZIgb/hASS4p76AptFaWogs1i8uIqkWJB2sZxz0pPDRY6ndqlLEYLEOTpsfrwCOItcApDCsia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3zpT6bvGQX/fUezudrXuQxeff5T973IYzFEKDKdgw+8uS47au48zil5hHjB8Ey5rSz5x8GQEUOxLMho2KE0YH1rPs0EdVg= 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)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:DM5PR03MB2443; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2443; X-Forefront-PRVS: 00514A2FE6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2443; 23:+nTyunYd+o7oX/DOLA/29BsMVJU4A2qsVHG/i3F15?= =?us-ascii?Q?ZBvolcOgk/EeBrwlTVOkUSNhCuYS9+wCJHMBAqjD6Gg2Cl4mcfLKjn/3mOrc?= =?us-ascii?Q?SP+GrK7eMAg5wjZJ6E6k8Wki0wlfh4WgoVnb/X9z1q5Ov6mtdbsA13fNpxJ7?= =?us-ascii?Q?77Vuolv50oQEHgoUzOH1AYZJGi0xiRyxw7kw8IrcHggrUpraHnT0bcL/S93x?= =?us-ascii?Q?6QN+xF0eNZbHI9qj0/pU+mmd//QdOQnK0NVhYx/obvVLacCsrIsG7CxIfOTC?= =?us-ascii?Q?yIjznvtL150yJBhPuHKv6p64Yss6/A9eEr/sPaA6Wre2myY8FFdrQBhn5fa+?= =?us-ascii?Q?cnGRS1wJFpRbrwQBCXx3V2BKVLtBxjHZyxI/fCLzmuOLT9Pe0Xy1eh+iErZw?= =?us-ascii?Q?i6x/hwOZ61kTGsRwbwlfkAIAI0PUDQjUdRVe5ft3zArEoelMsH2tjyxx2IBn?= =?us-ascii?Q?AmH2WraPNhUX2k86Y0BjB9W/uZfKy+1cx26EGmCB7aay4IPdBqTvJbiNkIb1?= =?us-ascii?Q?o8jWCh1H4bE0uUn62pg+FkJ1NTQaNuWip7X1lXAiO5/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teUtDNW0OIMEak1NZBif/Jm1edg2iUVqMsL93uNbiUEecGKgnFrTJvphNU9tTA8mx/+Y=; 5:6LLHFTuBYG9JDk9RkADQDNvreWhxIrPC+Bo9/p+ymDj9kBU3o9r1AcM8mHRRgnILSXM7MMuLeugQUTHERwAgHc3D8t/pz6LHT2OOYyqKZGVlMxcP4zkLZamyPrN+GKs3Q8WjMkWmzVDQFcjYa9mlWni+iwJPu373oij0BQ7Pswo=; 24:4MrerrB6OY9sMpx3DKnAPGjvAIn4yC6vqqwXRHeyrK2OKhfXodfDW5paK7FMnSsNS0kT1imprncHQw+rWQbhwcDYvVaxkg8LAXepF69p5eE=; 7:ybVW2pBCrL6Z3N5zUhLDseDrJ5hpfTV7qdUismjDT2/Wj9ZWOX+Qrk+n5Z5NQ9KCbU6FhyvftDF17okOx0GKtBEk0Xp2VjB8YpnKGxVdiMK0Kz7jHOq9fq6JqxZ9gfYdox3OLSyDsHHn1TTOG5k6yvz6pqv7jsw9a1x8AcJnEigLODVmbdybCBFSvEBHCVYv8HlC9Aoj9Sp4wcxx4NimJCOFwAVr3AeCxuTLvwrSMDYBhmGYxt1GtZz0waaXXIRB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2016 11:01:40.1360 (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: DM5PR03MB2443 Subject: [dpdk-dev] [PATCH v2 03/14] 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: Wed, 31 Aug 2016 11:01:42 -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