From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0044.outbound.protection.outlook.com [104.47.38.44]) by dpdk.org (Postfix) with ESMTP id 0A170593A for ; Mon, 1 Aug 2016 12:45:10 +0200 (CEST) Received: from BLUPR0301CA0016.namprd03.prod.outlook.com (10.162.113.154) by BY2PR0301MB2054.namprd03.prod.outlook.com (10.163.196.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Mon, 1 Aug 2016 10:45:08 +0000 Received: from BY2FFO11OLC008.protection.gbl (2a01:111:f400:7c0c::168) by BLUPR0301CA0016.outlook.office365.com (2a01:111:e400:5259::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15 via Frontend Transport; Mon, 1 Aug 2016 10:45:07 +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 BY2FFO11OLC008.mail.protection.outlook.com (10.1.14.255) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.549.5 via Frontend Transport; Mon, 1 Aug 2016 10:45:07 +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 u71Aibjn018422; Mon, 1 Aug 2016 03:45:05 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Mon, 1 Aug 2016 16:15:22 +0530 Message-ID: <1470048332-27318-8-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131145219080882475; (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)(1109001)(1110001)(339900001)(199003)(189002)(36756003)(575784001)(77096005)(86362001)(97736004)(68736007)(356003)(104016004)(4326007)(586003)(5890100001)(8676002)(81156014)(19580395003)(92566002)(19580405001)(7846002)(105606002)(305945005)(2351001)(229853001)(8936002)(2950100001)(2906002)(87936001)(110136002)(33646002)(50986999)(85426001)(5003940100001)(47776003)(50466002)(50226002)(11100500001)(189998001)(81166006)(106466001)(48376002)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2054; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC008; 1:vIR6lZ8aLGUqa6WNJZV5b8P4I7G9reyqWdqXElCoaRsLPUTjZvXWzW/gADS66Yw/mDjwUvDLu69nTt2fbqYbgNf/feUCNHyIzU9H0tTUgvIan7ziOVdLgJb69tDgi7ilPBHY67FpOuqW9c3Op13AfgLFm1u8r0jlTgln/UkSB2gJaoiqX0jfOaBWkSel0kU3d40GUxjTIaydfz9eVyP0EeRXF/1XWK+G+tton2BhT95iTfj5rRoHx5O+LqmS+GHgmf+azaiQ7PXagCm1aLi9cYpNI4InePvlR4xJuhQ5/lq8T6//u9T/XebkQIVhCn0Mf34HJBUa2tdQ0TngTBmNRLaTxWI+NyuABINpA+8+vfw/8+8M+yzvGy4UJXRrF89ArD4r1G+lJ93poi2CCl4WAddpSg3uQeh5NiraBEeb2Ko/OZQ0aImCi6t4noUEpFDFgiq6Sv5E9o106cj7Cv8Iz8Mc2H5wn8i/0d5v91GtZO+CNzysNaqZoyfi9L20uVg4Jr+0RcyUKrDA8lLo/tHucUPJtEMjk3yfRd9jHrU7dwkhfQItrirMtfjPUDP+2G+2Qlzl+9UF3nRXnHyFaxZrdjWYjVISfnr4qGj6OKFOzHKPQwEQb+gaDCvJnWlRtVqZ MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: db7895fe-16eb-44aa-892b-08d3b9f8e7c5 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2054; 2:Phnumgw31UY5qZ8s7s7AjYRQV1vTmIorSDuxe6UWxzSvFY2lCMHM51winz67atPGDAxOb1We9EJh9w/D3VEmQ+d1ps1NoKGcbFbY/L2fVUQclhahb9Tu64RnHVmOyc5f7Gmgn4bNF0NklbYCvnhV1X6jTCQ+AgwM43q02MdxvSzsZtmooNni1sMRmmoVOa5d; 3:y6FPrHEs6O1de6zpDloyOAjMllX29FZh05XvatVn4kc33uwpShzAtLTpRbq01YZyUNdOTTNPTjmJt6kNvAZIUCV58uMDB0GO4oI+RXVbnsDTjagx9oxw4gwukHmeBHo00wK6dvBYVGm8bdaoaAtN6UrMgoz/NSlxNhdMDOPyW3Th67asYXB81FWqJRgRfoqPTfKLtVXSuJK9udJBMvqU4hYKIrquWbCkJ0TA2I/7myg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2054; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2054; 25:LZPvKVTpwbO+pbNntqwaP32kaE8NzV3+n6jgyk+hQPNTsW+0GMVVGVlA3C38kQjc5GcTszDD4h0v0Oih2Hpe9ZcpizgPArhPKuPL3GlGyXv5iT4MTTRTZa4bXtpJPjaALmUDxziTRLidltLLrSp+JWt99uZkDxcbV4gtagBoR3dlhCrVMsAUzBhy0bfCr2E2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mwYy0Kzq0CHs6T5fBaqdj+RTAKSkTNql4jLxv0WiLF0ScpVYOJC3vmPDkgBZGMbuCf+upFKVYEu8DpNU/6wxwMoHIG4+OYMIUGJjTNRbLdTNvpigwzsM5rj3xuA6sFWD/wVgHwg15HIxEdJHwCTAQf6HQUYdSt83hEbTPANWtIhQMY7aSKJRwb5lzZwrhNE99sleUR6gUbEyeuIbnw/SYkKAmC637YZeOqwLHCI+2e/ckyGcvdwSOH4c9hTJxMarVTC+K9N7zM1TS2Ir6Fa9wQtGDRtUzYM5BfpKOs0PYJ27dyNmoK39WSYwmakY+A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13015025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB2054; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2054; X-Forefront-PRVS: 0021920B5A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2054; 23:ARN6CizNJSz7x8DSqnewM/7UpTF3M8bJQFvN3NK?= =?us-ascii?Q?cnzHCy6JJYyGGUXiz6dOC0Lz7dQiS7qpooIRTrUzQmPqZJdr5Zj+q1SmosA9?= =?us-ascii?Q?4MSNk3ur2ec0J7rKeUId/dijUZ/rDjh/o/A+q7mmNMfn1sh7IyYcB18JG6BK?= =?us-ascii?Q?9jOV6+P1r6bRqQBivw6qW+XMniIKEwTduEDH5XiLlxMNxDBEmgcM+QJUBv8G?= =?us-ascii?Q?O/dv8AUVAeCBpSFjc5PhmRSMZ/+7SPj8iDqQr0eG8tebWPCH+T5Qvf2wjvyM?= =?us-ascii?Q?35yXpyYI7fBu7IL1ZHltmChSG2CaCM8NcXQxVIX9H9Jc/NzWo679JsLD0y1s?= =?us-ascii?Q?Zh/tAQI3fS5cw4mE1PTixGc2L4D5hxbZwEPm+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q43wAPqqviAl2cBiGjhozdqbBsMHfuHNIv9p6wocOI+ZYkhj4cWIaqDQoVoTU+M6O2M77Qg7qXwoxpF/TjO+JE6fRi2YaJQd4wcsUhdRLG/rZQxEmNLgm1LXmmSRWE8uFGS/7GBaoxL48ZMlo4zDjKXzbqONDWUALkxbx+sPY0V9Jrrg6M3ZfmSXxrjVocSIG0OkDgpQXYubDR6m1BETmG+rh+wnvPNfGQ=; 5:AzyRS3AmFz3N6mYk9paprQRthsutAFwEGWe3bHn0BbPWMn2J8+lBn2rMkTOT5F/FTntfpX/dLEa0KkUM2PzzWL6gVUM4FIvTPdxqN7t51N361kDeO05V1Ksyw8oWWqOaBQGIdp7x3cpikEaFEvPJZp41ArkzdPoZZN0a0QxhVCo=; 24:WZ5Ok37Mzl1n2oTsTo1bH3srsBh+jTToWTuSnM/He+iVsJN7mM9HXr5k0m68tqwrQCBEoUKfZ8WIk2WXbJ2wmxFDX6BvtmByPpSXTobWHdU=; 7:WjBRE2Bmc0F2IDNNogiW8/Xlpfhbc/4ZiAgUkLJ4aam36CJrkPZZKnuACiPAH8JyqyyIvKKE3v9831EicfLtDQhNyurz+GDP4vKwmuPlestTlmHc2Ibr5CsF6lHliO1z5iLdLl7PH5xa9b3P9IClofjfusjW6zv5vJpuJTbf9c7ucVkv9VP4qBQjvXv5teFledlEmoCDwKe2s3jSM2XA0IJ9z5jQUQLc8ghxO5Y67vwcY4vf7pp4/yI+0beR1SCy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2016 10:45:07.9010 (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: BY2PR0301MB2054 Subject: [dpdk-dev] [PATCH v7 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: Mon, 01 Aug 2016 10:45:10 -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 | 9 +++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index f62a9ec..8825219 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 b0fe033..37d78bf 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4368,6 +4368,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..17e7448 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -138,4 +138,13 @@ DPDK_16.07 { rte_eth_dev_get_name_by_port; rte_eth_dev_get_port_by_name; rte_eth_xstats_get_names; + } DPDK_16.04; + +DPDK_16.11 { + global: + + rte_eth_dev_pci_probe; + rte_eth_dev_pci_remove; + +} DPDK_16.07; -- 2.7.4