From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0054.outbound.protection.outlook.com [65.55.169.54]) by dpdk.org (Postfix) with ESMTP id C15B3C70A for ; Thu, 16 Jun 2016 16:06:54 +0200 (CEST) Received: from BY2PR03CA003.namprd03.prod.outlook.com (10.255.93.20) by CO2PR03MB2376.namprd03.prod.outlook.com (10.166.93.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Thu, 16 Jun 2016 14:06:53 +0000 Received: from BL2FFO11FD052.protection.gbl (10.255.93.4) by BY2PR03CA003.outlook.office365.com (10.255.93.20) with Microsoft SMTP Server (TLS) id 15.1.497.12 via Frontend Transport; Thu, 16 Jun 2016 14:06:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nxp.com; 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 BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Thu, 16 Jun 2016 14:06:52 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u5GE6Xo8026530; Thu, 16 Jun 2016 07:06:50 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Thu, 16 Jun 2016 19:36:41 +0530 Message-ID: <1466086011-11920-8-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131105596130966314; (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)(1109001)(1110001)(339900001)(189002)(199003)(86362001)(356003)(5003940100001)(36756003)(229853001)(6806005)(2906002)(33646002)(104016004)(76176999)(11100500001)(2351001)(5008740100001)(586003)(47776003)(50466002)(81156014)(8676002)(48376002)(19580395003)(5890100001)(50986999)(19580405001)(92566002)(97736004)(105606002)(81166006)(8936002)(85426001)(2950100001)(50226002)(77096005)(106466001)(4326007)(110136002)(189998001)(87936001)(68736007)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2376; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD052; 1:JjrBNhFEaDJkGquveYKvgaoKtEv1CZBzsezO6UauGBpDznPBkKk1RqePxR3SjfLeDWpshjdcMhrdKLcHzlne6RYRGldfZanTYmTw3AgLYoWQaNnBabfEmlzQAqll54RXuqMaqRW1GMghLc4HXohem88PQvrz/YdigBpFxa57tjAUZSpz5f+4gFjP4PBeBp8F3cUjRFaePY9iAKghlVkbQBeqhrk4kBheqCM1R5AGilp/6IwlfH6v6ci6WYfARUfD/nhxdXeYu79lCUD3u6cATyWmuvf3R7u9GgN0NNcLN600b6/uAbvMBhXYEYUW+k3Kyd+1GHk/KpFG1ZRDbmaQTGkOp/iyMvjsVw5NfRWBR/0JURir8TkH1Nboj7mRvXxI7Ng6Gh4ASTNtIt2jqYdDliEqBoDIVlZUMyAQLIBOS5b3m+l3/Z6JU7r5ULjJ6DW1IzVCz7Ul6j0U3YHWQNRughrKWlsuo1k+Bi6c+X0Gp4k6MkDthpkJxV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yNeg5O8RiPnFfrE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2376; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13015025)(8121501046)(13024025)(13018025)(13023025)(13017025)(10201501046)(3002001)(6055026); SRVR:CO2PR03MB2376; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2376; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2376; 4:OylF6C8CR2LGQA3z8lPg+Z8Jq7zSwRwm+cfHdKCJl64oJyJniAmDSK/kTiW0MgsObSgIYsi6Qb9M0cTOHrUC3l8nessIDeRd00HSBAH0D2kIwpTNWkOmUiTqjafXyR3BOr5JVHEKg1J+RoX3WjgZxi/xx2UxsDVnuYNDAGnFmIPc/2l7hPJv59AdO99avAyd5xLvv73fIyT8EDQvilGnHmzEAKKZRj/EWTqJNbx1yRCo025GMbyc88kVZ6wqFv5dAZGLj5Mr/5b3j5SWd2f/U5UA7oNQGdLJZJ8c6bX4k6eZiEQI8R+PeDqPvpiA4AcxrW2Y4VuO6skUpwXdaP3vseJ1NYeuE8ccc2NJJcU37qZm6CGrqj+GxJw4H8pBjcUDpXewSn4SY3FKbLG6pxIV6XAsQ2VgznSMgIYVwTkdZT/ctXCCgnUf5X9TzqScPqbm0RxZAVtxaqnn9JuAHGA354r8zuTus7YumZYV8MBZJvo= X-Forefront-PRVS: 09752BC779 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2376; 23:kWlEmTdCqEd4UfQHxfYlHfteqjjnfA6J6ttZFQcSK?= =?us-ascii?Q?egwG9vcyQb1A30qWmY6lbDa2TimzCSmVa6CkIKfWmsdAMJTabtPcrMLMLIlD?= =?us-ascii?Q?N8gNP878Fh5kTqYA8/jkO+awL6+GP/XxCNBFtrTWc/YM/EMio1EdPBaHATTQ?= =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Metadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2016 14:06:52.8626 (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: CO2PR03MB2376 Subject: [dpdk-dev] [PATCH v3 07/17] ethdev: export init/uninit common wrappers for pci drivers 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: Thu, 16 Jun 2016 14:06:55 -0000 From: David Marchand Preparing for getting rid of eth_drv, here are two wrappers that can be used by pci drivers that assume a 1 to 1 association between pci resource and upper interface. Signed-off-by: David Marchand --- lib/librte_ether/rte_ethdev.c | 14 +++++++------- lib/librte_ether/rte_ethdev.h | 13 +++++++++++++ lib/librte_ether/rte_ether_version.map | 8 ++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index e148028..d05eada 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -239,9 +239,9 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) return 0; } -static int -rte_eth_dev_init(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev) +int +rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, + struct rte_pci_device *pci_dev) { struct eth_driver *eth_drv; struct rte_eth_dev *eth_dev; @@ -293,8 +293,8 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv, return diag; } -static int -rte_eth_dev_uninit(struct rte_pci_device *pci_dev) +int +rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev) { const struct eth_driver *eth_drv; struct rte_eth_dev *eth_dev; @@ -351,8 +351,8 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev) void rte_eth_driver_register(struct eth_driver *eth_drv) { - eth_drv->pci_drv.devinit = rte_eth_dev_init; - eth_drv->pci_drv.devuninit = rte_eth_dev_uninit; + eth_drv->pci_drv.devinit = rte_eth_dev_pci_probe; + eth_drv->pci_drv.devuninit = rte_eth_dev_pci_remove; rte_eal_pci_register(ð_drv->pci_drv); } diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index e5e91e4..6deafa2 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4254,6 +4254,19 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, uint32_t mask, uint8_t en); +/** + * Wrapper for use by pci drivers as a .devinit function to attach to a ethdev + * interface. + */ +int rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, + struct rte_pci_device *pci_dev); + +/** + * Wrapper for use by pci drivers as a .devuninit function to detach a ethdev + * interface. + */ +int rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev); + #ifdef __cplusplus } #endif diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index 214ecc7..31017d4 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -132,3 +132,11 @@ DPDK_16.04 { rte_eth_tx_buffer_set_err_callback; } DPDK_2.2; + +DPDK_16.07 { + global: + + rte_eth_dev_pci_probe; + rte_eth_dev_pci_remove; + +} DPDK_16.04; -- 2.7.4