From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0090.outbound.protection.outlook.com [65.55.169.90]) by dpdk.org (Postfix) with ESMTP id 4AE2BC3B6 for ; Wed, 22 Jun 2016 11:06:33 +0200 (CEST) Received: from BY2PR03CA064.namprd03.prod.outlook.com (10.141.249.37) by BN3PR03MB2372.namprd03.prod.outlook.com (10.166.75.7) 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:32 +0000 Received: from BL2FFO11OLC016.protection.gbl (2a01:111:f400:7c09::139) 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; Wed, 22 Jun 2016 09:06:32 +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 BL2FFO11OLC016.mail.protection.outlook.com (10.173.160.82) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Wed, 22 Jun 2016 09:06:31 +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 u5M9663f022009; Wed, 22 Jun 2016 02:06:29 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 22 Jun 2016 14:36:25 +0530 Message-ID: <1466586396-22618-7-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: 131110599917013668; (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)(76176999)(189998001)(8936002)(110136002)(356003)(19580395003)(50986999)(5890100001)(2351001)(11100500001)(105606002)(8676002)(104016004)(2906002)(6806005)(106466001)(69596002)(229853001)(68736007)(7846002)(81156014)(81166006)(50226002)(36756003)(5003940100001)(2950100001)(77096005)(586003)(86362001)(33646002)(50466002)(48376002)(575784001)(85426001)(47776003)(4326007)(19580405001)(87936001)(92566002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2372; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC016; 1:inpzV8+L8BBqjzV+vIELNpczaptBaxDGLqPalWNYxwdfpAPTjMsNkR6EJIXIsSq3/o1guIsqoZdFlJRM2S8EJsSi+mIR/2j4uj9BqvrSk8EA/j4oxjb88QcfZzE5+MwyHFBisgohSN0axwuUiJxkM5FJmJ/35dt7qSAFTXyQuJ8L9GD5wJS7DfocwLp5o4ja/5I7EgsGxq9OHyH6TW5nBk6CoWZSjCrxtANr3x2ROWM3WGPIMGsb4sHW2YHm8etcumTW1RWxL+jm3TT6RmlNO8Ri/VVIitqfLuob+ILeFJTkLCrjc4wHD20vYPsttvViv+sPm4aYxnE1lMjxkhgD7mlpCm+LHWg/iXknaqtPD4Cvd0xoAb5U8+iEtA0JKpgA3UrfX5A2IjgvEO6/XUJgvcHzH9XcGlxDZIJf52BXCxPY7BSbYsb+yCsaE73vFZVpgCbp4hLCSETODb1JxECnEUJ7vCBdXzXjqgKpyrD6U2/fJCNyRpReftUViGTRS4IGDEsPWiPEPdWl7HeO6Gggxzn4q6sfWKkGRXSpYFHibgg6n/+H0GPtJD0CpOBxPUq3cmp8OJjieh6SxcZfR1Y8Ww== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 326d20be-7445-4e7f-2948-08d39a7c80cc X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 2:jODxfHcZE++gQbvaIUaPnEym6nJ6wIc4gdT4pNQgiATMXtVSc5BjbxzfxlTEDbEtITzBrP8i5rJd4+iTvUGLbEwJnR2Qw6BlEByYa0o+epJYEO5wQkWeCAGW+q6OSgZUrYv5Js3/IfILbvZbHxI5ytQ8fJ1as4hUS2sGq1wJ516Q25zXuuUyaYsQ69o5iITD; 3:L3UhAWxAJD/Vh7YsRrR1CLZDBus2m07TzODUzYil7IUQMRJNjVxs6k33Isn5yQ8BTNPyiD0rFnZU9o648YVaYBP2qlMbD8UHbTVfBariHOWRfUpGwD0hMoHRiDa6qFRZAIeVej4qwBEYJpbs5puPtQ3Hl0FUD8tH7QI5WHoA+gO5T41ApEehSQ1u0ANw4hNMldM7QUaQbec/eT1oDHObmSL/bfUW7Z1rjtQLdhYLYE4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB2372; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 25:gETS+Yck10URkuohlfgvonR+n9V2/oQrIVdqeNGZYwkvm4ng19eoOHdtjCfo7Vmv+/p44pxI8arA/txmzZy0tiQXbL3FEvKeHGNNvse2adeKP9ZiAe/C7tN5/cviuQnPdKKsTdaKxyZuTeYk13RtEEYEijTQ2VH7oRKJbKydbld9Upkm2Sd3xuZR/V9S8qEEGqdLOWN7cuS303lZkbSB65QAobtX1k344fLIPJGYT13/j1vW30XHUIe68QTY7d2CefLEslnSIFTdFBBttNfv6MmLhO5pPLkobxIoXHJVJsFo2jIZLBfDoX6JkbHv7D6X8/0+wqwUnxJHbO03SfjcP7ev9zf6nn1WglK96Zwu37q+3/1v9UNBwRVQ1sGRCAqT+6CWjXfy1l/01BEQxGL7po7sNSFRETplMWqHiPUCUnRDzhUmdpeBKjqolbSu2kJv3Y0MOR5A60hMD6Wowk65uDchNu5iC4XVLiXRrZTzvI/COVp5rjgi0jIrk3dVV4tzCjHtsCb7MOnfyTIHlWBOmah/+DCl/ys6NYSKNFw6rNAoC9b7L1v9JExUwSaYr6BFsT5ygNVjViHH+ngiaBv6jmEOgbLUeL64daP3oBQ3v2FfLAJzIO1jrXO79S7jHftkfvGOoINCTQJl4taF/6CRBRZpiCAdNWLwfImrscPs4kBCtdBXXrEE7xTJKKQPrAxNvRo2r8SKd+2uljka/T/lF22gkMw/yhYRKqbMhg2XZyZqxEdVd6+0r65T7YcjHeje 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)(13017025)(13024025)(13023025)(13015025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BN3PR03MB2372; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB2372; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 4:ng/ieoCCY/JCAclx9TnQsge+dPuBweGinnhAxVpMiZN5pXezEI7ohrUKL5KnuCFZAPeqSSxTXOZcn0mG6NqME3Xl+dYJKa8t0tEoZKva3GtAJA7B93PoyYR9RgycZxEEMGZqRkcTSHBtHqp92iKc86B96OKazBoMgcyqFCpXwETf4HSR+B3dIKeEe9UrUUm7drGVcoJ2kWBm24CcBpjW97IvFPsMShXRYohhjBCvIyD5KzMin68tuf151g7r44A/Fk1yGVtgXRWAh/HUjBvEz/unzr8Reqw/roCTHaEd40J/6v/vAyYW9dkTgBa+gQrMfcXFjMKJM8XhSvPiNFflTpJDgadDiw3KwV7au6ucCWYsHKv9i9ewXx2qN4dPaFhWorg53GJloJTBAe3D8TzmYwDa4zzKmoEvXO8E6IG/vkVyox49mQU1sW3unIsIUS72b4AMP0U+8+cw5/PSG5SK5EthmfBt5NPdJeLewJEjKtYLA6jXDkavzYraQ8T8mfedLvwlNzrynvdE5SAiWJyYTg== X-Forefront-PRVS: 0981815F2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2372; 23:Y5q052cVgajsTch4CABRzioyiL41ljxTxXVK9y7gz?= =?us-ascii?Q?aYewg6Cue7FO/tYXG8uOJ5ou9WLUl/9HOr+ciGnWN0MUeBInGjHlgNMeJRsg?= =?us-ascii?Q?wkFLgOeShJFm9nofc3/tgHREd4GBmKAT2CBJfv8MgW4ycRLCxnYnseMxH12T?= =?us-ascii?Q?+64+yykU2jO/fWqvM5a1uBj+ItbmKiGOlzhdUglG7kk8rF+S0wy8rsf8TeFH?= =?us-ascii?Q?hzfH6BRi/w65G2/8w6QETjhiGnyrb5KmAweQ5gyZrHHxiggzSw0hxLlHEYS4?= =?us-ascii?Q?2owiHibA0DDsBUV1b6dsWNmaZtg1tvUm+k3GfuA9aX9U3hBqSS6gP5ljYt8P?= =?us-ascii?Q?lexo4WSUEqLpexyVLK6cAhOhOWXrL+tZg+ODZQ1q0XTbPRwEvwL83nG2u2N4?= =?us-ascii?Q?yLPG96i+8f3Egrrm7AzuHqMMhGjS3iFea72m9XwXX7+K+tsL1hwNf776+WIA?= =?us-ascii?Q?7YsDTIWT7KDTvZ/Qc8FK9d13K05WHRUwo6CVBX4lkV/Kic81FEiwNtzeV2Sm?= =?us-ascii?Q?yafJIxr9EFjqBldx5sF+QDLpRoCbebwyFF82pCCuAuccj1uOzdUL7PvGdFMz?= =?us-ascii?Q?PaCX1cFUGA4+pnt1Uy74LMjD00f+JzlhQ6WOhvZcobb2nKIep6Pbym7ScKID?= =?us-ascii?Q?oasiFLhrOP/wCIqN66DcBRlTGSiCWelS8qPN9lswk/BV6E4pyFDy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+ZsNLCaoCL2qDOFK3k6lHGzBKCMKId26y6pYutQWJipNnKPCmq5Rb0yjm9Tto=; 24:WtO7XcXnCF9ubcTNB+W1F5Yv9JYsec+zOSwmcA93eoRyNCoFBzXklx+tHH7UEDe/jTZkI9t9C5YgqNrKstWrJhogx6SEGdKxfcJy0jPqxq8=; 7:28JqtX32PGVuhBbfYpjaVDw+xjjDeahwXyo5Q6Nfu8/AulHQXKbt22DWl60GF1WERi+7sDHD00NkmpnIHskGE92a/JIRksstnh/KPJmd3QbX3AjK9oBlo1Zk/PaUGs/TZq2kJe+Ycg80h1kXgWDTcK1YVQbo8YZziD+IXXz5vka2ETn7ViWZBs6Pq4Jw5UdZYVnxdeHU0L1c1uNHrK95U1XOVhicL0rJesFe52vDa2q3Er1+OsvvZwKwBYUAFl2sNV+Bpeo0fC2iXXDFF9bH7w== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2016 09:06:31.4673 (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: BN3PR03MB2372 Subject: [dpdk-dev] [PATCH v5 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: Wed, 22 Jun 2016 09:06:34 -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