From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0071.outbound.protection.outlook.com [104.47.37.71]) by dpdk.org (Postfix) with ESMTP id F1595803D for ; Fri, 9 Sep 2016 10:45:19 +0200 (CEST) Received: from BLUPR0301CA0003.namprd03.prod.outlook.com (10.162.113.141) by BY2PR0301MB2008.namprd03.prod.outlook.com (10.163.196.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Fri, 9 Sep 2016 08:45:16 +0000 Received: from BY2FFO11OLC013.protection.gbl (2a01:111:f400:7c0c::138) by BLUPR0301CA0003.outlook.office365.com (2a01:111:e400:5259::13) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10 via Frontend Transport; Fri, 9 Sep 2016 08:45:15 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; 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 BY2FFO11OLC013.mail.protection.outlook.com (10.1.15.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 9 Sep 2016 08:45:14 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u898hoZ9018305; Fri, 9 Sep 2016 01:45:12 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Fri, 9 Sep 2016 14:13:59 +0530 Message-ID: <1473410639-10367-16-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131178843150171114; (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)(1109001)(1110001)(339900001)(199003)(189002)(356003)(19580405001)(19580395003)(33646002)(5660300001)(8666005)(7846002)(36756003)(110136002)(77096005)(105606002)(229853001)(48376002)(68736007)(8676002)(305945005)(81156014)(81166006)(50466002)(189998001)(104016004)(2351001)(8936002)(5003940100001)(97736004)(47776003)(50226002)(586003)(106466001)(86362001)(85426001)(92566002)(4326007)(87936001)(626004)(76176999)(2950100001)(50986999)(2906002)(5890100001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2008; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC013; 1:9CIc3UDh9+2e0djfxIsqAL5dMYvBVsfrzrhNylNi5vyVwqazx3Pwu5x8RGMgivQB4UKgprVV1GKIdzvnbY5PB305/waSW7SPDXH9nCGLSbjD1ST1pgnPprlNDh9uAyMsHJBPJPotFJuoKFAlEYqDMD0UIwOO6SYIQZhzp1CphyZykxuxQAGNeHDVyDbIgU0Rf/3T+IDBXIeIAiY5saaKf7BTcjp3eqEYR4wk8Tmkk36tA1Fg9FOK4j6Ol4nL6jlcVZzWOU+Gt+dN5EXyCVF05iNEUBPvqYPZ0jminde9UnJHEDzFqDqs/rGu+r0JfB3lQBWYPWGc7n4/P/58wfeTVkihPDlvzxlcjQB4ZZnLIAliVYNrFpT0FgRIu0GN+iUdii629XHCaN2N6g8Pn+BKgANhoVxj83zHDecA6vgq9Qwe/Mr/fr39ieQJPIiHaRqy954NENgXPVDl7iJk7wqt0yJVdMV5xOxK7kY7ziEAyh+Mjbw/RS9GcqCqcn/NuZng9IuWGDTtZlWAf8vSPoKydr2aBQrElCW8ulsXccRZNS6OU8NA1K7rf1khbh3G20//swmlNqTUr+DJdvyWStpZzmWQ3O4JfgF/5KEAbsFukQ4JoLSieXo7KTYrPE3jkuifr9SefNHV3O7qIqmfTJVEyfeZuFvdQ+OUjeMpiGF6psQ/nfdyA/t1cXvVy+xVPOOeSw7PeQvQn6nfQtCTxzGKUHr49TFIeHJHw2oq2uHXiKc= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: b5698ab2-4ba2-45df-cfa5-08d3d88d9e64 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 2:n3hJjpDLER2pDOje0yYVeK7B/30xAL2SP+PL/jHAd0SYzut8070qVTV669YRpqnCJesqI+Ew9K/X+j0nH7zCQ74PIMmN1SH8spZcJ/LIuleKAi737w2sznczQB+VcUVjV83EFa1nx73KNsowqD8E1ILlfYUglzWqoc5hK2h9UNy57HTfOau38k0GOqElCw/C; 3:XTx1+BJqtfhuY5a41rQ0k4rgFXKbi4exQ5A8cabXyRBjAR1bZuoPQTpeBexLynCFi3PpxZZIMNd7FbXu5JD91QH6+RyaSVbQ//vn6CMo1Z9vuYhXE5JaO0l9LXp6A66FKrgcSmhvTmQ4WEdej5Slkg/kgZOLuFn+f7L2ZL5L7HtW7wS7rHOkPTofWGhcRDXzg4qJaBiuGcIXixAmAaSZztfM8sIeh4OWfYoTXIlJaDU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2008; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 25:p5wUrdNTnRGdKJ1lXewb4UKLYCtKictwH9epo6/GPh5Pj11kcqsVU/2OVoM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1BJA6vrY4g0/AOuyz7wfL4YV8s8r9GBLIAniArx7usDiaOblpcZdyA61iBSw5C6WTBlfPVdQHKRAsNWTWCxGtsZAGSDAF+a68UNoePWjTTjzR/DRn9z568zBCgQG4fwUDAxC1C1uwV9PTeS5+iT/k45BsaFF10dUMxva6D9J062y/qF8aFpT5Ih0uywc1kpU+WcqwaGC1NGvAweyFCRvOsjjO28pcVIcu3CykV6B97t40w4Rxf5iQnK+6xAhJ6DM91UO0akh6NvUDhJx+ImfpU5Bp2tjQLUQH7G5M7+UYwtiLe43YMUBfBQZLiQXpThlx5cEllaCPcLQ5idafruyOdxHU9lnJyYVS9lLrTWZor6ELkK4Y25KiaB7GpLfQuJJQ/gqf5pbYfyXDFjhtt2ay1sJL9rgNPnIE4Mpu3qmmOvZ0MZf+PHQOgxG7/qy3Q= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13017025)(13023025)(13018025)(13024025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB2008; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2008; X-Forefront-PRVS: 00603B7EEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2008; 23:l5ev3P+NS7yTwAOSXlgxu7UxNnho0AAhkElnZnp?= =?us-ascii?Q?9zgFbuA7BVbB2GrmvcTjFe2aPXmXxV5H8nL5MjGS68/YJ2thpN3Pdir/dVcq?= =?us-ascii?Q?LvMkVGtZ6RA8z4HVuGzZ89Ng5pcNs4In5LvgBN5VmYkUnmb3FBm5PHPKMuXR?= =?us-ascii?Q?zoh5iySzbaXjRdchBqNj4C/+AGzcoZAOoJCELCndtxgzEMbII5X+vpvZ1zh+?= =?us-ascii?Q?pUsDqwDgLj0ffpFzCxibqPLS4PkFE3k1ezUXOBnSctQw6eYb8gYc331utizB?=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b7AML5Vol6n3grgIC0tG/I7nsVFyQ2cp?= =?us-ascii?Q?GUlEuC1kvwF4txbA=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 6:4ATVjzxjwXbCAbhV3f8tJyjxO84mCCC21Ek4b8e1qfJEHSb5WEGc3sX7wiu6tKT/UxbQQkJ+FNzeXGSejPfnz3iXuAT4e/Z34av8XBH2oL0KvqMWX+wj3gACaHVW5+yFsU83DfAMafjj+xqL/0fnYTX8Be9KVJOWdarVBkXNPm1XBdh6NqEWU6LMYLVAqzndOibJHsdR6Z4yYabQAQcjPiGGVpqgUBebQEVSwnPfzdebyn4nY506j3Tz/90xd6tyPELoC+fGYSQ68bQzlz1ZStZdh5au5jdApOgFdR5zAYs=; 5:DPtw31pI0MhG4TwpuJBPCMqXOhtTiCkYfQaq9jVUAAE9XX9Le5metTYIrijG2YbO5RbFpsSaCAHc4Arl6kzz1oFxs6BBjCKz5zzFO5f18oP/YB/9VkVTMTmi8UbviqieWwAzSgxosKShSkTbxuB/B5mRBY64PBdGQg2p/5koXQw=; 24:YEjpBIveSh6sSGsa0OaPaHsddi4D8w41/OS3vfTWTfxMADkE71sLC2dI1OWezsXZv9SQ92m18n82qyFunX7YXCRNDZ0WmWSHfBCwmrKYJPg=; 7:RhGtDEsNTD2Y5svbAVUaBUZDyqPGCx8Is716MikFzVOZpurvgsEw/uF61WzXXh8g6gQE8dJVInoVMfk8L+zVEtlgYBkJEcWAoMvRhye5KlEZPsilLpaAxwCk+J5lB9IfqNJD7KLV/xQrGODR2K5476MeI7RI9XOdbBkH6T0JuisneuJF95HK0obZbcAp3RxGBsygE9xn+v+iEj0lKF7cCYnLVyR8xkbsxE93wfO4+Crj2Bhqr8CTZLdSSLPBOmXF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2016 08:45:14.6895 (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: BY2PR0301MB2008 Subject: [dpdk-dev] [PATCH v3 15/15] eal/crypto: Support rte_soc_driver/device for cryptodev 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: Fri, 09 Sep 2016 08:45:20 -0000 - rte_cryptodev_driver/rte_cryptodev_dev embeds rte_soc_driver/device for linking SoC PMDs to crypto devices. - Add probe and remove functions linked Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- lib/librte_cryptodev/rte_cryptodev.c | 122 ++++++++++++++++++++++++- lib/librte_cryptodev/rte_cryptodev.h | 3 + lib/librte_cryptodev/rte_cryptodev_pmd.h | 18 +++- lib/librte_cryptodev/rte_cryptodev_version.map | 3 + 4 files changed, 141 insertions(+), 5 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 2e17169..43e8685 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -423,7 +423,8 @@ rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, int retval; - cryptodrv = (struct rte_cryptodev_driver *)pci_drv; + cryptodrv = container_of(pci_drv, struct rte_cryptodev_driver, + pci_drv); if (cryptodrv == NULL) return -ENODEV; @@ -490,7 +491,8 @@ rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev) if (cryptodev == NULL) return -ENODEV; - cryptodrv = (const struct rte_cryptodev_driver *)pci_dev->driver; + cryptodrv = container_of(pci_dev->driver, struct rte_cryptodev_driver, + pci_drv); if (cryptodrv == NULL) return -ENODEV; @@ -514,6 +516,111 @@ rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev) return 0; } + +int +rte_cryptodev_soc_probe(struct rte_soc_driver *soc_drv, + struct rte_soc_device *soc_dev) +{ + struct rte_cryptodev_driver *cryptodrv; + struct rte_cryptodev *cryptodev; + + char cryptodev_name[RTE_CRYPTODEV_NAME_MAX_LEN]; + + int retval; + + cryptodrv = container_of(soc_drv, struct rte_cryptodev_driver, + soc_drv); + + rte_eal_soc_device_name(&soc_dev->addr, cryptodev_name, + sizeof(cryptodev_name)); + + cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, + rte_socket_id()); + if (cryptodev == NULL) + return -ENOMEM; + + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + cryptodev->data->dev_private = + rte_zmalloc_socket( + "cryptodev private structure", + cryptodrv->dev_private_size, + RTE_CACHE_LINE_SIZE, + rte_socket_id()); + + if (cryptodev->data->dev_private == NULL) + rte_panic("Cannot allocate memzone for private " + "device data"); + } + + cryptodev->soc_dev = soc_dev; + cryptodev->driver = cryptodrv; + + /* init user callbacks */ + TAILQ_INIT(&(cryptodev->link_intr_cbs)); + + /* Invoke PMD device initialization function */ + retval = (*cryptodrv->cryptodev_init)(cryptodrv, cryptodev); + if (retval == 0) + return 0; + + CDEV_LOG_ERR("driver %s: cryptodev_init(%s) failed\n", + soc_drv->driver.name, + soc_dev->addr.name); + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_free(cryptodev->data->dev_private); + + cryptodev->attached = RTE_CRYPTODEV_DETACHED; + cryptodev_globals.nb_devs--; + + return -ENXIO; +} + +int +rte_cryptodev_soc_remove(struct rte_soc_device *soc_dev) +{ + const struct rte_cryptodev_driver *cryptodrv; + struct rte_cryptodev *cryptodev; + char cryptodev_name[RTE_CRYPTODEV_NAME_MAX_LEN]; + int ret; + + if (soc_dev == NULL) + return -EINVAL; + + rte_eal_soc_device_name(&soc_dev->addr, cryptodev_name, + sizeof(cryptodev_name)); + + cryptodev = rte_cryptodev_pmd_get_named_dev(cryptodev_name); + if (cryptodev == NULL) + return -ENODEV; + + cryptodrv = container_of(soc_dev->driver, + struct rte_cryptodev_driver, soc_drv); + if (cryptodrv == NULL) + return -ENODEV; + + /* Invoke PMD device uninit function */ + if (*cryptodrv->cryptodev_uninit) { + ret = (*cryptodrv->cryptodev_uninit)(cryptodrv, cryptodev); + if (ret) + return ret; + } + + /* free crypto device */ + rte_cryptodev_pmd_release_device(cryptodev); + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_free(cryptodev->data->dev_private); + + cryptodev->pci_dev = NULL; + cryptodev->soc_dev = NULL; + cryptodev->driver = NULL; + cryptodev->data = NULL; + + return 0; +} + uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id) { @@ -869,8 +976,15 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info) (*dev->dev_ops->dev_infos_get)(dev, dev_info); dev_info->pci_dev = dev->pci_dev; - if (dev->driver) - dev_info->driver_name = dev->driver->pci_drv.driver.name; + dev_info->soc_dev = dev->soc_dev; + if (dev->driver) { + if (dev->soc_dev) + dev_info->driver_name + = dev->driver->soc_drv.driver.name; + else + dev_info->driver_name + = dev->driver->pci_drv.driver.name; + } } diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 13f46e4..d10f62e 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -231,6 +231,7 @@ struct rte_cryptodev_info { const char *driver_name; /**< Driver name. */ enum rte_cryptodev_type dev_type; /**< Device type */ struct rte_pci_device *pci_dev; /**< PCI information. */ + struct rte_soc_device *soc_dev; /**< SoC information. */ uint64_t feature_flags; /**< Feature flags */ @@ -610,6 +611,8 @@ struct rte_cryptodev { /**< Supported features */ struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */ + struct rte_soc_device *soc_dev; + /**< SoC info. supplied by probing/Scanning */ enum rte_cryptodev_type dev_type; /**< Crypto device type */ diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index 99fd69e..db1756e 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -48,6 +48,7 @@ extern "C" { #include #include +#include #include #include #include @@ -129,7 +130,8 @@ typedef int (*cryptodev_uninit_t)(const struct rte_cryptodev_driver *drv, * - The size of the private data to allocate for each matching device. */ struct rte_cryptodev_driver { - struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */ + struct rte_pci_driver pci_drv; /**< The PMD is PCI type driver. */ + struct rte_soc_driver soc_drv; /**< The PMD is SoC type driver. */ unsigned dev_private_size; /**< Size of device private data. */ cryptodev_init_t cryptodev_init; /**< Device init function. */ @@ -517,6 +519,20 @@ int rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, */ int rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev); +/** + * Wrapper for use by SoC drivers as a .devinit function to attach to a + * cryptodev interface. + */ +int rte_cryptodev_soc_probe(struct rte_soc_driver *soc_drv, + struct rte_soc_device *soc_dev); + +/** + * Wrapper for use by SoC drivers as a .devuninit function to detach a + * cryptodev interface. + */ +int rte_cryptodev_soc_remove(struct rte_soc_device *soc_dev); + + #ifdef __cplusplus } #endif diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map index 9627ac4..d81073e 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -44,4 +44,7 @@ DPDK_16.11 { rte_cryptodev_pci_probe; rte_cryptodev_pci_remove; + rte_cryptodev_soc_probe; + rte_cryptodev_soc_remove; + } DPDK_16.07; -- 2.7.4