From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0086.outbound.protection.outlook.com [104.47.40.86]) by dpdk.org (Postfix) with ESMTP id 9905858C3 for ; Fri, 16 Dec 2016 14:09:11 +0100 (CET) Received: from CY1PR03CA0013.namprd03.prod.outlook.com (10.174.128.23) by BN6PR03MB2467.namprd03.prod.outlook.com (10.168.223.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Fri, 16 Dec 2016 13:09:10 +0000 Received: from BN1AFFO11FD046.protection.gbl (2a01:111:f400:7c10::144) by CY1PR03CA0013.outlook.office365.com (2603:10b6:600::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8 via Frontend Transport; Fri, 16 Dec 2016 13:09:09 +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 BN1AFFO11FD046.mail.protection.outlook.com (10.58.53.61) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.771.7 via Frontend Transport; Fri, 16 Dec 2016 13:09:08 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:814; Count:10 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uBGD8BtH028345; Fri, 16 Dec 2016 06:09:05 -0700 From: Shreyansh Jain To: , CC: , , , Shreyansh Jain Date: Fri, 16 Dec 2016 18:40:47 +0530 Message-ID: <1481893853-31790-7-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com> References: <1481636232-2300-1-git-send-email-shreyansh.jain@nxp.com> <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131263673491704996; (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)(336005)(7916002)(39450400003)(39400400002)(39410400002)(39840400002)(39860400002)(39380400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(5003940100001)(68736007)(50466002)(189998001)(38730400001)(77096006)(4326007)(5660300001)(5001770100001)(85426001)(97736004)(36756003)(8666005)(356003)(86362001)(92566002)(33646002)(6666003)(81166006)(8676002)(47776003)(81156014)(8936002)(104016004)(48376002)(2950100002)(50226002)(50986999)(2906002)(76176999)(626004)(105606002)(305945005)(106466001)(7059030)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2467; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD046; 1:NyM2UAT74HjjuS8C/MwK8o+xmPbBvxSCbhsAyZNAZs3JZPO+tUCPwpq/i0jqX38be6PadTrP7/nIRCqDkYMZMdrDuTixQbBuOGbo5ZXdt6pkEI+zVvQkLBkCtIcb4qukhe/kKq0xltGg83kcvEkq673FSUwK/CrETzykdwX50sG4VDZwRLF7naYAmyH0chUdTF0fiI6z/OLuUNLZEhvbRAdyR3YP4IVH1Vv18BYyvUFah/LITmPFVTVoPoMO6Aoi9aDqgGH2uRs1iFtja9SkBZxoycDNJxksab9nXXaxqeNRBRMmhtE7xek2fb9QMCNiQr3M2uZPfE5BVr0nxQ/FpDIisg4dlCuQaVuaGIxWkc44YycwRJUp4O0PMY49taknt4RX9QM806NaoPCFKWLVZ93PBRk59a9FTEX7azvwpZ2w1/uYq5uWZ15CLc5guNQw+yM8DyTMvduWA+rBnLXQICVBxIrZXeRaeloPpCPBGr4k2C/7sjva0a1S0/TzX8ADKbyk4KJHIqOdrLk5jqAN/4Kb5HEDiVCOA22kkR150fPEAyl+b9YGCLjS10dEvCDDknrjVj6xiXXY4feMieuIDvvoziamtK1IfsbG1u2czdDabVM0DyvND/eOTTRKFoocTA8MKhFLDv2wEWKqlhp8C4nDoS3s138+lvYyQ5etLhyQ+HGFfLGXAg3Nf57MpavvJE+zP0aM0IWILnLz8uA8fgWaIZfnp59An+ulJEPUR/Kwm11xgmm1rLMZof2Z4imJ3SSOvezuqZj7Oq/qyQ+whQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: d3fcf6ad-2c3b-449f-6b09-08d425b4b8d7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2467; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 3:xJBfga47mYW30NXPOZoq6L5V3Yhm0G4SCmXyo8S1v/wb7x+LPI09iUTFw+HB0QwGIiOL0lJSBY+fRmgqHURHK7INzP984R5Wl4kJL5X19qzjK1YJAwezDOPPgveioqaLt5Uu9txfQAbCvjJKlu4KtJUpuuMQBMOHkITsMu3pvTSU47VOY/3kXkFf+UeTvyRLt5WczJ/ihBs03u4+DUbc8S0vaAs+G39NSGUcmW6VCFA6B7d/24bHQ9k07Yir5tgTHvmlfffVpwHck7HaoW1yC5DlpRgps+rzEf4XggTxiqEHjR7z+OKNw8Uv5XnOussTeESiyVTNRolVpQJpiYLDZ4QO9Q0FGJ3ttVNsF95vLUEa8jT665VbqLLulCa2HkKI; 25:Qbs8t/2l8pvh4hJT1MOWqA1lOzrdOlVzxdEqccwk5M9jd8h3pQ9rNPfU84ZQeoDQJrFx2yl+r+irXhqCwBLC9iaiQPld720Mn4JmBbj7OscQe6ZjkAw1sxzLPnsnBfpkX3KGMLn6BjfxBe+ZaWLYUl+ISRm+y6ff8+zPpnQAw6yFKPF9O7W/+YXsy8aXGuvjWttmKJ5sVLcuZQ9fTfHp+GCej1LoTBz0noP4FOgsF/feokMwg/eW109VGCYm5mLyzen3aIqZOiSYrHegE1X29TDKRI8ppgRPgdbcgNwvx6/YfsuTcxG5jnRyrQTnsHB238N3ssHvU8zGvy8xvwKd0qY9lbgFIdd4SS3vi7IYB9RnGQRx9PqSBaF5OVLu1OpNl6ShTtQYbyg64vs2qGlW7PKyt6aTXo1i5rwShltplwFcUr49aHDNaBqtKpVJmZNHyEesCbNZr55Gu0GGkFWxew== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 31:QRB6bkfg/02aEC+TtMF3KQULqIYMnbJjjr25SERRnCwH7/Mj0CvlfriXpoBpeYXXOZP8Dp1cw5OVd54OVQDanTI9snovzNZXODYEGJASTZ8rV9On8YPudSRNUcsnLzhFATkyVNOe1veZ/f8L5rGvKgrhZFjJe9HQfYycOHHDmMm8ZaP0cbSwqcUQCZxEd6iTTk99Lg0hmqk70UFByzl/H7pweRi1wBjums+JNVudO4n8fyWaD++69r/jRViyemUWN9HraAgH0Fjif/+LeW5YGA== 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)(5005006)(13018025)(8121501046)(13024025)(13015025)(13023025)(13017025)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123559025)(20161123561025)(20161123563025)(20161123565025); SRVR:BN6PR03MB2467; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2467; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 4:+iSX9OVjLsN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WcnyWRP0WHTICSpdDQdOoIa3UPPY27Waj3s+LJx/mR3Czo?= =?us-ascii?Q?Vosid9gMsL0yLDVla1AGAG0yY2oEXgcSl00hKhlCb22RMtotlXgybhszNWQn?= =?us-ascii?Q?vZRART2BUYqNDTn8KAhZJoRkE9y+f3ULQudmD+gzzqGElR9xSrXRM3JoJB9M?= =?us-ascii?Q?WXqqdDGKiXWD/Td+CovbBGT8W470uueA6bO7spQ?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 6:MrSYvx/acnkh5r8Z/hfPpmqP/MzyEUDBrnieHPzzGQDl9Hdx7oGC3KF2QRNS9W4B57T36PQeHzhQyMViZyUr4krkAEZvzI0Lq6FQvwzLpyfL3S2MsxuvQZAQHSu/u/Gvpl/N9AFzMkjKjA5CVsn8pVOTFoT5abDlu08TyETL4Gh+K3soL/fDu6X/YCynVitvOkiKQJ4rBV8etLA2U/j+K0LL61CMx2WsQoB2dLq6QatfJfV64sBHKZI9bzJQKI2BwPHhW4gc5amSwzRWeeLn3UulAnP5hZBYvBy/gl0nZ9D8y7nPegaC72JfWlGoluwi+Ifh0P3ZwasXWHODslp1pbBwOKdBObwwY1XDKx7b0jMrABnQp0HrMMte4E/uXiX8crCiVhcS2n36O0t+DNnBxPOhleVLrW8iG3OXn9gRZkqV7UO2HGSYeWE0M1Xv/lil; 5:tYUBKl4iErKZa+IKsgCQnJ4p6uIYAcWQ4xLUfBnQXQUr0UV+YN4bUYfIBEpL4dRAO8kCigd9FWU6zAXQisZqpS8OwFrFGQyHouDWuQ+jo7cFKRBVw3WbzzImz3UVEoKenmfnNUS9z4naHRcXpuCjUhCCfqM77JnP+7/SE3Ki7nVYlx0W/1uFr0BCaHqsCEL4; 24:6aXbcn62Fszq6xut2JeYy6CrI++V5245+5PkANe0kj0snGl22gSO3p7RMyDju4+4TZfGCOUurLob9x30rA9xKEg19aOp6mHC+Z6kofGuels= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2467; 7:X6+B2UrS2nxvmI2YbCJ3TiuBxpekERweHOSnfKNzx4rCquhbqFPG5fuzruLSR1o6yX7P4o8Pnt7vPzVX74CWBR/wN5AS+M7g4mF9Hutuk7rg+G0r3V98T6WvLj8tUK+JW3B67brGGLz4XRxi9KCyMGgQpERDXuUmyBWZYu6iuJ7XL4orhHWgHdcqkbSil6s18t8928+ysCiM1pM8vfsDrryKO5mr5SYlZ2eH5E8HWTJgVQnlKaDqpX7O66ILXO9GP0IR9x7EdaYialyTyMkbiLCD5na2I7rtRKR3lCHKTy/4TrzL2F82OepOjftzhYThJvBn+nr74QTclpuwa02t5eVojEgwJ/osWKLAMViKFl7Ki5pIFQ9pn8Fn8HSKFC4tIHarVEZszWLqxI6a8IfmQuMArNvQbNda4c6gmlpnUZp1KHoOl5Ad4e/l9E+mZbA1ZKEu47d38fbHspXp2LVmCg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2016 13:09:08.6398 (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: BN6PR03MB2467 Subject: [dpdk-dev] [PATCH v3 06/12] eal: add probe and remove support for rte_driver 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: Fri, 16 Dec 2016 13:09:13 -0000 rte_driver now supports probe and remove. These would be used for generic device type (PCI, etc) probe and remove. Signed-off-by: Shreyansh Jain --- lib/librte_eal/common/include/rte_dev.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 4004f9a..7d2ab16 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -145,6 +145,16 @@ void rte_eal_device_insert(struct rte_device *dev); void rte_eal_device_remove(struct rte_device *dev); /** + * Initialisation function for the driver called during probing. + */ +typedef int (driver_probe_t)(struct rte_driver *, struct rte_device *); + +/** + * Uninitialisation function for the driver called during hotplugging. + */ +typedef int (driver_remove_t)(struct rte_device *); + +/** * A structure describing a device driver. */ struct rte_driver { @@ -152,6 +162,8 @@ struct rte_driver { struct rte_bus *bus; /**< Bus serviced by this driver */ const char *name; /**< Driver name. */ const char *alias; /**< Driver alias. */ + driver_probe_t *probe; /**< Probe the device */ + driver_remove_t *remove; /**< Remove/hotplugging the device */ }; /** -- 2.7.4