From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr730056.outbound.protection.outlook.com [40.107.73.56]) by dpdk.org (Postfix) with ESMTP id 9112E2BF6 for ; Sun, 4 Dec 2016 11:09:20 +0100 (CET) Received: from BN6PR03CA0003.namprd03.prod.outlook.com (10.168.230.141) by DM5PR03MB2476.namprd03.prod.outlook.com (10.168.233.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Sun, 4 Dec 2016 10:09:15 +0000 Received: from BN1BFFO11FD020.protection.gbl (2a01:111:f400:7c10::1:188) by BN6PR03CA0003.outlook.office365.com (2603:10b6:404:23::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Sun, 4 Dec 2016 10:09:15 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD020.mail.protection.outlook.com (10.58.144.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Sun, 4 Dec 2016 10:09:15 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:691; Count:10 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uB4A8pKA019825; Sun, 4 Dec 2016 03:09:12 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Sun, 4 Dec 2016 15:41:21 +0530 Message-ID: <1480846288-2517-7-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480846288-2517-1-git-send-email-shreyansh.jain@nxp.com> References: <1480846288-2517-1-git-send-email-shreyansh.jain@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131253197554432756; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(336004)(189002)(199003)(110136003)(5660300001)(6666003)(97736004)(77096006)(5003940100001)(2950100002)(2351001)(47776003)(6916009)(38730400001)(76176999)(189998001)(626004)(81156014)(50466002)(104016004)(92566002)(81166006)(7846002)(8676002)(106466001)(8936002)(305945005)(48376002)(8666005)(356003)(50226002)(36756003)(105606002)(5890100001)(69596002)(50986999)(33646002)(2906002)(39380400001)(39410400001)(4326007)(68736007)(86362001)(39400400001)(575784001)(39450400002)(85426001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2476; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD020; 1:6fl90jsOdnZr7EA8L06JB4AVkcgv8YiUKT7gAFwb5uYiWsUOazSkQk2uDTYxtjNTgtsiLWDX28IvzhjTU4nv26bseBBt3vWycGI0j9Qc2XUHRgWG2Lbnuo7X1OiTOuipHBpP7pw1+NFQ9EAULZjvqfh3Qao4ZI3vBbHO6J1nyG1x6iuQgP75jIQRngHlPxoix8RJvWuTpZw0ToW0PwgDlv3V0A52kGDxezXG2h1Qo7Di/ti4Yei4V+5ZezuwMb4KADea3oR+iavWGLWC9ElqPrsqWQNCPzCpVXrG82dLEqCtiPG7A/PvYE0+9cMsCyHTr+5vcDkGPVQf1KnOGdV3EvgwIoRb1aMzCb8CpFUaCJQMs0NHdgZUzS3Jys61bTO2u9XNvf07XC+CEjy/vUmlyoIqv0Hb94TRNvnbhoDCL8EH0iss42PDvx8WtU7mwbhD2BYac/QhAHeL5edQb78vrElzH7cSseph9AFCIFF4Yq/b3p50Sl4zeX4pyMKwybE3tWMCJz3mFDwy8oeNSF/5kbQ1E0KAK075AgesopGuIx3oVztiMtpQlGSmiRgyHv7TFnXSQ0EjNTvHXWFvjiZfBY9BNr9J+/fUdBXNI1nWa3/cNVbuFbzUTIu2HEJ5ZeC+F6rgksl9qikyzJpRY3H7PF1MXPNBE3MXRvXwCjbnx54aTqb5JdFRB0BqGPBUd9oeosC2oL7WGkavyuvaEoq+O3b6PKHcJynksv1h05J2TxQ= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0ac8e5d7-210e-4a12-5994-08d41c2d9a52 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2476; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 3:ANrtSSsczFCqwxSe9KZfdH8fF5dY/sfRAAQMlFCJEDdztw+ovkNFNHZWEplGjdViP4xECEXYiQjrmaaaIro+jwa+6YZuwdVFpsmoHnOejL8MeTLvQBB+vh4dA1UBrgsanQXAERNaA6eAqpCatz1n34vy2jzlPVLYM8xLtaW8up22hJ0cZ68GAFZplgGLqbDim+KGKpcgT9ydmz4dul0Gnbngah4bASKvDLYAJVwxfDiA015mXQbIExYIJe3kIII0S8jdYiBbAGtumWsxigmfBXag1+F3/kN1o1Oh6HoBDFiTLJqbiqNM1YHZbiNloj1R9Rw5DlV8h1Om3CGov3mB8IDGKyOUGP6Z71OrOpjeJovRlIcu1GL97LOIHdyID/BH; 25:Tv9aKosUivxDM6RwxbDB5LUqKRXk6gmka1BanwRkXN4HtEdZyTfharsNQRsiYeWRi/20baxdDnANz2AUfS6zJMglRLhFPFvUmsIFv383/zyf+5W78VfDi8oxEMv+QEkWZKD7aiVKiZPH6M4Ay+X6zOOO2PzkXn3z7rCD3zXWrBMIDmwn6RcFJH+ZUmI/CmJR31JnMAif5uNew+rcKOT1+7BObuVu1dNqB7fsqGYFqTxJLFT1k3rce4KKTbXjnSD2SlB0fYBvhwpGEY9oYAYazId2U1bOW+3r4kVi5MV4trKDlUlIltpURn+qrIAr2QBMvQdKWcJwgAUVzT4z6gO5owdBar8sGPs3fhp+nv3pGcSJQ0uvGjYiBul7Oibo5IEFCgHocyGz1Lxynez8SwPDPV/KOeI/mjyzMUfcwTx6Ea3iG7Q9VBBq1EkdNnP1firQKF1gn0hapb6Ga+TeyINcGw== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 31:cMtUrqqOfaKMXLlZKwPl885aeGFnd8nshyw4sO46qtdTTVVXHP4WhennlXAnsnNDPul9+LjV+yTxNNh+cTySgXtMlfG9jAa162RjMWpeSfzJpW/miMl0IgyAMWC4z6g9TsX+qA39jweCm9czM7U28QXlZ0mQvKxhiKTJwUhOT8blGcXc7bzgpFrvfgBQ2Wjjytd3mIDVcDeCC+XIx4mWt2HLxxmFPdUTSkg0vTE/l6OnaP8v1gifDyRul1hUNcMqhDxmqwNHu/v6yJsc3kwbBw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13023025)(13015025)(13024025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123565025)(20161123559025)(20161123556025)(20161123561025); SRVR:DM5PR03MB2476; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2476; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 4:aksV6Y/UMH/jSyzXHV7OUxAuxNbOKpHJ6e648Bs3j4zPDBzcHF8YxyfYIqTMUzZKsiamxQA1AOHL9LIaWS508JMRJdc80y/ot7SRXhoFwdM2e/2aDzmVKGZiXjuARoCCbDAlflMYq20P7oo0fA2OSl2ZYve4RaJdu0K92DedZirGaffrkUj9t8kDfw7/mS5gMjWLgG/21lDCVCerXPFsR1ZKDg57pDaj8W94PHoMKlZx2xz8zGZSoX+qecYb+KRtO9Efy3XKxqph9s6UL11Kbs+xdMMr3y32GH1K9dXJFxWcLsouCQNYPOve+5E3J/Fq0zH/bVq4y2WrjkUN252Hqe4KFfKoZiSUaWma7eG2f5PxndsY4CzX7ILTk5LaWHtwj+lbBssZ8Q2frZLgMkzhzKqNyo/HH3UzLotwFyfVkkcvP0kByKXlY361R77NFE2KastB3vM8HlCwzFzcqAZQzeNXrA2lGdI4BGoPg4rzBx36hpGwgJfhQJztLdCnSugHc0VjENR3/JLK0OK0+twbYi37PUWTqbXfHrcS5dFHtWGmHNUACaTiEa75SEmOFBCdwjiVSxNgOrS36nCM2r6/FZclySRa8X1t0oeKRcRX6Xf6bvm3dB0DN1WpSgeE7F/S4QZlHAFvnnHTCUNDYREW06eVkMKk+1G6KU4pN9yMIrwOfcyMwpAz0H6ywESjbuwAFLD0rynTsJr9Tlp2soI0KvegLmHSksRN8lhZHLNn45DD6ChPjdINaLSSj0XQRPCr X-Forefront-PRVS: 014617085B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2476; 23:yV+8zXpAhg68lFl3/GBwjK0/ay8s8ggaGNUb1BBdV?= =?us-ascii?Q?GBGGTtdVPehmEL/nBl2ZjdgvAWYptzxvEA6Ks/y2lnsHQTmadpXafb7tFg02?= =?us-ascii?Q?k2wrXTTvKbV1M9x4O56GJdeZRUYikd5IbFZ+i1+GeTyZBC6hfE89sX5QHqg0?= =?us-ascii?Q?THln1b4GX2VqlyQAowdNkqLsxkB0X+C0dGilmeSPirh3sKVYEWJ9PCku4HK1?= =?us-ascii?Q?6slTHaWcjfxEuxlwOfjWHOGWeQBgiReMlpkCtrL62zIEZGkZYbbv9fvu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BKQeCdrGAdhyal1cfdFW2rC/0uglyuBSmJOlU+Q?= =?us-ascii?Q?L6rTJ2mX+IFrF1c043pLBSq7jjLeleY0m6cjL4Hr9MXi7ttDv/UQqhfNDL0H?= =?us-ascii?Q?zRghqOxZHiY2y0/p5iuqvoZVUnr167Wo06Hrw1kQqh9dyVtWsPgVW+JCja81?= =?us-ascii?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 6:qsAwGM+6SXwHLwoK9ah4bceFCvykJYatB9vmy0ZWo7U9O6HVsYVgRk0q19TselQlKOlDJThaw9c4QWlFHJVmhAi3Jjk442RTlSvc09BNT+bZRPUK4RnJwzijaM5K5quv/zo6NBcGcxsfADPLxeZ2W2DBUnkat3RiaSd6doJTzJKTW8CQoDA4+ZULx0iOXYvEDYqZPo/4XctrFxr4+6BGu7nYNxsz8ozI73qmKQZzbC7JTerr+FYj/JBjzr5MxgP6ff299Yw2RkOokWzugyhcw3FR/Hx6IwimHBcToayRlm3sHKxKg/J6HqcqrBQsjf//ALylBMTjnQ81FAvoQeVPnXCyp88Q6rxrcQ2LZoyGa+ud2mmM11K1AWLRzi/rNcayWNvwrH9iAOxz0s0tB1Qr8bNcy19NWaitCC/leZw1VhbT4V39HRnLecrSkoOK/uru; 5:RsK1q9bKu6WlOUQyliR8RdeeZK8KwN3aKdFq9cpJ8Luv5Bb2fS8IzGZGOfS//UUblxw/ri8Gw5v9eVoRXjTEHVsDjHnplZw9dQYhz7O0uQg0efmMp1qxYU8PsN/QFH1eBgTd/jCZVTbGIQTbN89gYfa0EJ4twDPFOcw24J/pwZdXNa2jqG9pA4T88AZ7tKpM; 24:I5k7P2YUD24ZSSjbTn5wdQceh8rbnSySO+zx3M82bQrDdyB5XbXZ7IYJ4Dd9pVKhNYXvPDbzJMWg84RQefw7Kh7LhitlXYSqKEAjoL71+jc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 7:Fv3y6JH+7T3EPUrVdfRhVsX06RFFKUDwMNtnkeTpi7Ma7KJ28accLpR1cGlImyTcGAbKfWnjRUrWuMVt1d47t9mnHUpBWYIWgUZv7LUHNklqd1cjd4qQkvLyQip+17+vv6d2EsIuOo59ezpIgeTaer0wtE4jrGRWBdNvGNAZEZmH8w7EL9owG27PLA3ikEQ2+7qx2dBqOQwAK99wgkce7LwYg4fMTQT6NLGc804bcYHUYwzv/iETyFIDnQDgY6j+QpSdQ7JWQTLPTRaDohVY5CPonF0e8sGLs8UoJLKnfV0mS99IAncwV0vLFYoWEe3RYyXy7fDCxQPUDMX6WS5/0FU9m314NeknrxT3HpXAjFvTYlZGQyo6Pvqp3/XgXCNJ3bCF9C4zlHgGQDBmBhG8oD6iIOzCkvp1OdBVQh1NuSpES4e4PbiJfrCBOWoQwDmqFqKN7L5RbzGmVpyeILvHrg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2016 10:09:15.1780 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2476 Subject: [dpdk-dev] [PATCH 06/13] eal: integrate bus scan and probe with EAL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 10:09:21 -0000 Still a dummy implementation as no real bus driver exists. This adds calls from EAL to bus specific scan, match functions. Once driver->probe is in place, and a bus handler has been installed, the code would become effective. Signed-off-by: Shreyansh Jain --- lib/librte_eal/bsdapp/eal/eal.c | 7 +++++++ lib/librte_eal/common/eal_common_bus.c | 30 ++++++++++++++++++++++++++++++ lib/librte_eal/common/include/rte_bus.h | 19 +++++++++++++++++++ lib/librte_eal/linuxapp/eal/eal.c | 7 +++++++ 4 files changed, 63 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 35e3117..30afc6b 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -580,6 +581,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_dev_init() < 0) rte_panic("Cannot init pmd devices\n"); + if (rte_eal_bus_scan()) + rte_panic("Cannot scan the buses for devices\n"); + RTE_LCORE_FOREACH_SLAVE(i) { /* @@ -616,6 +620,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_probe()) rte_panic("Cannot probe PCI\n"); + if (rte_eal_bus_probe()) + rte_panic("Cannot probe devices\n"); + rte_eal_mcfg_complete(); return fctret; diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c index 3be9c77..67b808b 100644 --- a/lib/librte_eal/common/eal_common_bus.c +++ b/lib/librte_eal/common/eal_common_bus.c @@ -173,6 +173,36 @@ rte_eal_bus_unregister(struct rte_bus *bus) RTE_LOG(INFO, EAL, "Unregistered [%s] bus.\n", bus->name); } +/* Scan all the buses for registering devices */ +int +rte_eal_bus_scan(void) +{ + int ret; + struct rte_bus *bus = NULL; + + TAILQ_FOREACH(bus, &rte_bus_list, next) { + ret = bus->scan(bus); + if (ret) { + RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", + bus->name); + /* TODO: Should error on a particular bus block scan + * for all others? + */ + return ret; + } + } + + return 0; +} + +/* Match driver<->device and call driver->probe() */ +int +rte_eal_bus_probe(void) +{ + /* Until driver->probe is available, this is dummy implementation */ + return 0; +} + /* dump one bus info */ static int bus_dump_one(FILE *f, struct rte_bus *bus) diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index d1bd2e8..9bd8650 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -209,6 +209,25 @@ void rte_eal_bus_unregister(struct rte_bus *bus); */ struct rte_bus *rte_eal_get_bus(const char *bus_name); +/** @internal + * Scan all the buses attached to the framework. + * + * @param void + * @return void + */ +int rte_eal_bus_scan(void); + +/** @internal + * For each device on the bus, perform a driver 'match' and call the + * driver's probe for device initialization. + * + * @param void + * @return + * 0 for successful match/probe + * !0 otherwise + */ +int rte_eal_bus_probe(void); + /** * Dump information of all the buses registered with EAL. * diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 2075282..01d0cee 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -847,6 +848,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_intr_init() < 0) rte_panic("Cannot init interrupt-handling thread\n"); + if (rte_eal_bus_scan()) + rte_panic("Cannot scan the buses for devices\n"); + RTE_LCORE_FOREACH_SLAVE(i) { /* @@ -887,6 +891,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_probe()) rte_panic("Cannot probe PCI\n"); + if (rte_eal_bus_probe()) + rte_panic("Cannot probe devices\n"); + rte_eal_mcfg_complete(); return fctret; -- 2.7.4