From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0059.outbound.protection.outlook.com [104.47.36.59]) by dpdk.org (Postfix) with ESMTP id 67FA6591F for ; Mon, 1 Aug 2016 12:45:07 +0200 (CEST) Received: from BN6PR03CA0036.namprd03.prod.outlook.com (10.175.124.22) by DM2PR0301MB0701.namprd03.prod.outlook.com (10.160.96.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 1 Aug 2016 10:45:04 +0000 Received: from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::119) by BN6PR03CA0036.outlook.office365.com (2603:10b6:404:10c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15 via Frontend Transport; Mon, 1 Aug 2016 10:45:04 +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 BL2FFO11FD050.mail.protection.outlook.com (10.173.161.212) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.549.5 via Frontend Transport; Mon, 1 Aug 2016 10:45:05 +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 u71Aibjm018422; Mon, 1 Aug 2016 03:45:03 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Mon, 1 Aug 2016 16:15:21 +0530 Message-ID: <1470048332-27318-7-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131145219059635153; (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)(76176999)(105606002)(5890100001)(189998001)(50226002)(4326007)(48376002)(106466001)(19580405001)(68736007)(2950100001)(77096005)(87936001)(19580395003)(2351001)(50986999)(229853001)(11100500001)(36756003)(85426001)(92566002)(575784001)(305945005)(97736004)(86362001)(2906002)(33646002)(586003)(81166006)(7846002)(110136002)(8676002)(81156014)(47776003)(356003)(104016004)(8936002)(50466002)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD050; 1:N7Q2Wm2Fi1zv0PHxOuFP5OZq+u0NiRgiD7yaLJpMcTj0mmfPPyRiN6P+2DY28vs/5+P3xg/CTiRJ5bmbTrXdecikoDnB9eGE9SBmz33FzU8TZIXYk5e3Ajz10UpbYPvXWX4iO39/iAh+i6u9OXfFhpo9z6ur3yeLgNzntNNDHUzJ6mV8XoFrg59rE/HohWeGaNVMD9rb8yxv3wzOiCLcbnlXJeBlq5/2Cv/WGh4CBRgNGeLG4DoMPzS30r+yIo9UIUQjUnXxpW8QrBMNl4Bxc9kg9hegzS0FHC4NkaXImMCv9SOPmFTEI2J9Tt9vPTNQ7FTcY9NDO+ZA+C3Cgak5GfQxG7olaK87XoXuYrg0Amb1nxLW/R6VWXcdAMrZBE0+mMpw7ru5Rxc7rZkwewwFMmNPDiq3dQRnd6YZiK7TPEUw64oy2fJ2+YFSItOLm5xxr77ZG7lAMZpVItdWG8lTPjS3vyg11GaxgapS4Wt9Rs6OTAYReMXZIBL7+JfeparimHWDUbzKXo5qEhRn/tB4LkNIHhFbOT2wjqgMx/3kD0FzmWxo2eR4Nvj83wQ1rgr5bUAx+LNZVEA+P3DavD6y2OcsZnRzpIDOaHiKO397658AIhVd3J4hesVN5M4SuqNT MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 89e1cb99-e24d-4cd5-f272-08d3b9f8e67e X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0701; 2:Wk1iTkEjPqBWQ6d8FG+7QD2W2RXUpR4662ZC5cjZrAl3dadM4dw0QfKuLidaPK7W2vGRsYL5mn8kcJ4cfPwy+3VhJhVYvpELvGCjFnJ8DbhpO0XSS3Nhqi6unIkwvmE2epyyA0ySgBYl+q2fOf3tU6YIH2MTM4gjdpvVMTQSTf4c794eW2nnyvZBY1j8AtHp; 3:Ed2znbaBXU5P0yS6dAM9rOkxZa8mGOi+gYZh3z/8wlFiddO2YT+VG1WtAKPel8LniGCq143XYzbb8odK2ebRNkzauE/gW23apKzjNI4hH0L0k7umXVm4lMC1w9Noyv3RVoY1pPopv0yfUbB62TWPeOxTJm4JcNf40YCBK2Vk7QZCjkbvPIuTIenOr+Dp3lAMrnTOfxBC4TugGetKs3H5QeJD24h+45/RxqUqNYvT42k=; 25:zCdD7wqDaH24UxOYH3LJsGP3PzqiyfzfK3Wquj++7nLlGwCCvkHA3AqQJCtGJ3vCG8JrIhiBiOCJ5FF5Mk953odpaZInglmuOiPr0R4iz+EIqynW2PGxMLTba6LGALWT1BixYThnDaZx+B7Xfqz6hZXSoHN4QcCJpMWkXfSzHUzqiBOgKv5RDyZ/IBI/0zNx31ZQM1Qcc0CgkMmE//4Z4aG52TkO4vCNDrChy9dv5uXUHJJWvapvVB9wa5mKjDIL/RIW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:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13015025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0701; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0701; X-Forefront-PRVS: 0021920B5A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0701; 23:02idOXCbjC3G4Bjvn2wpZLm98Your/H/eGo6vXD?= =?us-ascii?Q?kr+qNsdvyn2XWSaL4aOsYjIAZ3OGeyKBrwqmd+PbldUtaVI3KMpkpYkG/5ln?= =?us-ascii?Q?ThPMi9z4rWeCy7Y4Fi1lAwfcehHdTpwNmyRU0sWpBXZrvZuiSJkqVUOGmMhr?= =?us-ascii?Q?ODgybPzDmF7zJLdMaSpL8HRUutCxVhzI/clXDjSFYZboLPy5xjO4yf/wd3hR?= =?us-ascii?Q?YmpCkLUottvgQYDVHS0YJC46ArvGZH+8lN/Izl3+/v2Zvmqyzcc3xtC2hHCk?= =?us-ascii?Q?z83i8UZYyMKznMUCZctTUk1LRBvgVnqBSsdd1qI98MI7VLSQ9DXRTIJ0hMVu?= =?us-ascii?Q?+BMVvCjUVbU2qdGT1O3zWJk8wZ3BVVIKbbHE4szQqOUd+U15vgpZ0PSL8iun?= =?us-ascii?Q?O8RXpkH39gnhE0qgw17ubWjDoPd6L1lZDFz56ccNHahelqmJJEEZ02mKFzcz?= =?us-ascii?Q?9ZAUyGuBqLfsiIO/VoSLu2UOdVCCMOGMRJFQhfbF6JOmxXCOKJcWFyQ0pj6f?= =?us-ascii?Q?RBQMbaVDOggsWlHdWLTTsyF498+uUpf2/SVAXLkXuHbx1NJEEcCaq5oih0fB?= =?us-ascii?Q?lN43EMaOFGGWiNLfiuuW+sRKOD/prEfGWvIn/N7ohBdteLxFZKszUYtW3IRz?= =?us-ascii?Q?Ls7JEGy34j6+atCtDihCQYx0UZvUu4m6dNtE8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z6SLxydC3OH4=; 24:ZVc6emy9H+j7Rf4RmGhGwVL89j7YPrFpAG870f/A6KOYDkhYDEwpAHzvukzBsar9hI415/J33BoRunmKBO4Ozazrdbs5Gt9O59cqd4mHoAw=; 7:bJQD8QuZa1UURmDALzrttaxoeNhCJ7W/tiHzeVjYiwlNCY/BPOXNpazyrXvOnH8LWW7umEj3+Gmoo5mQq6IXFTkCHz/D2iIKWqemGvS8Tf8hfHI1kykYLfw0RMgvmnw5LE4b5jmTU0apVwpByMUcGphapa2eWvUx0d17GnbOoxiZnvNo5sagNnBVo753TrGzfqQmSsepYkKgzKDst9uTvqzE5SnT5HKb6vijy005IBpkqSUGMS963FZvDAakAX/f SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2016 10:45:05.7763 (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: DM2PR0301MB0701 Subject: [dpdk-dev] [PATCH v7 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: Mon, 01 Aug 2016 10:45:08 -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 | 7 +++++++ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 6434894..b1e82b6 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -429,9 +429,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; @@ -490,8 +490,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; @@ -539,15 +539,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..1fc0d57 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -39,3 +39,10 @@ DPDK_16.07 { rte_cryptodev_parse_vdev_init_params; } DPDK_16.04; + +DPDK_16.11 { + global: + + rte_cryptodev_pci_probe; + rte_cryptodev_pci_remove; +} DPDK_16.07; -- 2.7.4