From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id 4F54CF614 for ; Mon, 26 Dec 2016 14:21:24 +0100 (CET) Received: from DM2PR03CA0035.namprd03.prod.outlook.com (10.141.96.34) by MWHPR03MB2477.namprd03.prod.outlook.com (10.169.200.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Mon, 26 Dec 2016 13:21:23 +0000 Received: from BN1AFFO11FD041.protection.gbl (2a01:111:f400:7c10::138) by DM2PR03CA0035.outlook.office365.com (2a01:111:e400:2428::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11 via Frontend Transport; Mon, 26 Dec 2016 13:21:23 +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 BN1AFFO11FD041.mail.protection.outlook.com (10.58.52.252) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 26 Dec 2016 13:21:22 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBQDKVCV029786; Mon, 26 Dec 2016 06:21:19 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Mon, 26 Dec 2016 18:53:58 +0530 Message-ID: <1482758645-23057-6-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131272320829315542; (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)(336005)(39860400002)(39380400002)(39850400002)(39400400002)(39450400003)(39410400002)(39840400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(4326007)(626004)(97736004)(69596002)(5660300001)(2906002)(92566002)(8936002)(50226002)(104016004)(189998001)(50986999)(76176999)(50466002)(356003)(305945005)(48376002)(81156014)(81166006)(8676002)(110136003)(68736007)(47776003)(85426001)(106466001)(36756003)(38730400001)(2351001)(77096006)(8656002)(105606002)(6666003)(33646002)(6916009)(86362001)(5003940100001)(2950100002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2477; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD041; 1:6q99fushe0xqhBDgquYJ340YFj6sJb+Ut129vMjh75kqakmFK/yKk3Y4kkW9n5lJxc7LsSD/65Tv04K2Ll7+Teg3U6H8lnxclpXn0rw5PFiVZuqvzith7Kl0tblg2WVKQJ4yzU2sPORjs3+vQxl3ucFjcTzSoT3Zi0c/TJJRixSb6EwE6KIFSEhyOzDQ2wJu0+gFO125kQIyqLMYB6oMsGe55LkXHZ0dRD8fXtFF68yNblvyYniFq6hHHhR8YdXnVz375jJEuXsA19IOfLybpShsi4kK4GTEuwL1eWzQpnO+hO/+rQk0yHTFHU4YkN/LpslZCyVkrIrzB/3Nsh/OV6Z9TCT8vEHJXkRDK6jDV7VBZj2xcN+YE/BmyytpEJtPXSSQS/A3HcyPtMkxO2MGLkIe4VRpxJVUo3agnipiMwRkdtZ0UvzmirtW4hhVayeb2Ljkqtv7YGmw9hq4Y2gXvNx/YglGlkssY4rXEVmHNbSptANf6rX4+LRvuNODCdDGGrpdlnuFm2r4tsi/iotVbIozWyx0PlkJU0WepprRi5sWqMUov6/NvTvTsDZLNI0UmFrJeAQu3k8BfCBivbAM+gfkuJCRkWXyHikpBVZCi60P+OPe5Dnye26W3E1KgI+OVKokWfyBEDbAYehRWMHHaEi32G7MnNucNA7AerXeC8Vvnk44itataQzcmP5byNadKo+kiLZY9ppPhRjw5lg52otueWetqll9b9wqUK/1yCY= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c9faba25-5143-462b-ed88-08d42d921640 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 3:gFcam+iRr3vVIKT1/OqxmKxF1gdNRKXKxAzy3Q4UJctOFbZkG9NbIAW9T53mGDsPcKrnU1Db+dztUGwvewDmNJ94yCLAHumll9kvjqqT0zWp9FBYbr7A9M+DzOWHu2Bv9ecTNjlz9N61Q+YaHa4AM+w5UgmX1Db1OglxKEDU+73+vp0U9jD7ieRhIYW1n+XAl06dTkvPR8+O9LqB+CqUEeK4dVCZ8JkGaDBI1iiKG2Paw/IDZ/9IVs95/LA8tbvOO3tbQ8v6ibCrWAXaXIVwV8p723caVuQvnwI+ShCN3b0goDmYqeJvE3z45DSk4y6RVKe6AShXrG/ggtzzw7juCq2steevtlmXvYJ9YzFUS7vF4F5D2aW9jR//CIhMDlBn; 25:7Ib+0kWqsNxVmYlKBGOeHWAFzCLx6K5c4qZR0yXCljsFDMInMxbHt1vf4ctekxtMKN7U2BvrBc1TG51ACFjXpFBqhPHguQYKekWTCmp1ETj+qLVJZD23W3uYE/Qbaxfr5nOJvZe14tqi6DzJis6xpI08gDraK65UwPz5cXAd20ksITAeEJz2sQzvUjsCNFipjvVjBMMYefLrXYdeZ0Nq/YVhWCqJc8LCTnsVD+tTzdZKE7GDtWGn+13avVD6SoQz/g/f+ERc6fvhxbNCVk6WAly5PZH0syM2goAJSU5+76o4NYsFBGaLhWP+0J+ZGIbC684qy2jlcNzsLAGW5iJTBquGtxbhCdJcIiB2xVcfv96U4B12zGQUQ07FRg1JRtqIbhcxpbaZJZSL940e9IHeQGGSZYUXfKR9JGqkf/aKXI91hmedABcgDX0PD1No5uGtwMbCP71Pk5WbLkghf9+2xQ== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 31:ZWuyhOFxmfwrtwDh+Z40B2XdcEHUNJx6EwqkyuXhwu21dC4gpudJ7sgtmV4B2uYhoj2tOm2aXKAzDFPOueodZyc72IWZrgetjiilKrMdD8AH5UvIuHdfcwz2px38zcWvxbe+rTERtElI+mkrbG1aMTj/ksDMIyPAellpAUqvq2jBKFWXAI0GbO2Bn4L/CKu+KXXm0oqBW7HszWt7VZe9sNbtyuK8UgR1twXSWUWB+2QNP+LTZzQXvEHFUO6UdOnoBWIvxY9pabaaDyWb0e9j0w== 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)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123565025)(20161123563025); SRVR:MWHPR03MB2477; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 4:haQcPHxdsYoVRDgw0rD+OoBn4cWvfRw0uGKYR0WN3TzfHNux05Hpidqj+HcpljKWJ0F0C2yjMaQ2ObWSAujy8r9/7MW9C1IwBoXt0G9Q6z926qDYU7TTA09MezLXeqZVv6C6s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lWp0FuFdEhTZro2zOWsb8atnJIGcDWpqUr0wLD8sxylf00ul5XglV9dn?= =?us-ascii?Q?A/YaXZzJk8i2dJASTjPZkmYWbAXFE6okSrvKRIT3Av6ulDzjwl6kjrbkxwlx?= =?us-ascii?Q?AMH1Ej3zhfMoForL4t/n38=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 6:TiVyNcoU0BrhWu8ORG58tHQsoEYvpzUnVBQ1sjTQC5yqCEhCDKE5AqpD9RQwSEXZVARW/4aIcKjjWYo3gusEG+ft3O9Xa0OmbRutmVuLu4SG7O7cdGdUZDSQgkoPO86rNOyO+qoQYJLZZbcR4p2FTqUa/CmGd5cNatmNeciDRZSL84KACZ2D+/Zpibx8YGM4O3CIBJGCMVepmnCLcAuALnb8jvVi0nqUyCtayRW1s8w1VLN5//7VDIXhNZOBkXBnv2CU7rFvxEAm11fTnYz9Nrn4vNu6dZUuh1ou/MLcYJzowY/P+P81AlZRMPIUGuaD1T0eZUSQT2gp4900mvq72ebq+fQaL4s360zIfCxOw4HHddBZjlV69jP03s7imCg70iAmfI6NWFt65CjhhpzOcoz/IQsZG4V8ATfPvHlckHgI0GtKYTWfGwn72eUxC5gd; 5:e+5Eihs5rB9kr1/UC8ltwvgaGdztlVKeXmdVQHNGWnDUk1FjtteCz/WI0ak2gZBIxSo2xQvAcKT66PrqcwTXm1UeB1eFAL/eEh3oqzntv7VdBdhCWzZ9iFbQ/Uq88YWZQx5PBEwCc9LVliAgWW0l7GfAws+k44yDaHh0ZFDwCCLYgtPO+8BcC4YeiJXUgoWG; 24:wBJ9z+HrUWpDaUFy0TRrqPze9DilrC61Y4tUQKoxdQbCkSrjrwaojJLUzxiXPVrK0rfSWRGZm+dUClrKCJmpDVsG4iRAxpxj0EiZ2MWE8nc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 7:9OaitxuPC/qqdMcRnEo94WLCjb2mT0V5F3C9LZpt3q3Q27bCMTPoukSn/TO8N59dJ3H4h4Wx4mxroM4wCS/UU2x8sBRf7ubYkxeEuDWIF1XccKi/RZ+u2mLqi4w2cHgl0i2hZC0I61/Sh8eXd+FgENtoSDLM+K439JzPHs0cDBnxqZprO83IqfSfok0TXEU+QpzIYKP/Ne+gHWicohw51E1rXDwLvByGotSb3WIHyOJmE90mOVy6FjeOplI6LJDFf7HB9P72lst4uvOKAm1/FtXvkqaaQe1IeUHZOskN2x6sLmcZIOPSvuUBPaQ3nllWEhczBuC9cY8GhCIhXVPdrtGLw6b/kCYqgtoIwhQevXHlJ3uooCtJOZD7fyZXHkGHfxXkG7X0hbxg4cQdtuyNuHU1nWmOqHGw5q/y3Ie266mLN04HGd8/F1eQJ1wMqFnIHa9V/nIrPVRoxK4VK7dFTw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2016 13:21:22.5415 (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: MWHPR03MB2477 Subject: [dpdk-dev] [PATCH v5 05/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: Mon, 26 Dec 2016 13:21:24 -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 8ac09e0..3a3dc9b 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