From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0082.outbound.protection.outlook.com [207.46.100.82]) by dpdk.org (Postfix) with ESMTP id E8F8AB449 for ; Tue, 21 Jun 2016 14:02:58 +0200 (CEST) Received: from CH1PR03CA007.namprd03.prod.outlook.com (10.255.156.152) by SN2PR03MB2382.namprd03.prod.outlook.com (10.166.210.149) 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:57 +0000 Received: from BL2FFO11FD045.protection.gbl (10.255.156.132) by CH1PR03CA007.outlook.office365.com (10.255.156.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.511.8 via Frontend Transport; Tue, 21 Jun 2016 12:02:57 +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 BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Tue, 21 Jun 2016 12:02:57 +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 u5LC2TDN004076; Tue, 21 Jun 2016 05:02:54 -0700 From: Shreyansh Jain To: CC: , Date: Tue, 21 Jun 2016 17:32:35 +0530 Message-ID: <1466510566-9240-7-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: 131109841772348060; (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)(19580395003)(69596002)(47776003)(2906002)(86362001)(19580405001)(5003940100001)(85426001)(356003)(8676002)(50466002)(105606002)(229853001)(33646002)(92566002)(575784001)(87936001)(76176999)(2351001)(50986999)(81156014)(2950100001)(8936002)(189998001)(106466001)(48376002)(68736007)(6806005)(5890100001)(97736004)(586003)(11100500001)(110136002)(81166006)(50226002)(36756003)(77096005)(104016004)(4326007)(7846002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2382; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:i+1rPfL9CN2+OptXrJ4fwgzG7a5Hk2unKR4YZaMdx3TFFAdiJrv9JwlZDggSYyU6wVRO1vXAxQ0c8ucIhTS+2g4mqSMjoRJeyahjdJfLMoIVld8n62I2YGpkSk+knH0yrRTnAiCC2V6HsNaIGZgISiWvQXGn4L177hTWL3shC0SHQ9NGIQvid82mONwnvn6v5lUTaqDckAa0D2UTS5yNtGvMZr1tFERZb5iV8zRC2hoaAXI+infV8nkG+vGjH4drBm/7N1jeNG3MEATLbSsoC4H5pT52eCDVqq6uFYb+SkSGgbttf2KpJ8fWQLnY9VNxhqepek4iv51GhBBTmkGLg3PO4BdHoegcsNyT1HqDz8jljp4nb9u4Ooev1XlMSvP53bwIcvVxFse64V3d7mw9Eh2kTGSfb2WGxd31GIWxCeimZ9aNa9wk0MiCk+I4rrjjFlWTfcQyc+Lwgm2dDaOe9wTDv/XuwDiMY6DXuFhFSa0O0hSUeHbX4vEq0MUcUHBd9f/kRetISiNnTXL96/TH5Om7yIZri2PGygSlHqgfoaoCUno1bkII01apBuN9PzXiLGFpRWSzwNIbqLWC4zKLwg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ccde5bf2-fe08-4b79-a13e-08d399cbfbda X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2382; 2:sOsDq4Arj7jJhKpGhuPyFjxPhuyyaLC71/8UcI+F5PTEfqynJi1bFpPgcnWeOyDRhyPPSE67OJdNpeO8tFFacttb0CJdxDUhUIcQVIY8ymg9o7Maf31BYzK27we08E9hosEmZR/X8PfSmtk69rvS1odbMl3ngiQsuaKKjd3Saxxz5vSselJefBN5Dbjl9l5J; 3:mb0+CUEnkQAfobPGUItJULrujKACeuVx9X3q/g66whOtnu9np8a7WK5JXKFpnlR29vm1zM84uoRe6RFagFg/cbLc3s5AGb6yZhpHX7ejRy55DCqiBiq3fInP/EblV3XSe0AWUdBEL0J+7/eD64AW8MMi6oCb8g/o85sMyYZywA24OeUH8iR03hJH5wHEFXT2zinqJ75VAKUACd03Ya9mhgle7d1KEnbiyugLJYbGamE=; 25:PGDMtE7D8SVK7DOx0TqZXxH8pV9wq8l1XIxSQLr+FBiuiegjQy/cYYF80bsILwE8a+7Y1vn3xAOu4pwvfVTXaPKSjhwDSpPqmtBpdP+n/dgzXSwE7+Xk846J96J6pQFZRei9LTXXuQq7XIxzV5SYq5k8NSMCJlGP20Q4UQ8pPRQTo6Cwts6o9Hrxvz5h3ctgqqq20h9zJdREu9UtM8j8aNkZD4M8Ay2RkSuLjkt2x0orRhRH5qHW9OxY9OweE6nj/wiqY7cE9ZTLO5qaS/ThYoBrkvaOMbUxGoDI19PdCGXVkp0OMAvDNBXoOX06iaHhv1E/YvPvQDCeJUy/UgNaY81/1eNFZ465G/cYb77sz8MGeGKl/qBT+8F9vRLEQniBR8R5E5+UOGfwz2O/0IlAdvb/VxYgHrLtTsvsRcs6V7Q= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB2382; 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)(13017025)(8121501046)(5005006)(13024025)(13018025)(13015025)(3002001)(10201501046)(6055026); SRVR:SN2PR03MB2382; BCL:0; PCL:0; RULEID:(400006); SRVR:SN2PR03MB2382; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2382; 4:H6kpaXpNyKy12eGxYxYhlSNzkvMAxbTRdTFyJbls1OPBZaE3Iz0Iz0aVeElmIXLLwiPEIOWLcQOcvnSiKXa1LwjkgA2Uw02NEtjr+kGctnTakEwV0DxoAjWrxhZblD+kkCqevGkKhIk6e3/oZoPAe2C7j2mOBrM/iaul8KWGUglFiZaf78a0YsA6TCKQb8X/qTdar0sKvvZzNwuN30bacvZ+cr8/QCkZQgg8n278Rr8WpL4zKs9I0jNwJLJCwN0Zzm8wA29Ww/V5K9jbv5Tp1+OBBXvuvZ0c1/kdTB79w6cRTiR1jPMUMzu9fX5P6w+Rpy90HZvPBrLwd+MvXrYpmb96LcA+a9CG1gl1EuAbgQGpNGyko4FvwkPVaTFRZYKGNDRTlrASEAnGGFmRD6Jg6pZ+EajC3ryvS69t0qmtuWfP+IAQz8FPJ1MvH9F08kS9p9NAYUvRJsS9qa6bJhilYHGdCw8Oa9sU1BuyB/grwcKh+KM9yca1V3Z8E1rTgVxM6nfk7lmRXxoFB/DACfHnDQ== X-Forefront-PRVS: 098076C36C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2382; 23:ztMLN/KL+vvIbiPIHTlOEeD/5TG9JiZL909sH4vck?= =?us-ascii?Q?7+xZg1awt5rN0KuJzI/r2spvVvcVHSu+oLQERPzfYSJA9UflqPTNYFIS6TIV?= =?us-ascii?Q?sk8qUs5/5D8xC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vECl2CthlaWjN2Ye4weRqD++UFfMW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 12:02:57.0164 (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: SN2PR03MB2382 Subject: [dpdk-dev] [PATCH v4 06/17] crypto: 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:02:59 -0000 Preparing for getting rid of rte_cryptodev_driver, 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_cryptodev/rte_cryptodev.c | 16 ++++++++-------- lib/librte_cryptodev/rte_cryptodev_pmd.h | 12 ++++++++++++ lib/librte_cryptodev/rte_cryptodev_version.map | 8 ++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index b0d806c..65a2e29 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -340,9 +340,9 @@ rte_cryptodev_pmd_virtual_dev_init(const char *name, size_t dev_private_size, return cryptodev; } -static int -rte_cryptodev_init(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev) +int +rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, + struct rte_pci_device *pci_dev) { struct rte_cryptodev_driver *cryptodrv; struct rte_cryptodev *cryptodev; @@ -401,8 +401,8 @@ rte_cryptodev_init(struct rte_pci_driver *pci_drv, return -ENXIO; } -static int -rte_cryptodev_uninit(struct rte_pci_device *pci_dev) +int +rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev) { const struct rte_cryptodev_driver *cryptodrv; struct rte_cryptodev *cryptodev; @@ -450,15 +450,15 @@ rte_cryptodev_pmd_driver_register(struct rte_cryptodev_driver *cryptodrv, { /* Call crypto device initialization directly if device is virtual */ if (type == PMD_VDEV) - return rte_cryptodev_init((struct rte_pci_driver *)cryptodrv, + return rte_cryptodev_pci_probe((struct rte_pci_driver *)cryptodrv, NULL); /* * Register PCI driver for physical device intialisation during * PCI probing */ - cryptodrv->pci_drv.devinit = rte_cryptodev_init; - cryptodrv->pci_drv.devuninit = rte_cryptodev_uninit; + cryptodrv->pci_drv.devinit = rte_cryptodev_pci_probe; + cryptodrv->pci_drv.devuninit = rte_cryptodev_pci_remove; rte_eal_pci_register(&cryptodrv->pci_drv); diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index c977c61..3fb7c7c 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -534,6 +534,18 @@ rte_cryptodev_pmd_driver_register(struct rte_cryptodev_driver *crypto_drv, void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, enum rte_cryptodev_event_type event); +/** + * Wrapper for use by pci drivers as a .devinit function to attach to a crypto + * interface. + */ +int rte_cryptodev_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 crypto + * interface. + */ +int rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev); #ifdef __cplusplus } diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map index 41004e1..8d0edfb 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -32,3 +32,11 @@ DPDK_16.04 { local: *; }; + +DPDK_16.07 { + global: + + rte_cryptodev_pci_probe; + rte_cryptodev_pci_remove; + +} DPDK_16.04; -- 2.7.4