From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0058.outbound.protection.outlook.com [157.56.111.58]) by dpdk.org (Postfix) with ESMTP id EA43BC3FA for ; Wed, 22 Jun 2016 11:06:35 +0200 (CEST) Received: from BN3PR0301CA0004.namprd03.prod.outlook.com (10.160.180.142) by CO2PR03MB2375.namprd03.prod.outlook.com (10.166.93.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Wed, 22 Jun 2016 09:06:34 +0000 Received: from BL2FFO11OLC002.protection.gbl (2a01:111:f400:7c09::103) by BN3PR0301CA0004.outlook.office365.com (2a01:111:e400:4000::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Wed, 22 Jun 2016 09:06:34 +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 BL2FFO11OLC002.mail.protection.outlook.com (10.173.161.186) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Wed, 22 Jun 2016 09:06:33 +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 u5M9663g022009; Wed, 22 Jun 2016 02:06:31 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 22 Jun 2016 14:36:26 +0530 Message-ID: <1466586396-22618-8-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466586396-22618-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1466586396-22618-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131110599937272701; (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)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(2906002)(97736004)(19580395003)(36756003)(19580405001)(47776003)(81166006)(2351001)(8676002)(87936001)(33646002)(81156014)(7846002)(110136002)(189998001)(77096005)(4326007)(11100500001)(85426001)(6806005)(586003)(575784001)(2950100001)(5890100001)(50986999)(8936002)(229853001)(92566002)(86362001)(104016004)(48376002)(50226002)(68736007)(76176999)(5003940100001)(50466002)(106466001)(69596002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2375; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC002; 1:JPlUGoulDHColc2mEI9RolocHrsOazBSdUxsdHt+uxnoh+z8cCPDg9rZO/pgVtHP+WJ7z9wH63qrZEXSqHsoknLwJJHGjOU4gaj3pg043RIsSESzl74T61fQT34W2AXZYjbxvvItTraXmL+hk+1IrLbOm6UMf2pYy1TOK0WmFxFAWE57OH+7F4rkXx3BrfGxwQIA69WQB1r1nler9W48Q2A61RVNv9FahysHPuge3+Rflayajh7a6wDannQxv6X1D8fIU8MP0RvZjb3k+9jwBr5dAmXKMXf9AstWnY3QXU9UrcDTL+I2EQG3rknzhEeL6Qd9YWAXBMPCEI8pLBOgf+xsnicWEWCNwPCDCIhuPrXcXzqD0t+65yNcYZkE8KYbJILNh12Ur2dQHipv+VzNoDSQE2RvmRInqGneHwsrH8iLY9mmysibstm0reJag/nAChhHDT3sGEOMTLHChY7l8VWZQeT31qYC8fZZP0L5EwAmzJhIBbCSewkAlDDmNC26wMhZ/opFJHB5JmnSgqNX361vKC2jF7dha8F+BwtYNrBuMcuWDVE/skU1tlWb8esLwIZ0Pd2bWeZdXOUQpzrczw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: da4cc0b7-a104-4000-ab7d-08d39a7c8203 X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2375; 2:FusP1jidH/gVsyrN+X7rtGYfGmH2rt7z5GIDJS5XnX+CzxA/NHRO/kyXeDtEJGqyQLRJwenooGOU/Zp91kZsQrTCALjJr8BolPDsMPfH1SUfPqFnqr9dGrPOEjENeAreszftZnq114BNqPf06jVz5UoxMwpHCjHudUtyzKZJYWGzVybv+a7VxETDjKcKmKMc; 3:h8zQtZxVscgFpCOwSVZIGlSy9gKL1tgB12f/VD4Xt69evf2TJ4IKbUm/63HZ6BDF4txXelzr9v67MuXDbyfuQDnpTljw0GsFq0NzlIqAa6O7sYHVXh9doYnWUyLRNd2wmYAE0AlrrBEQ6Z1j59ZT0979ZPrCFFBt7IOZ6q2/CjwMK5UuJEcDlsdV0oNKcsRHg9LLSAhItbv6rnxJVxINpgoAj1Msl3HX6OJMZIrT7VE=; 25:lbZ7WKzK9DwW7LWAqbEnA+xhT/a2ITRX4op4rAECpB7cLNYJc+Em03cf649WZYX7MVGfIcs+vHHZH1lBSUFAD+1CQVaSAMKJphVXx6FY92hVDQYNS+m/orSyvCJRLLFr+4WcMXgX5MdSrsJkdBqD7KYh6zMiNKsMH4yHyYzbLjxC4qKp2Xrt2OvA75PzcGrRT7foIjrQow/kFQjAL9DS+g/2c9x6HRnWBVfvGV+YGUt2+yD5JidUf18DclgmKlPoO/4zuKlJNH0PsBJNV37b4An5rMTSe3YS5Fw1eTI+y9poPwYhnrkSNknWcXi/lhoCgV9+yjYKS264r4W/XMGkIpqMzic+X0PD80YX343ynGXEo3MVBKKRHWk60yaGJfkui4SfoZkVCxURDgcgnSYqQnHmhAyPV0j95YnAaxvr1yw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2375; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(8121501046)(5005006)(13024025)(13023025)(13015025)(13017025)(3002001)(10201501046)(6055026); SRVR:CO2PR03MB2375; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2375; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2375; 4:VJynNJ23YtWLUE09Rhmp0KjVQ9C0w2nl1JZZA1MY/Sz5uUuKH+nG/v41yWmS9Tyqt2g5H6ADO+r4lWb2zMANmXdCuBCazsPTFZ7BkU7HjKzrJ4pGZ5KikmlryGY2kZX/Zo9w4fMNi16WF+EsTVGbGU3BvwDKi8pmYw+7/NEJg9tKsbgzOr/yAH6R0pw+mRpJSLhFNRT+WsHtx5hKee+tdc5YvMTaHXDWeBgh8EPmjYISy1HkroDCS+d8ltLKsxgbb2plCPyvAvK59YvMe7foKXjVDf4e/KBaVFIgIl+n9wf27R8aHbYTwMxyIpjhlcpK1Y73ZWj0ENdeaWC67xVkMJu6k/bkXZulgf9ZOGbUPo0Je3xqDT5hJ4DlmUsymPsm2WTh/wHQbitNyU5s9eLlSTYFm7FdMN0NwLJebbswNojG1vQEnjlHVOAxd2Giv9HeKBl3c6V+m+3X88quyZm7rRwzt8mROCgaT5c2f16a4Z55KAVn65Ko81rYwsKcKU19xwbiH9F7K5ahnnShcpghkQ== X-Forefront-PRVS: 0981815F2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2375; 23:UEcHecn935EsStcw4fRRkXovSkxRwKfFdE5eOIH9G?= =?us-ascii?Q?TaxI/PyQy6yr4J0dkg6R6bV/mWCcDpH/rIq0Cq2aoLo+LGbLtd1vd0xunYos?= =?us-ascii?Q?0vcAB9W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YX1mxNeiSdlrR9GrNxXbHqG000oQO4bvF5ahcniuOToMYx4pWDm07zUTBOlvkOomnXBbtHLMoxw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2016 09:06:33.4932 (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: CO2PR03MB2375 Subject: [dpdk-dev] [PATCH v5 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: Wed, 22 Jun 2016 09:06:36 -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