From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0040.outbound.protection.outlook.com [104.47.41.40]) by dpdk.org (Postfix) with ESMTP id C9E223796 for ; Tue, 12 Jul 2016 08:01:20 +0200 (CEST) Received: from DM2PR03CA0003.namprd03.prod.outlook.com (10.141.96.13) by CY1PR0301MB1996.namprd03.prod.outlook.com (10.164.2.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16; Tue, 12 Jul 2016 06:01:19 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::115) by DM2PR03CA0003.outlook.office365.com (2a01:111:e400:2428::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14 via Frontend Transport; Tue, 12 Jul 2016 06:01:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; 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 BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Tue, 12 Jul 2016 06:01:18 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u6C60qWf006202; Mon, 11 Jul 2016 23:01:16 -0700 From: Shreyansh Jain To: CC: , , Date: Tue, 12 Jul 2016 11:31:12 +0530 Message-ID: <1468303282-2806-8-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131127768788278475; (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)(189002)(199003)(305945005)(6806005)(8676002)(104016004)(36756003)(2906002)(68736007)(92566002)(81166006)(77096005)(7846002)(5003940100001)(5890100001)(356003)(87936001)(19580395003)(19580405001)(586003)(2950100001)(4326007)(11100500001)(85426001)(229853001)(50986999)(33646002)(105606002)(76176999)(189998001)(97736004)(2351001)(110136002)(86362001)(106466001)(47776003)(81156014)(50226002)(48376002)(50466002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB1996; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD007; 1:fUjUrXZwfgXJ8lrqV4ruXPhEAstQzuDv+Tun1LET1NYxxqIX7xkhmNbA+EXgZgK5FiA7rKLmSnSXMBautnRPJkZlsE2kcI/NmvABh8zO0ly4Nc8OYZEHGu5p5+cYjPIltl/C4xfAIHeKdsSr1BsICjv9jQ2B7//QFbjspG/jQ3XjgWEQmfliTFHi0JwGV2Fe9qZwVv0j8/HlRH3CCPx6Xo5jLAJngkb0aJLKVCFWscbbAp2UB1JhSb2s4kDF6gxMIB9YwLiEL2+nuFGttnHrFnn8oeIs4ohAWkWjCeIk+LionNZmjjqCXyO2S4+vIjtiznPm3q0uu9ISeDxUgrpil3MzliRc0eqzdXCHs2u1fXewIGZiSc46Cjjeuxmys7TnufDvG8w1OP6tGliu+X4nSXkfDId9kpM1O8hDSvT7eVu07kPtsRRYl7ajgqm1nNMQF+TYLuBF1/zc0iJ+bjEMvqG0nsArqd/dKZ9CyHQzICFtpPzkPIwpMeoOoe8x0FB+8Pb/xOwzxk5W7QEgOuETYhyY1xsv3o00M+nOBNAniesg1tMtwov2kc2jk5vcSr6o6ih6nMEzv6HP5Sx0DX3BlrTiv02gyCkc6QricSDeENgFoM6JLGWim0zC8w+ZTXid MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3b5fbdfd-0c39-4740-3b6a-08d3aa19f145 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1996; 2:RS5AYsNpV7BNQ/TXBWrmwBm25nsB/BEAqAsdWyOhnXjmy2n2N9cdjMZmkscQmI6XCd0XISOyXXdk2UqP63Rj8iF8y/TAYTYwbMSu1P87MLHd6EUhXKCN8s7omgfwATajOrpWrcaXKN7KfcIZMC7z0KnBmHDfcSCvcUIU9qLsVNyLQhXcEzCe1eZ45gelpLnx; 3:YfQR0V00lxp4etzJbSZygIRr6718McEKsfv+WxP3KlI/06BF6Yi5JHuIX3ur/3DUiH7lXwC5bu8/w3mSmEJ9M5ebPLe5v6pKVNtXA802fhCYt+LsbsyDkRjrBgNKorignr4cn+CKYJXqKUg/rVzEbkcbXIiMz1f5XI1FH19ywNYgvCvgnYc+LIPUxd03lcR9G+TgM9p8GpBPk8fx22lgy0Nz+uxuwCIxbK5C4I0z/fA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1996; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1996; 25:OYJ2t4PPsgdANSIGxrRYP3enhVKzgmf7YZ35KXLsxyzwti4DAXZG8U3p1V/rNq1VZp18gyqS3bGo5Z3B73J+yA4UGNHxUKOIEPR7F7d113s2BPDfJh4V3chTJZx6GKBDNLUldQqA/U2A4OT2jlRbf0o0qyTVjkyP9bi2swK3g9Q653y6BfFcrsDqmFThNeiAMtKBfuw+x6l+ofYftK6vzd5qZHJ9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uP1d/9kFVu+JcRFMpQEb0k5UNZPohWBS7rSSuF5HRHflx1hWgiIgOOxu/s77Z1N0u7qcxUIfEESzTxk/z7Tz7uPFmYKpO3j1bVZQzmWvfjPRgwWDqQK9KPls1+h3uXEDEd4YTC3JOW5D9ECOUxwgr5WXae/DK1VstXP5V6khtK0r6tpWVMgGt/BQikKFe7NQ7sQ5D3zqiCPztU0DgpAYLJq3q8kdgmCCmBgkLUOdG3H1gSAagzXTVNAB8lsovbjEx5g7f3dinWUEO7K3ZdRem6qmedlMl5w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13018025)(13024025)(13017025)(13023025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:CY1PR0301MB1996; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB1996; X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1996; 23:J0MgWhQ7UM/X8rxggddDLgyq5oQSjvmXPPnL3Yx?= =?us-ascii?Q?x0drehWSsqj0hbPMtk74kJE4TaLhzWcaX/O0NJqx3lb9UxYtYSxoSxbaYvNz?= =?us-ascii?Q?Nc16eOahbcO7D/7J9KKjppZAFcI19CXSs0cZbz1n+QDBmt66wOSD2DfF2JOT?= =?us-ascii?Q?iXVBreq2pD9PZUv8QQ13lGjH2s7EK48LWCUB2oEcWUkWQm8PlDq1DZK6f1qs?= =?us-ascii?Q?gFt2AZ1sKS6OrsbY5drRoGS0/baKN8hmXBZ69rPehlicpmEDxLk6adD+tENF?= =?us-ascii?Q?3aDHnueS8VeAfWDuBB2ORqlusI5b3XxfCDrNBToJHbuv1mhuUeuRhIR+H5uR?= =?us-ascii?Q?7KRWdTL4eGPOf0LxkO4w/2jmgBGKypAtfkou0INEQwpSBjR1ooSSpoPkfLC2?= =?us-ascii?Q?mc31TaEdkFTU9jzcchJbyi9qnHyidty3r5NQ6DVCeaUNC8MxbVINvH1ET3OX?= =?us-ascii?Q?iGTqMjQ9qAu8x36/0qGgz6cirpBuNkHCEMpVpf1Tghh6cjllVWCjSEUA+s+h?= =?us-ascii?Q?UcuMVJxGlh1PZ6GY+XPVQg0kyEloe5XqICt8qTRqW4QdD6JJaO2aXzay5eVi?= =?us-ascii?Q?YMaclxiWtJoyllBAgwbi8P35IDgKb3DqC2dk8uZRR1nUl3AHl242hTHl/S5+?= =?us-ascii?Q?vUNzi9MF4uidP3w4L+yYGZsThiW0pMlYBuYmG4wcLjlS8sH1jdUrATy05xCi?= =?us-ascii?Q?jbL7klGudR5ICmhWKj9Ywg1fVmowQeJKwMlu6on6Kv6YS26rlOZBsWiq6CSz?= =?us-ascii?Q?QIGbEHL+OawVcMFVoqHTOldWozcVRUmw77WJoODW4th/T/pXAXlHSYu5hAbe?= =?us-ascii?Q?WznKrTEpAXZwLIl3zsteo7i3t/PagKYXLEpO25rwfeCiO1cPMbKKN4uz4IrS?= =?us-ascii?Q?l3TnshmpfOQECwBGAzkH2E/+agLB09+kI2BQecIPhF1NDH6FaAID4xs9U5pR?= =?us-ascii?Q?WDS5a7QL+9wDCj8iqvtsQz9ltHq/g/cMdGG7v9goAN4n16sJ+AgWj08kYNaJ?= =?us-ascii?Q?UCnRZpz6ngSDgBE9jT3W+YAniDohQ9eW4wHknuvmmv+h9VV9lBZaVj99scaN?= =?us-ascii?Q?rJZKECeG69wDUPGn1rgaa6gIU3lLiUvJKQnwzLsP29jU8UehggbVY0JfoKtY?= =?us-ascii?Q?Gm2CEfw04PQCNVtFEn/go13RzXIo1gwUV?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1996; 6:HccQCieFQUAzT4TDL73p6YtWLhkwc7fOgoU6R1gOsGQL7VE/IV8McsXpF/bnvle12fBwQlIzWJo0Z1VArZ4RD8PzVfj4ZExifIQ3sIEtGy6A9RCh2X9Ls5cCtKeRnVlcsPHrybXP23CDeyNgVCJxpq8VJ493+Qc5gNpH42sxw7TkOfVrL/FgCVNePJ19LbQb7qYiR7TBbnjfEDLhULMp8ZcGae5fFFmIlt20ZjkgFvEmayLzfMLOoIYXBAdlrMKUkV8E3j2+aOoN5E08JhEZi8PIdrJ7W0wWTGSzbyaCDlE=; 5:8X20GuztHuQ7JPZEG8ejNpylNHtUbMBMnxBc0Sh92P3XBgwu150Zu9PFsEnaPUTQ9LzhZbepfvslMuUzcLMbeWobSa7Iu7JiUyI2zndH2xaHTAjicL9NrkYbC4JnpB36l1ykI+MdM+Avylmyo98bbAGnAdl4UVuA7nPzwNRnp+4=; 24:ueZRaE4CvLsQ1ZLLR2F+q9ynTDgaKey4Hd0MxvyIMoyZnw0hifkDWBxLPpddATxlTzpzrfhxpBRFkYv6/dltFBm2K07jVhwaN5GhHS8n5Bg=; 7:XvsKS5yn7kCHhDyI+WOcry4V+wQzJT8D8zYI8str+bAbqll2EZ02GrjoOdJwHQL1V/3k5zhROC9Pi8ZAQs+cb/Pm0GUNk5mu+VfqswHyeUPleE7fUoJsf1+NGLB3MhTVZemi05bdKPdsFbEJueAEZUkqo9YroyasKWGjLBY7Nmu/sA9m8ioXABMAULQjCRiLXDAihk7yILzzFcp6el+frCuoU0lX6I1eyWwonKLu15zelbnENXI6hwhnv0M7dPgU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 06:01:18.6250 (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: CY1PR0301MB1996 Subject: [dpdk-dev] [PATCH v6 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: Tue, 12 Jul 2016 06:01:21 -0000 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 Signed-off-by: Shreyansh Jain --- lib/librte_ether/rte_ethdev.c | 14 +++++++------- lib/librte_ether/rte_ethdev.h | 13 +++++++++++++ lib/librte_ether/rte_ether_version.map | 3 +++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0a6e3f1..25eb032 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -245,9 +245,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; @@ -299,8 +299,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; @@ -357,8 +357,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 4dac364..a2ec9d1 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4369,6 +4369,19 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); int rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +/** + * 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 45ddf44..c5ef869 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -138,4 +138,7 @@ DPDK_16.07 { rte_eth_dev_get_name_by_port; rte_eth_dev_get_port_by_name; rte_eth_xstats_get_names; + rte_eth_dev_pci_probe; + rte_eth_dev_pci_remove; + } DPDK_16.04; -- 2.7.4