From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0058.outbound.protection.outlook.com [157.56.110.58]) by dpdk.org (Postfix) with ESMTP id 7640BC134 for ; Tue, 21 Jun 2016 14:03:00 +0200 (CEST) Received: from BY2PR03CA064.namprd03.prod.outlook.com (10.141.249.37) by SN1PR0301MB1629.namprd03.prod.outlook.com (10.162.130.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Tue, 21 Jun 2016 12:02:59 +0000 Received: from BL2FFO11FD022.protection.gbl (2a01:111:f400:7c09::185) by BY2PR03CA064.outlook.office365.com (2a01:111:e400:2c5d::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8 via Frontend Transport; Tue, 21 Jun 2016 12:02:59 +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 BL2FFO11FD022.mail.protection.outlook.com (10.173.161.101) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Tue, 21 Jun 2016 12:02:58 +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 u5LC2TDO004076; Tue, 21 Jun 2016 05:02:56 -0700 From: Shreyansh Jain To: CC: , Date: Tue, 21 Jun 2016 17:32:36 +0530 Message-ID: <1466510566-9240-8-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131109841790685466; (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)(199003)(189002)(8676002)(8936002)(81166006)(81156014)(87936001)(33646002)(36756003)(50226002)(50986999)(76176999)(7846002)(6806005)(86362001)(77096005)(189998001)(2906002)(19580405001)(229853001)(2950100001)(106466001)(105606002)(50466002)(575784001)(47776003)(586003)(2351001)(104016004)(68736007)(356003)(97736004)(11100500001)(92566002)(85426001)(19580395003)(5003940100001)(5890100001)(69596002)(110136002)(4326007)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1629; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD022; 1:HdZj5B2mWeSl8vtetdNTnR1ExtBZdveInPsQuojwpmZbxL5MOXzgLhymt0/1hymXdvOZwIz+fooXXgAK160MzGc1WKobxHoowX7yErKjhjbIx3WwftafjpWJIniyAY/JHp0BmmVwCLLKw8POMYkkS8/+AziczsbCY80fyAfSklWxP5r8kmhv1Jo/MkkGQEsjVrtD2NYAR0QKo28LhzjHGT3qYDGSrhLBFCAoSQ+tqXkTzU0Wvqi2dH1faoedGtX4sr3Nm6iKJTB5y3MH/W9/b8m9Oydo54nMdPeeOruwXUhHhDIck/FSMMVK3WDXfqm5zterqO0yTMxZBZkeTNxlLQS0j0mTRnsSXTuDv4M7KbcQyEMN55M6nkNG74IG70CcPncafQMDF6vz0BHrPYSM8nCyPfh0iqfVl0nXtyNOn5IHbE+l4zfNLVfpbzUaLrsFntrs7tVR3t9YpGTXuiwmLJaQag6rn4L4JchSTiodP3TeEzS36JSAt14T0u6fgbLT/DDUO7rzUznv6ZCpM/JbEqsUZfD+BGslmsjwq7233Vc87LGtnoOXjnCwCsdYvhvqWwNHSAOyCQn5FFxHQ+EkQA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c399ae42-241e-4765-0e58-08d399cbfcf0 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 2:kLTa2FZO13WRu4VN9LYMQB+2yjGVXbgTNpxJF8YhWVtjk87tAGbld7BMn8lCjTj+Y8KfvJFCIfuAQ2jZIyUp5DohjiJQMDUTf1pg3+cmmuIWW4fiOfR856Ru5Xl+meyO2LOEvKUAlxcJc3qxIsRqquJHTPGHOPjjpFsow0l6qYc/CU34AoEciXp2BQRUq+ZU; 3:2QsQR4q0quHEUxun/bIBSzcKCqFdH33sOlLxv2uXxON/1rIrJ+87NeBscQOMlnJ7J29GctdHs9sMgfDHfMpKKbXa+LDaVZZbLmV5kml3TSuoPtc4UiKsIPMuiooWOCtRrK7aIr31vYXgxGqGb0HmbO5Bn+brTrJJxo8MBJvFuOQWs3+WrNdY9JRtukcKV7lFSA5kUzOfWv1ZNGt0Nu15M5TE+zP6HmJ4qvNC5DgDcp8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1629; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 25:jnVJ4CbrblxTfiEwsE/HKfjAx7dCH/H1gEGrnCr0KJMner96Tr7amH7+Fcj+4yNk8AvvGa/mfnTkmUTWkR4V0hSNx/HbYtn1LUnZSp+6nNXpeUpo7yO75fzRFbmgKhsUF95SkmIMd/7Z5gO/pgwHOSLJQNtH8/FlWyFQkb2mQs9eATqojYroRN7kiC6wqXrQEaIl0NgxZu3WtUjI57/kURsrUPwnKqDaZ5aM78Lkh95zNdbi0fdKYt/K+gUEK0rowaSG7Pm5fBSXEXrVOW2KlG/QF3Uc/1dUIv0HZlIFM040mZE6U7oFsEJ4rU0QVryFUOHOMrA382RnoZtASSrbgpyjU4uTS3UM6GRgRT0fLz2Xv6ZNi0xb7sfj5DzQF1iV1CWJYCPX90kXrMMZRNrC0v01GcCmBjKDwuOxC08qizk9OQv7hRpgTmp/o1Jur6UBosgqFpfA5CV4DAhN1kH3Oq+RyvHeeLe6tJGnAqnw3MQ3i+PheeZXYDRkqjVkRyRYkpKxaX3TAU2NolcxT9FUPsCcbYIAqzKnF5GDcFzxbveeeNPJc3xRTIrOmVBBYZBSGRmgN7nT2huaO6iNOQw0MwGT/38bgMJff8hFDCOHwLwB77exHAlCQ4oguQaitNCA593xjNjJU/+w8ClkXy3V0x0+/Hq6ctvf9419q4us6sdHEckqokzbkpFFe/btGsPABv3PyLAQ5Hu8GLxdslXQHGW/hnd0Ty+0piEGdCS0X3LnLFFTK8O/f5hAlDTFZc40RZ+jBKW26/G1fIj/CpQE1A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(5005006)(13024025)(13018025)(13015025)(8121501046)(10201501046)(3002001)(6055026); SRVR:SN1PR0301MB1629; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1629; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1629; 4:566TUPgKU5Z4DRHT9iR4ZlFLvb8AiLbE9BQcOP3wBvV2q4YXxoKPdrqtKEXiK/V7aNrjVMhCrQDOpe9Df9Xy+v+h8tmGOC2govhwYC8bkJQ6cYfrjCZopGUeWsGxDlYC1h1z45WdVQG1MiCp2YYOm1u0eFtgUrgS5WrrE9YGN7Agkqq32SIbi7BwNK2yVcc3ptl6Mey00WMkIt0xzRHemmfr/4hq2Iy9EPnZsfXazFUieWeX1hSdsegUlH6oGBFfOzKy1FOjlwgf8MtkTB/KYOky/40eFYq6vSYCZCdGek5y9HJLiCjpdAEkXQkfyFchq5omU6DZbzShjC39cgdF2gCC+EndNy01mL4tLLlrIJNXYDzjuPOAdhaMl52CbMGoUFESgOPfCA3+e087MF6A5j1wJM4+lGA/clsdDnGspRUX8rlfehOmgXB7ujyOl1AkZSv0usj248G4k2901bgqoUvWEHsb3T2nxq/WF95zByBWmlqM1ao+iVILIx2GoZDydh+Ycuu11qmcTuJM19lyTg== X-Forefront-PRVS: 098076C36C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1629; 23:mGoWwD7WqRRX3AT1Si2sLODGWNmTIjroAmxLCLa?= =?us-ascii?Q?Q2k4VQ8WqftaMWVfacjKeinRrVu8R/sANiOzUUcDMhgEpJ4qvY8GnTDrZlYC?= =?us-ascii?Q?upbVjheCxeCQOP6jqPZgCla/VG+ebS0f+aiemBUqqSdYlJsudIsTtaG6qclV?= =?us-ascii?Q?K7KLaWsBIlHYCvuD8p+qo4BocBdO40O5sLO4BsretzwWr6VDbYESVzdIawwW?= =?us-ascii?Q?Ar/6/r6DNmEFSYmz8Na6lLMcdgxsbjtDNYakIn5qVedLMW9LBimV6hRkk8OV?= =?us-ascii?Q?IeEVWVDBSKI41opjLOlbaM+ZTbQ37+eMCJrn3Kgjb8jMwVvmOkx/b1w89SB7?= =?us-ascii?Q?ASVN4oXVw/3D8mENR7vZ5c6lGVR3hPHmU1XF7Uk2FLTh+OkJyWRHgLOvKKz/?= =?us-ascii?Q?zbvgK8r4E4Cy+jI9fGaNdMPKJo0v3l5oSbjDj6balH9CVl/JeD0EfTnfjZ8S?= =?us-ascii?Q?I3al72tw5DbGfTOjgowp5jCjbmfPjgs3QbLEkgPNG116fM+I5eg3sCRMvi/G?= =?us-ascii?Q?8CaKU/SQdlPJ19ZTiPdJNBeNCRi1vOqJxKGZJlmucCCzYG1FTqskGZ2oC0tN?= =?us-ascii?Q?jfPY1sz4bYbdNUYd4vg/xZIg0xFpT8FB858y0H25LslIYbWFZrMMS5q/HuiD?= =?us-ascii?Q?Z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Not8J/RRRCKjGmivVIPwK5szBtxpQU+oQU0MVI44vgTEpCgXMMO97ZP/GlCmEQcXGKGWy3YP76bQr9Y/VUSF+aQd+5laba17R+bBD6Q=; 24:Vjo1gM/56jALSJAEny3jcTntstL63+ODHZy/ErAJv0h5xgSTThGr7YKoq21DuoZXV8Cfb4kRvboK0vieqZV5JRfltPPZah27iOS7UMlApro=; 7:utKL/IpkvGvayT9b8cpZzPwyw3LHeSBM+2DeI1r6XwIpaXrZ+03usSOzjsAphYXe09IgP8B1kHencgucEx0DDT8ZFtphAM+Pu9oYx+kj0vskrf5bQ6dP6TA9jpqQIgMiXy4hKjd6Aqi4Ji/4R+43Ji6ebq6WkeWdX/ovFqKGGe/RzZe1zXQehdywmZoDQO/006za01WX/Yo0Ll6xaKN1D0zhpwdZIZiOdt7tQmPoe/aoAcff9Yw8IU8F34qE1G5y SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 12:02:58.8345 (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: SN1PR0301MB1629 Subject: [dpdk-dev] [PATCH v4 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, 21 Jun 2016 12:03:01 -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 42aaef7..312c42c 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 bd93bf6..2249466 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -4354,6 +4354,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 97ed0b0..cf4581c 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -140,4 +140,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