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 D6791C75E for ; Thu, 16 Jun 2016 16:06:52 +0200 (CEST) Received: from BN3PR0301CA0079.namprd03.prod.outlook.com (10.160.152.175) 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.517.8; Thu, 16 Jun 2016 14:06:51 +0000 Received: from BY2FFO11FD039.protection.gbl (2a01:111:f400:7c0c::106) by BN3PR0301CA0079.outlook.office365.com (2a01:111:e400:401e::47) 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; Thu, 16 Jun 2016 14:06:50 +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 BY2FFO11FD039.mail.protection.outlook.com (10.1.14.224) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Thu, 16 Jun 2016 14:06:49 +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 u5GE6Xo7026530; Thu, 16 Jun 2016 07:06:48 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Thu, 16 Jun 2016 19:36:40 +0530 Message-ID: <1466086011-11920-7-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131105596102026954; (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)(189002)(199003)(50466002)(2950100001)(81156014)(8676002)(8936002)(5008740100001)(81166006)(2906002)(356003)(106466001)(50226002)(5003940100001)(77096005)(4326007)(19580395003)(229853001)(69596002)(68736007)(87936001)(189998001)(48376002)(19580405001)(47776003)(50986999)(104016004)(105606002)(76176999)(97736004)(6806005)(575784001)(86362001)(5890100001)(2351001)(92566002)(586003)(110136002)(36756003)(33646002)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2382; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD039; 1:6q6ocOr+bU9rMaxS0og/AFMongTtNHusKYYHCr3/OaPcGVvEtV5iPzophOcv8mBi6I8yrCk4rotMX2Swfry3AAdpL2AeV2rnel+33nG69EF6g/nqGKAHCLJyZWflSTU7GU3bTHQe5F8jshqppQm+7jf6Sz4GqoiTzVzMAwpRgx0IHLHwqz6L+V87inIaI7UfAo38BmxOzAHj53eofAdnqAwJ1pW8o9g5HvfvTUk2FOhAsR2BHZvydsOcTuhK+LavjJmeq3yWYGYpj6OnfgEAWHL2IukM+4qFGuXg1ZXg7wHei9C85JI+f3LsEH93/2osx3MMvykuASRm8wqOHTFeQEbtcd9dUIQTH4G2j3W0Dd9ep1zERF2Oz2QWuvO+hQYpriZ5rQexdhPqdfvcRtNF/6MirkF5OqSbdzFG3Nip8TnyHs2YRD5yPUHF+6YUKCwJ8B9sXlwJxvvWpvM29Y9bZr0yKCPobDQcPtFGjCXZ6/FdOusgy1QA76nl4JFkOJ//fnUSRVdEs9yYk9eYjhA1/gEiMVpJXqXffwOT6/r+oVDceU9yLzQRfotL9NoGNfnpX6237/zVX9u+4zJehPDkjw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c372965b-fcfd-46e9-1bc2-08d395ef761e X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2382; 2:852LTbSXJKm50Lz1DlZ4SGzJ8qh63AZV3g+BtkFdNCed33c3wTbk8pTZZLEgkKQWFcw/ePkZMkkigOj4tdghrKX/k3Cr2NatQFtAbRZwrZukvrslxAxxlYwAjlHqzGPZj4waW5m5lTzQ8YzLUKJ6jrHJB2tsHUhSdkqYQaxYk4hs/45udMnIliz1ZyYNvu7l; 3:OBc3Z4TWsiQp05ElRD+bw310+f5XPLxRmrrr1YyKaFef5mPtDsSo4Ree3li88kZuWhJxXtx2mhix/8vDMrd295lG1c93FaytqZaujAjyCPFy5ek5qEMEoElMAmA+tToo1NMLCJwL+DchsJtD0hVT/IAfjmUgWaWc61tUjQDCw/g7iXgjUThoPOn21gMf0V34btt8oO21cJbvlHhyK781uyx9EXzB30tm9w5P884X62I= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB2382; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2382; 25:9V0Miz9D+QRxG/y0dPWVEXaJvSDzU/6fiKcHU08BNVfSox8urgHj/toSm2sUleMW8ub5IPvvwXX+tph2p+ukN6N2x9+wbF6Y9jNOez3jfoJGyozpJfBfU17LiJ1nWW8nxIIdchlfHfbS0G05NANdwSHqs0BSWW7FdUW+aXGQta1RHP00fVaHqoB3/33xh6HJA6HMRQrQ6Yr5xj52d89gftqZY3AAag6RROQBSYVH3yAw8efnNzxnNYJpsqfV05lDFeYJr6IRDLPNdLSl/Q5aorxvSvW+E4hL7Qu/0Kyk2417z4s6ucDP30d1bctqagUvYh7jrFdzc9Tkue/3PsKr7ClBEdyCvupOMBitxbbAwTQsJiTV25mCpTRMPkSmSOw2Hr8lOKf5bcdougb1Pjh5R2p8/jTyYm2JgWtCLnmsklmflzyoSQsNkrLfiKunJWgdKYylnWuf4k/NJ3AqO5K48ipYFI937ynK1hjnumhTHfWDVbSEv8H27ubTMAwr2rHjxC1K0LYAIYovw/LudUeEIU8t0p7JqQfEAT6JYVgNuMq0SBKsb2VT6g6WOgPhFGc+IOqT+NqiS3ltitPTgKGuRNwQNG6qem+zJDNzOT2X0Hx16H1v4yIisHIz4o4iwG5fXU2jOxH3Ka+LCOpNlJide1RJPMP1fGYkWM/7pO/Uey/ESqHc9uz4tnPPK6ttmZgV5f3z/P2C5foQew29RYSRFK9NYcPxtDYnbmOwU7XKhl3XIJc7QtiCPGyNjPWtTDUn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13023025)(13015025)(13024025)(13017025)(13018025)(3002001)(10201501046)(6055026); SRVR:SN2PR03MB2382; BCL:0; PCL:0; RULEID:(400006); SRVR:SN2PR03MB2382; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2382; 4:vCijOgvaMoHLq3U6OaFNtFkxgcgV7h1KKDz5ZjOYkyGT2oCb9GYfbh0OSRnlTPYcQExLOeeQ+IULc77zRXe4b//y1X5TlXW9QBYYIbCcNBMwDCdK2ZCDbXziDhWtq04dA5BRdnzLPRGrEGf0FOG9npQfW3YHe4d4w3HzL/5mlKNbn4jJ8SrNmW1lYiteGUt4xVF+eHsPX2+gp2jOgLm8dR0CDJ6QAgQMpieOZqTWt8gcUWtCbIW8ABR0M2qApz2oA6LjzdyIxmqN2XaLdmQ6+B2GP1VYwVp4gvjp7Uf8rUJcJgSU49zZv5ivUbs23BOWjCx42MBozvByJH6tKmVI6u5bcIoPH94z86sX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8Y2lrNyW4oEPniFXR89U6rbig2i49fosmfRtQNnRNR4XstnGQb/J6mZVwTQrU6Bd9Sk=; 24:iHCTwwr4afhOjWeZ6cvO6yBHjDPyL7t6PsMETq3gCfTbqa4Mjty80VKpRtWD8IjAfMdKbTw1P4BF2W90+kh10ZI60WdKXaNO8cWJ9pCR/R0=; 7:2la7/KCuDkd3ZwW7EhXYE4VA5l9usBitOvRMa3D3Es1AjgmTv8QFsOaHu8f1xO3k9/HKeXiP2BCOq5kIquYi5OHVWa5jZPE/ksUn+HfDBFCyVSO2oo73md9bPIM4Iwa6Vy/MYNv0HVnCDRqd0LFR/AL08egQ8o+5X0XSy45wFPkW4r/xzrLTMt1gkj1NyhH6dU/vohlsZ3uNRrzqROX87w== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2016 14:06:49.9686 (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 v3 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: Thu, 16 Jun 2016 14:06:53 -0000 From: David Marchand 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 --- 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