From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0077.outbound.protection.outlook.com [104.47.41.77]) by dpdk.org (Postfix) with ESMTP id 3AEA88D95 for ; Fri, 16 Sep 2016 06:33:16 +0200 (CEST) Received: from BN3PR0301CA0018.namprd03.prod.outlook.com (10.160.180.156) by MWHPR03MB2448.namprd03.prod.outlook.com (10.169.200.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10; Fri, 16 Sep 2016 04:33:14 +0000 Received: from BY2FFO11FD030.protection.gbl (2a01:111:f400:7c0c::143) by BN3PR0301CA0018.outlook.office365.com (2a01:111:e400:4000::28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10 via Frontend Transport; Fri, 16 Sep 2016 04:33:14 +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 BY2FFO11FD030.mail.protection.outlook.com (10.1.14.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:33:13 +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 u8G4Trg6029256; Thu, 15 Sep 2016 21:33:10 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:59 +0530 Message-ID: <1474000200-16705-25-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184739938416379; (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)(199003)(189002)(305945005)(50466002)(68736007)(47776003)(104016004)(50226002)(8936002)(2906002)(36756003)(5660300001)(77096005)(86362001)(586003)(81156014)(50986999)(8676002)(8666005)(76176999)(7846002)(85426001)(110136003)(87936001)(189998001)(48376002)(97736004)(11100500001)(5003940100001)(81166006)(626004)(19580395003)(19580405001)(33646002)(105606002)(2351001)(106466001)(92566002)(356003)(229853001)(2950100001)(4326007)(575784001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2448; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD030; 1:uIgYW1/zOw3aSE3+M1I4ErxE52nDLOR+8xCc0nHEtx5F+XLB5rdf9L362KK1+l5u/ook99A9NA6YhdDHDGdXnGqe+mWdmPUQbrKnr1SYY8zGV/VzslF+Fe9p5Qdgbmgy6P1kq6r2DhhhqOvTjpa7B7WmxYuxtRBu5SLTuAdt1YeUjU0eI7lKXUW7LezYzyTeeSz/HVtEZ4R4KNHEj+EaejodQdgaRqtMW6wzJ2VHKHuhmPNI0EslV78WWoloJbwTHO84Q7mg9gtbDIwlPgbvqTJRbMtIgcRhM2cTWR9/2TNXVpVBDubnuuyr/+bRcu7m5KsxUXtwCi7W5RnprxlH6+1GFlakAKmvC0MFwmAcnDHszHAbADHy43FJolRBynZi1VvH3/Pub9EuUJo15+uBZzli2CcGgQu0tIydFReNcML803kE5oMuxDy2TnyS9XmAZ1TgXypO/dlMNvyVMDxEQdv5nwzPBg4FezEGN8vfMKuwdmsdrf+tkREpkGorOewsHADRghzKKttKjogr2tHI/UxXbMElRravxj6mDnoVA0f89aVlSec6fKvOQRptMbfph4pnXLaRdngxPxsxPEUdkcv1uq4D7vojoPDr4PHrmXOV2na/tPdG3e70TzSE1BaTXDCaK32ciN2oiu9sy+lkw+p3uGa4vMJvHGTL/aHqVLwp47gC2LTFDqsRh6OEVdgeB6yq2pCil1OdQZK8qJSAla60UV0p0XIeLevckP84AUc= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1ba05835-1a7f-48a1-2bf3-08d3ddea925f X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 2:bK4RU7hczQFVbhb1TiPBv3DbFniBNP06siQkVclFzsDAuYTdvtqHGZyeSDEB48hWBbahDsC0ggkfTeR1ppBduDDqwKasUQ8it7W6zis5E9uPSD8MA1XlyUHNyYAnzcbRUJSsOp93pkxIVDsPhJaRgupar4pACV5r0Lz7AI2MD0INKeJMOpcZOWb2HVZO0iwX; 3:UbTvjImS0NZWIbOhDgRxVCEvkQ+01KHdwmGM2fdbbN5bBXSZmjsFLzqZr2Ew6SIyToxfUILn4mv0TlQRm5Q03vM0uJUWaW68cPoumZawzmYxWlHMfaxn6Y4T9m2LAqmMUwNQU/YNWkN/rKZmyJBPlVTdD/X87M1aQaU/hZ5VIKTbiky1saAzwspHGDiTfVidZaEkEfrGXoi1b3EYU1vc+3MWImU08qoXAFP31+5KLU8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2448; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 25:z6NsXFXKelSnXvKErhL0jMC7VZMYu8dlo8fsjJshR3NbIs5OKTDbi4HxZm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LzEtlKy4uTXT4ozfrd/FkhjaD2uf5GtLCvCV3fLfYSGYyb0h4uuzhLz4N/G7vITvr5gRHrz9Wl/6ZwWumHvutXdzuwZ4r8hdbSgWydV4jlAUMOzkqHGQ6WLvgPd+eYW6J1MtseY7TuuYLcJMEXkQ6qjwcbq+70QciirYxTXwJla8qLdMjKaaRmayKYcQdrfWHAwkZO4Z25M9ZhTv2Bxo6ZsTvkAPhZiV+x5t2AFQ1461OGprgfrplc/9gF5BFK16XQj0L7zOvfESUGZZRp8lTX0yVz5DdyEdc58WAFtxM6yUDvpUhzYOZD6t1Fy89dBaCe/RYTaQ4/bncKdC8NAPTsQ1jid0jxaWSko370irQbeO80lQG1uJake+mmuyDVRFodu/f1LWG7i0BgKcBoHCtqrHDTt5zr5Tomir26dtNSZR1TtwZN84ch5M= 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)(8121501046)(5005006)(13017025)(13018025)(13023025)(13024025)(10201501046)(3002001)(6055026); SRVR:MWHPR03MB2448; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2448; X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2448; 23:EayDIvUms1mXb/5JYE3NfgEYrh6DjhFy0j+0+yae/?= =?us-ascii?Q?DzNUs4DT9k/6wQxEF3EjoSR/bdsiA68OjTtEjG3yzZP/0kuA3r8fWW4HxH57?= =?us-ascii?Q?GzfWrFSFS6glWHy33eByMfzVK3vv02XKRLKHS84kYTpbU6uFFkBvNahww72k?= =?us-ascii?Q?iIEbFcEkIi2NjJKUvnmM/kuRiHfJMBwnyXtNiNOTi8qz0MFlTZhiQkkYgu6+?= =?us-ascii?Q?XQFvDwStxeT20bFBqiTL00IYF6NkwIzVwrn4nblafCFNzKeWE2MS3Mh19OBt?= =?us-ascii?Q?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/7S7XvQIQA+qnrvIV?= =?us-ascii?Q?u2/cCVwz4FM4GBvlKJoBdn6DbCev4ka6G2j?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 6:6XjOQDIt4lfBJIXpWuQpcwC6/qyzQ/a7zLJZj4a/3dlXCjhXfZhow1q5+v1aHUISBR4DYEWppCq+6iyD0i9eeYDMW0zbExfUj9ZYPWJQ1OpPjywDcABAH1KF03EerUjcJethtGgsS4Myh0IaUwzp8u8+1y9C1ovcz4smnhI+FBJQcmVrdXPFHLcGlkIN9/wPq7DBMMIy+msUmpe0zNwiTnMSbtGRr8Rd/BQ2WIeDJJzXyMY5T3znVjepqmrE0iyf0/09wGWcZJNuW5LQVJPT7xwkA/gyOYqJovMNatzxsHM=; 5:5OoRO0k/u8LPVP+4Rac5g6Vac6HQ2oMrzuSzD3fX9oQGW+afe77v8vSVGvxsubc9G1ZyeZOThX0kxVYF3LVP9lhKpViFCG7PVNOKGFw3BK8WhKXuvI7Z86lK6KXmay2t2PLNHHbtumUNVXebSr3RgDM65jbKEYDShqEzILsR+9k=; 24:6D1TTm+jrjt3c9XxpwC5grkOOZ+If99/WwbBA/f983zBT1g+0Q7QN8/AnRULV4uKxMjABr2bsN11shNaDN7BjObFuW7uvIoybkQJ0ct+HcM=; 7:xColCnMOh1Sr1TMnJCoSNTR4tskmXRiEfQlwIeouVAf+pt4ZbCFPqLz6Kj9bwZ2L1tuj9LLQqRFm1Hkc6PKMtXqItbW92XofTa+X8wyZc2ylQpQHwBGqchwGwOam1y4LxjPuO4SMGJI1SdmULtnuRosVqOKJ3z66M8iBURWhFIUFpCKur6qBVeGbNJNGBhi10O0tYZ75OTqqMRUg1SBky53FCuEY9AwgD+1BYbIgyH7QM6VtZ3ihDaQTOSURRqj1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:33:13.5296 (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: MWHPR03MB2448 Subject: [dpdk-dev] [PATCH v10 24/25] eal: introduce generalized RTE device 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, 16 Sep 2016 04:33:16 -0000 From: Jan Viktorin Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- lib/librte_eal/common/eal_common_dev.c | 13 +++++++++++++ lib/librte_eal/common/include/rte_dev.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index afa33fa..d1f0ad8 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -48,6 +48,9 @@ /** Global list of device drivers. */ static struct rte_driver_list dev_driver_list = TAILQ_HEAD_INITIALIZER(dev_driver_list); +/** Global list of device drivers. */ +static struct rte_device_list dev_device_list = + TAILQ_HEAD_INITIALIZER(dev_device_list); /* register a driver */ void @@ -63,6 +66,16 @@ rte_eal_driver_unregister(struct rte_driver *driver) TAILQ_REMOVE(&dev_driver_list, driver, next); } +void rte_eal_device_insert(struct rte_device *dev) +{ + TAILQ_INSERT_TAIL(&dev_device_list, dev, next); +} + +void rte_eal_device_remove(struct rte_device *dev) +{ + TAILQ_REMOVE(&dev_device_list, dev, next); +} + int rte_eal_dev_init(void) { diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 5c314bf..d159991 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -111,6 +111,37 @@ struct rte_mem_resource { /** Double linked list of device drivers. */ TAILQ_HEAD(rte_driver_list, rte_driver); +/** Double linked list of devices. */ +TAILQ_HEAD(rte_device_list, rte_device); + +/* Forward declaration */ +struct rte_driver; + +/** + * A structure describing a generic device. + */ +struct rte_device { + TAILQ_ENTRY(rte_device) next; /**< Next device */ + struct rte_driver *driver; /**< Associated driver */ + int numa_node; /**< NUMA node connection */ + struct rte_devargs *devargs; /**< Device user arguments */ +}; + +/** + * Insert a device detected by a bus scanning. + * + * @param dev + * A pointer to a rte_device structure describing the detected device. + */ +void rte_eal_device_insert(struct rte_device *dev); + +/** + * Remove a device (e.g. when being unplugged). + * + * @param dev + * A pointer to a rte_device structure describing the device to be removed. + */ +void rte_eal_device_remove(struct rte_device *dev); /** * A structure describing a device driver. -- 2.7.4