From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0052.outbound.protection.outlook.com [104.47.32.52]) by dpdk.org (Postfix) with ESMTP id 6F1613796 for ; Tue, 12 Jul 2016 08:01:19 +0200 (CEST) Received: from BY2PR03CA050.namprd03.prod.outlook.com (10.141.249.23) by BN1PR0301MB0771.namprd03.prod.outlook.com (10.160.78.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.539.14; Tue, 12 Jul 2016 06:01:17 +0000 Received: from BL2FFO11OLC006.protection.gbl (2a01:111:f400:7c09::126) by BY2PR03CA050.outlook.office365.com (2a01:111:e400:2c5d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Tue, 12 Jul 2016 06:01:17 +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 BL2FFO11OLC006.mail.protection.outlook.com (10.173.160.95) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 12 Jul 2016 06:01:16 +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 u6C60qWe006202; Mon, 11 Jul 2016 23:01:14 -0700 From: Shreyansh Jain To: CC: , , Date: Tue, 12 Jul 2016 11:31:11 +0530 Message-ID: <1468303282-2806-7-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131127768768280969; (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)(1110001)(1109001)(339900001)(199003)(189002)(5890100001)(33646002)(85426001)(229853001)(68736007)(586003)(2950100001)(2906002)(50226002)(4326007)(2351001)(87936001)(11100500001)(106466001)(6806005)(110136002)(97736004)(92566002)(356003)(5003940100001)(7846002)(8676002)(36756003)(50466002)(48376002)(76176999)(305945005)(50986999)(86362001)(104016004)(105606002)(19580395003)(81166006)(47776003)(81156014)(19580405001)(8936002)(77096005)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0771; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC006; 1:9bZmlwJLbX2c+Oj5KG0BbLs7f2b4UsYaSy1vcz1aIkdIsl5wFb5Ezks0oEDwPyESd0/YpkXCeT8hR0E91wX4kNAYEC8XW90NuX4Eb12S8w9QFmZBmCf7zKAf2GVOeOoui9DBVnl7dPBjGbzrL6W1sspuTReTMQ3kLp/QoEmuAqJyJykxEP8+kTzP4uiMv5pSfWB/5CZs95w9scPgk07QvC0jM/Lyfzsewx6vE3SmX6IDuqVBfqYsG9HjoVcM3QdJk+Ak68avmiRgLuSVh0e+PNI2+pmaKiiEfvD/U0Iw46gf8jdOuDKziZ4V73i2eBiTd5RWSGfJ3pC38S+Reac21rBjXNuvOnMolU7ARAwindpKFhv9zphP6q8DqJZyOAqMjZ2Le9QRtF9VXpQ4k0uRE6dY7hIwqbkO3OvmoOIoBNE/FRb8Oa0n2ttK1UKoPkl5aaSxc/26ymMuESiK7UwVobqkezr2lmPDeMpLVLJ0uRSYO6vp0KxWTEyiApvhshC+ly3tlE8uXmYcnqBj+Yn8Gkv0HTF6WGkSM7e2HpEQmBUKuVoAhJRhUYxK6v6UseAo+naQESpk6jUYwTA1IBDdMDIfAbG1g/iso505HhvQTg/t6uQT6tY7Ve2I0HNfjktN MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 17a3fde5-f2df-4416-182d-08d3aa19f014 X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0771; 2:+NJ1pkQekq/FEeradtC3oo6/o2g5o3GzgsCk+AYXAXsS4IGKNwmEJMUI3odauGFzSSyCvD9C38kU9JyzIQGarLdKVU8qyWkES36wf1mC8AZBzU7Qgs4Tt+a/m2nja1G1bxDocoPLgUaVLoNF+VgFjYlOFUJlonPUnsES/4EiEHvkdvxQFdi9z8w4+hN9ollu; 3:qp+DflfBZV9Muin6oU8TOzEMjyHmOJwf8nAefjO0EJ8mB+Dp9pBbDc4m4tVXOZ72w4DO697HncRlMd9r9Ioo8ZHVcm0wM1CUsg+CFKf/D4yRtU+IvIo3QdYBSeBkYRc98bDBaNyPpXxBgaajcCPWfpaDHFV7qza/cW+rFAyT8LOk32U1OU0KfrT34ZHso4Tw8QUWsHjsLaLcEZxGEfXxl5qMpD4wI2IaPMWeHS+aNvc=; 25:RDxNLRAXY0b0MO1tpFPZTyMF12mtxXiCSlKKQ82h/StvBODzc91rR3qq29b5Foibk3fwW1T65F4Wa9xyelzPvJoKt3YmJZiiH7Kk0wJq3G+lHX13fXkd5ryEmDELFIUE8/ZHSQABs9y68GlePQRH/grCny3C3Ub6roL4qXd6nXUOHH798ChkYHuS+sBPygTfLmkbC5rNCvtMsPbTojK30CXSnbnUN3jyfdO4BtIWxDf4cyclIVCGhaEc61ZIaKCZSFdmmZo0meP3o6R91G7newdCHqtesCKiqGHrAp+NRNnqoVA5ARoqiPkYmJUGAsjFZxjDPNxqoM5oXQVBJLaU5GIfdOnvsPTazsaL9zESxk68TPIpVEwZNppsbbJdlBSkyg8+rlprV5viRMG/+ZwtwJrb5nupeupcUbtWYV96x8s= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0771; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0771; 31:AiXtz05WQfeLrTiu038ZB87n4C+cl/uHfAaFhsvwLFAYK1Ya0ZXmxiq8gY3l+bSkg5uIf3ki/stVzl3E8UBPGC6sGuzUCNSnQz/7JO0yzKiNnU72rLlUhpLfitOpYZNAZrD4SJQWZpZoPLSFom+wZCGkBlGvoFBH+a2hzubMbDEe6WBO1qUTRLgSjKwp54hiXqmpoxNAerxkTPAqelIAFA==; 4:vDo6dNT6fFFVJF0wpUWLUBq45k4kJX0qYeWnFQ/3EQYTN3KcJ8u2UcO6q4ShkTIk7up3fixW+KNgp6nH37UcMV3+IssNCho+M6MlYqZLfmOSxL58oGMo/lI1YfwY59Q6nbUHsY9tRqP734XsAjqfdBQ1St7oKxyOjgR1NMFqNdCG3ghpPumw5JaRf33fqfWO4Y1t+EbzzVrAkIeIDmfEg33EXj97urWXlyq/HO0Tmix4/bA6pGLMiREDdJQgi+Jv6gaFuJgLbuowPawp/04PFavYowCcv+TrxKWcEvxLmmtN3XIrCJwIENkTxkSxSoozb9Dfeug3+UM5xiR3mNiFLRMVBknF620fl/3b38OXTtnZtVfdKlaXeZ5rPnfuRL1D3r3JmRJy+xvNoAk7qepZQziGIwkD880Xq1fWVC4iumpew2G0L6ZT//Hq9isXMTsf1ZFWksNRarPMH371WqLCoIyhd33JC0UIkTGgT9aVggjHvfMssgG11HmMlJ0XBepsmTjYQv5JDqW853/AzPc5VQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13017025)(13018025)(13024025)(13023025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BN1PR0301MB0771; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0771; X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0771; 23:R2Am56BHTUyw+T4kPIhSgY7wOn+tik+HQAnA0w/?= =?us-ascii?Q?N0rMf+gu9Rm0Vc2vRpxN8Rwaiier7l8MA/K9/B5pLjH7yFQabYpk8r5ueuCJ?= =?us-ascii?Q?+3CloensCkLcb/F9t8zPOrPlhZUD8ra6qComXmzOkd5Gw4E0mDJ25VAe3EAx?= =?us-ascii?Q?NbzMID6I9HJzbZBfpxtFlghu/dCKjXvH8rhn2Thn3TD770AoK79PfcrgzqAK?= =?us-ascii?Q?HTbtgQDt+5ILd9mFsKFZTqa34JYmmKPMXrwBxDggwQuCE7/OZaeH/z2c8UrK?= =?us-ascii?Q?Nll1/n/Owl8Uk4BNsnMBjUHBGsvYc4+PGqjImvyAXOw+GFPe4GDTBWEWZB5K?= =?us-ascii?Q?xgAbVun7/boKN8JnxxhCKd7A6TScFUK/5PnZJNGPl8kymS2JDXhY1MyY4DDJ?= =?us-ascii?Q?fHf5GBBIARsXfWYxX/9hn4V6MtbGFhxoN1zPR97+TESi7RvT8827UL8reqbh?= =?us-ascii?Q?CWPjM/9NVCbfBATbqNfRnGeUUnwnWlAL0TGVyu4mXnaOf2uHwAIGAMRJA8M/?= =?us-ascii?Q?P4IUvMPA1D07B7s4oSz/7DeV45Vn3Qv/iHn1fld2KG1Qh34Kn1f1L6MFh/2K?= =?us-ascii?Q?0xC9lKYsxBf6TT9t5AGA1uthFIXdGfLEqL814ax/wU70fNcSi+6vmNybrtRj?= =?us-ascii?Q?XqeugdmM0sknE6LU7LSTwkn/c1mK3iVN/Svkr+N3h0lbByXFJhpxeFL9vwCN?= =?us-ascii?Q?j35q2/Uvt5L7sgJFDf4rwxKMTS30BF9sr5/iCrNBCV2ndbA374Pe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JYodHOP1pBVmN/DpVUhZlfRxYVWbBpqJx+/KPsImOyQw=; 7:L9d3NbKFT+eKpSQf4GsIvaZMRCiDepW+fxYbCsKhsjSE7Khfpyw5AzHFOYz8Clntv9VQfwmd7Ub+HQDn1AVxowT2ifi+0TG+T5w8Ix0LJGccCq4RExyLWk/PpJNsf7ZQ7cFctxoTWsiy2HPS907H0UZFKIvzCDIxT5288EbnTSGKvnGa4aopxrVldf4FcoHe3Lh8w3vH/4RzwCpsc0+aGEHQMDkajkST06UPZ1giuVd00VkenARj3I96Wbx50z+S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 06:01:16.6565 (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: BN1PR0301MB0771 Subject: [dpdk-dev] [PATCH v6 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, 12 Jul 2016 06:01:19 -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 | 2 ++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index c3cc3e9..3a75f2c 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -431,9 +431,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; @@ -492,8 +492,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; @@ -541,15 +541,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 a08fd20..7aa7f4e 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -37,5 +37,7 @@ DPDK_16.07 { global: rte_cryptodev_parse_vdev_init_params; + rte_cryptodev_pci_probe; + rte_cryptodev_pci_remove; } DPDK_16.04; -- 2.7.4