From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0072.outbound.protection.outlook.com [104.47.32.72]) by dpdk.org (Postfix) with ESMTP id 2314468F8 for ; Fri, 28 Oct 2016 14:30:47 +0200 (CEST) Received: from BN6PR03CA0062.namprd03.prod.outlook.com (10.173.137.24) by BN3PR03MB2372.namprd03.prod.outlook.com (10.166.75.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Fri, 28 Oct 2016 12:30:45 +0000 Received: from BN1AFFO11OLC003.protection.gbl (2a01:111:f400:7c10::104) by BN6PR03CA0062.outlook.office365.com (2603:10b6:404:4c::24) 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; Fri, 28 Oct 2016 12:30:45 +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 BN1AFFO11OLC003.mail.protection.outlook.com (10.58.53.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.679.5 via Frontend Transport; Fri, 28 Oct 2016 12:30:45 +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 u9SCPEMK019399; Fri, 28 Oct 2016 05:30:42 -0700 From: Shreyansh Jain To: Date: Fri, 28 Oct 2016 17:56:25 +0530 Message-ID: <1477657598-826-9-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> References: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131221314457856549; (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)(97736004)(19580395003)(19580405001)(106466001)(105606002)(626004)(7846002)(8666005)(8676002)(5660300001)(68736007)(33646002)(36756003)(189998001)(77096005)(229853001)(86362001)(2351001)(5890100001)(11100500001)(110136003)(2950100002)(305945005)(356003)(6916009)(6666003)(104016004)(85426001)(50466002)(47776003)(8936002)(87936001)(586003)(92566002)(48376002)(5003940100001)(4326007)(50986999)(76176999)(50226002)(81156014)(81166006)(2906002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2372; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC003; 1:b3MFyXueiTVmf3LNRM4ctH7UPMgAf6V9KabBnGGZJMHXjPeScwghSCRWcpN1GvkCzoQTa8+CjfDtsMqw8ZrhEewZ14WJqGXkSB6oauKqylFWERjoqzmPeHA0/lH9pGB8Rss6/b+G6KDpg/+jwuJoId8C7YP57DocjUk5TUGC1w3QA+LPkiP8Jf1rZsI+/+mTbF+ENOKcFQOF91dXC5FZZsA//vBaCG2OKpVyHGelVi0va8ctU1atDHHinspgyPdwE/L+kO6yi/w8kBVm2NrSMVqeK5WXN7Bb+2Xo+sOA0hA10G6VI2eC7L1aheqmG4lgChih1rMsWrBxxCkBdZO/gNA7HzPY+aCHJgOI1ar1+AZcsPzCW7F92oLXE+arAUD+UaJqd6TOdzp0t2/8mJNy2EwnLo7g5lJxiUUzmQLbQzEeZ0wp3djeY9aybY8+d4MOu1Gx+xBONc6tibBpm3MxmZnlpTHQiF+njUCxVVaG/Kr1G2qSYZWDfCp6doijzGMQ4G2Wo8Uggc/IymZcg/1/Ge7Ft1CCuRPY2bPyQisoWZiAoIs+Ob4Cqh0JQNH6JZzpJs0Awj38thBjxqydotKgC0rQkLEry0eZFei1GVIpjHVod8A4jIAKuaMxHky0ziqvAmWVCMI3m3aASp1atwf0Rr6K0OLLYvswjlx7fTjknvSQduSDiMB+cVhRR7ObTv3QCmgYGgBTYe6NbwdJLJOcGjGdp7boK2qZPdbCb3WxRa8= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ff1efaf8-99c1-42f6-08c6-08d3ff2e3dad X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 2:zwa+I/5H5KxHTb80+Xw9s+8K1J7aOhwv32xUPHgYOgf4REQvREXtckhZkobmWOdTX00L0sUN5VY5I0z/NWlH5DkBDCdnXQQiqXHcmFopiNkntGcIi8gUywkrWH4X3L8PpnMmmf79BAJucSGPJb2Q8IQtHhxWDj1MoHuzCX58shrKbiyB0552EPInZtV1BO1vo7o+0s3TEe+uc0NKLQ2cvw==; 3:TfQO97IdwhongHaVqhUjgF44ST5i9Sq9OfgDVQyZam2uR8QuWy1nlW3VRMxmxLPCuiC6VP3P/bRCcGejQdOdXfb4INGuEqVukcnsSPAq+8bIiGXKfNOiLc3PbU2fhyjVKQ98fozU9yz1dLO1DScGB/AiUghMsJVUSym67nxu+m9GJspzYfHEHI0h7gyafA11FdQEkMkhzq2x9R1wcHJ37kqN2RCQ40bA9Y/dP1R0bnCAy2NZMaBRG8qOO1SvBt0Y X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB2372; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 25:E74t29YfCFdOHwcpat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LPAY3aCB9Bjfk0NTgha9w==; 4:9xBM+Mc1lejcxCJqbcB+iYz/ndie1F92TVguaSAnZ4BuxgcBc37WdZZ7uXqja+QGlHZQm5fSRw6ANCStj0RrB7xrONGSJpWg3wYIFpRtDoO8w/qwiSATIFH9yYUQde0tqawBSsUClA993F4bmy3+Dmh7zYqNETvnp2i9FHCKtoUEZjsLEePp5ZfAJvuUnW55435jWTDauOGhNbyUid5YRgGRDtVSlLN60VO2mxjrl/9ilb2N783cRx1uP14HagzpbcEmFW1X50+SghtcBjWvBq2g4mopB2Pa4x0zglJjVAlPyIbqRQT7Vx8WD7VoQgjzZnNECsQwwBgDddfZ1s+3WeMZoFEhbj2CKfmwGGR8oQzD27fkyAXNgakpeEm9xafgcV0etLO8SC3CogwO4WyT1GFaDFLDV48TmKcH038MtWxkC+l+Y2Ad8I5dPaxp4C02vt7ID+6r/bO6sciPjA5F8bDnLXNP/e9B5nflJuZJICEfOarhSySRINmIkW81ThhFNhxRJUQssah/SZ1v7xcuaWvuTQiLqTVjAqGhRn1L5EC+i0O73j6Lkozyr1c/mQVE 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)(5005006)(8121501046)(13024025)(13023025)(13015025)(13018025)(13017025)(3002001)(10201501046)(6055026); SRVR:BN3PR03MB2372; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB2372; X-Forefront-PRVS: 0109D382B0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2372; 23:YfqwEaYQowZoEEiYDLfWdObYo+KXrNdCzDIlmCHuT?= =?us-ascii?Q?DJGFkuC5jiJFvEu6zdDwP9qjiw77K2S8HT+M32XcirNwKjuFqzRVkVhzDF/c?= =?us-ascii?Q?/OQTD/7PPk6+9pZCIbKiKRKwdR2pJS+g6FlJ6zOJMTc1lyUDrRrZieQ2xxPd?= =?us-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MGLhk9Hy31KIluv7SsJHDtUIdTfBaS87psAU+V/Ae/DL?= =?us-ascii?Q?bFy9HfTEuirrGVnH3SBNNj8be9mkLmn0ahN+sr+VsSzbSrYEEKFqJLqDb6np?= =?us-ascii?Q?ZbD0H7dKa+ze9/X7FDvbjr8H81cHar4QVF1DfPnvC7xCk11WEooaM8zBjLx+?= =?us-ascii?Q?eMbEs0cNIh5CaSgCKJk6vA/SJ0OKzaLvhu+B9v9JYv8n0GnOa3SWSrh2NuYI?= =?us-ascii?Q?iejM2OtVwoH6wLJe+k=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 6:eneb2HOQzrr4PZJWN7b7rGmsGbvYqG9cMVPSZyh+R8Tlhkoe0nO5L3sukCsFxabcDHSU84jmWSNj/tD9ZCoj9yvSUckr7iTeqsd/vYb1vhWh08XwqgZ6PJVHgcfrzciOwQAVO7ElUhKzYmb85UGBNv4HTsjWT/RKKRlq/xC6Is+GexxTeRHHZToR+46NO6aLZdox0NNmuNTbu4DWXu/Y4EoJ8N2g1cUmsNusg0O11hBZ3QGwc9CVlrc2maD9lPKmioqssmhtUp7MfqMtLmeOsC2IvCcGazHVK1/tsCqmXRd0CZZboRhwyq4QqXjjPS6x; 5:mykmPH6ocKERqroi5djqw8NnjK0L8CVUkejGc3q9HPSGrohUx04u5Vbs9WLHjuh4nxvyuFlCCk6OYwwg0FAECnhIlNtBbPaeyd8jbCidrOCQX+PmJwXpobiH3aebjsvnmRx7LqjJ2exs9fJl+WmNxZhczbNE2oNwxg52IdtupUCnAcp8J8tpzh6YHH+8SDPs; 24:RH3Nv9hdZLfyrv6XjOsO5fCX2l+7ipgY+e9aNiMkDAog0buhGRcS+Kpd0LiL5AZn3uWsRW7s7K3AMaURK7gjA3+QvxF9VXBMX3RdH+Y9Rgs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 7:x+17GB/x8gEZHZIo8hNikheiEQPScLCCYo/z+BRGW6gvRNmgc0nafILJeD1q8zcIPdqyqyDjKj7hfRhwoONH0vTUuMU9MJU2fpkTZtvKEnyskAs7UQQZhcfGXc8HLe7Y/g8rPk8x9fvnI0NYrcuWPjulUOJBLBpfZR4DDCZ0l3aCbjoWdgN9zYrd4eyRcdEaebZZC5i6ZCXA8QLEWT7c+PW8aIEXAx2jEaS2ZBkhjH1BtCe7CyZPb5WDo1SbwjiN9NrczDfVkQ8uV5uKb85770jHv2mcWRRwUsU+R2YXWV8wXyzfdmVL9G7038epbftNh18AIOQ3Y72WHNigGoFfoAzr1essWLnhjG50VuWaHCE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2016 12:30:45.5828 (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: BN3PR03MB2372 Cc: Shreyansh Jain , thomas.monjalon@6wind.com, viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v7 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: Fri, 28 Oct 2016 12:30:48 -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