From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0063.outbound.protection.outlook.com [104.47.37.63]) by dpdk.org (Postfix) with ESMTP id 8362F91CB for ; Tue, 20 Sep 2016 14:43:13 +0200 (CEST) Received: from DM5PR03CA0018.namprd03.prod.outlook.com (10.175.104.28) by CY1PR0301MB2010.namprd03.prod.outlook.com (10.164.2.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Tue, 20 Sep 2016 12:43:12 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::138) by DM5PR03CA0018.outlook.office365.com (2603:10b6:3:118::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8 via Frontend Transport; Tue, 20 Sep 2016 12:43:12 +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 BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 20 Sep 2016 12:43:11 +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 u8KCexsp006559; Tue, 20 Sep 2016 05:43:08 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Tue, 20 Sep 2016 18:11:35 +0530 Message-ID: <1474375296-26078-24-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131188489919841087; (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)(356003)(8666005)(50226002)(5660300001)(575784001)(229853001)(50466002)(50986999)(48376002)(2351001)(626004)(86362001)(97736004)(76176999)(7846002)(92566002)(189998001)(5003940100001)(110136003)(104016004)(305945005)(19580395003)(105606002)(85426001)(47776003)(586003)(19580405001)(36756003)(68736007)(2906002)(11100500001)(106466001)(81156014)(87936001)(8676002)(33646002)(2950100001)(77096005)(81166006)(4326007)(8936002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2010; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD008; 1:jYokYMKD9sazP6Arj4Uorw+kQsmxvAW/+CWQWAKTFETxtlz39JO6DKvXBH061tgQiZ75iK6e/Q/E2UXLN38dgPf2psE5ll206ZQUbAhqn7dOxFyknCgMNeXQ7AAoVa6cvsX5ig9BuOOalw225MnKIoQTPGDT+uQY6Urpgu7ktvjyFXY6Z5J9X/NS/K0T3x610Ehep2VnnpmpfaRgYvAZMF8PBp7QVD3SwI34lkAUfNhuzTYcLfDWrM54TbDKgkXJ9Sxltzfhkst+/oguov0B4a6zmGl6haeg19BH9bLJ/feUnICyaZhnx0kRuzdPIF2eQ5I4756eciLhciiXl/Yp6lNnAUn911xX+cktafROuK9KkIA+jjVu9Gv8NMPGbrajXpai3UKOBTJI2TtaHTO9ajHleoO5zU7xhYImSuqa2dWMH5/Pi3JPS6k3odER8jdVyUXQV/cyQnUPoLRY9WU3wvr0RkAsHkr0Ogvo3iVnn+CYm3gv4Rw47tVIRVrq0L25t8FmnQa0NYcW5RWZVQJST/oMhNRDTspi9+cjmb/1IrE5kDu67N70mldx15mfqGltv4ab5p4Ld0rnHzyd/YL3dN/c4i0AsDtrpHFfyGY2c5aLApO7AH9c7MJzn35GcO77yN0EI24RkvCaJv5TbXTNZDp7SLHDRpeBCbmJg1MPuQn+AOuXxhFhDEST/e7piDtixdi8/FWyIukVr5gB2Ue2FGv5LsqNiiqvyktCnjrRxq4= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 8d4836ff-3041-4690-b837-08d3e153aeae X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 2:qJCSHeH6Fs9lPLAbDOxGwJTvrb3Q7UGSiDfRgKfdBWtcGSUiGIX2RU+FDlIeeaIiWKkredZVX+X5y2YOKchyqxDRDFP633Iu+5ZAoxFbK77gkUULdklLxOcYCC/Cf9yeyyPvBNLBcvRBSfdyrt8gbgvZTd/ABxLmAjsBAYDXUqA/8Xgu6jNlU6R1s56OexWP; 3:sGyL+QX/necA+ZB/1NhkQzArGt316STMKtw8fBeKnt9VhHH8ptt+pKolDNm/j9Dqi1Ls+vuz63HLB4Dh8AzG5aoqWPgxyXkqrL4Y4isQ5M8whMLcOB2n28PluIHmo+bSKv8bPTo61JCj96ev3sCAlxVYHUDrJoQR9M2WG6c/58hYoooFnA/E9fNszIAmCjP7zyxemTRVtQM6mN4YCPbU2VeOqB4Yt4Ih/zaym5lFUkU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2010; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 25:toee4mzOOs4lKumWo3uPZSERP4Iblrrds2xnmHL8XPrIjCY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FpEmzDp65xHIQn3Dfu2hco9Y7CbcjxfmGCAJ4IZmrG4DgODbrL53U1P9X2v7sw3SC+fLOLX9mIZ4kzoCjKLaYL+BrhWfUINuwA/VdwxGL1UApQzBVPqO8uODsmJ8xcmcVqfvq4UiyaZBtvsqN1/V9rFCoauq25XFLh6r3ElVQlI8W9mYIs/YhufPBPcpjsUE6hgYH1gEBvnTRV42X/tn9yWwtRH3a0S228b3eJBnfEVL4U8xabKsvUNUvTob5GY1xDRApkcC0ybNFZWurP8/ehBzfmadXiwPIjU2mFTJ+G5642yqsOe8JMhaFyw7t2/LrW15169m8xryOFjEJO04aWUCtuonAnS1G2RsRFdo3eYw84MRXHkv4Jx3hXDSssRr/siJ9idUqukBc8Yjy0PPFL+hqoU5McuJfrVEsQPurTYAR+GaAQgwLtI2F6ZWj0XMOfN+Rxu54Zww= 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)(13018025)(13017025)(13015025)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0301MB2010; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2010; X-Forefront-PRVS: 0071BFA85B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2010; 23:p1Qh+y2zRdRhD6XJcjcg1Pc40zRC30B+fXzv3yr?= =?us-ascii?Q?U53MWqae41noIpX3bJXEicf3hAJ2swJXj4zsPCx7sJW5m7FtHGMOozjrgdHF?= =?us-ascii?Q?H/vlPz6iRmmAiCIhPSXTTJD/RPqn/awJTAFGgJVdFfZ2c69AeHkefrE1Ykr4?= =?us-ascii?Q?4XKVWKqqTKHtcmbQyNsptOnqquNrG304CfktuGqsgirhBdytMYeTBC6p7ubk?= =?us-ascii?Q?OoDBMxIQbgGzvIyCdyCRrYyyv6rDgRaYduAYJhkH2Qg7fr31wPE9lF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DiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2016 12:43:11.6565 (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: CY1PR0301MB2010 Subject: [dpdk-dev] [PATCH v11 23/24] 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: Tue, 20 Sep 2016 12:43:14 -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