From: Pablo de Lara Date: Wed, 21 Jun 2017 06:30:20 +0000 (+0100) Subject: cryptodev: remove unused PCI probe/remove X-Git-Tag: spdx-start~2943 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=065a0cbaeb8b7308a0def85d42a69c179b5963f0;p=dpdk.git cryptodev: remove unused PCI probe/remove Signed-off-by: Pablo de Lara Acked-by: Declan Doherty --- diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index d02a4d0ad9..3d118b5d65 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -553,108 +552,6 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev) return 0; } -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; - - char cryptodev_name[RTE_CRYPTODEV_NAME_MAX_LEN]; - - int retval; - - cryptodrv = (struct rte_cryptodev_driver *)pci_drv; - if (cryptodrv == NULL) - return -ENODEV; - - rte_pci_device_name(&pci_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->device = &pci_dev->device; - 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: crypto_dev_init(vendor_id=0x%x device_id=0x%x)" - " failed", pci_drv->driver.name, - (unsigned) pci_dev->id.vendor_id, - (unsigned) pci_dev->id.device_id); - - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - rte_free(cryptodev->data->dev_private); - - /* free crypto device */ - rte_cryptodev_pmd_release_device(cryptodev); - - return -ENXIO; -} - -int -rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev) -{ - const struct rte_cryptodev_driver *cryptodrv; - struct rte_cryptodev *cryptodev; - char cryptodev_name[RTE_CRYPTODEV_NAME_MAX_LEN]; - int ret; - - if (pci_dev == NULL) - return -EINVAL; - - rte_pci_device_name(&pci_dev->addr, cryptodev_name, - sizeof(cryptodev_name)); - - cryptodev = rte_cryptodev_pmd_get_named_dev(cryptodev_name); - if (cryptodev == NULL) - return -ENODEV; - - cryptodrv = (const struct rte_cryptodev_driver *)pci_dev->driver; - 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->device = NULL; - cryptodev->driver = NULL; - cryptodev->data = NULL; - - return 0; -} - uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id) { diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index 0efe282252..6579170a51 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -481,19 +481,6 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev); void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, enum rte_cryptodev_event_type event); -/** - * Wrapper for use by pci drivers as a .probe 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 .remove function to detach a crypto - * interface. - */ -int rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev); - /** * @internal * Create unique device name diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map index b8c16dd0ca..71916071c5 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -31,14 +31,6 @@ DPDK_16.04 { local: *; }; -DPDK_16.11 { - global: - - rte_cryptodev_pci_probe; - rte_cryptodev_pci_remove; - -} DPDK_16.04; - DPDK_17.02 { global: @@ -55,7 +47,7 @@ DPDK_17.02 { rte_crypto_cipher_algorithm_strings; rte_crypto_cipher_operation_strings; -} DPDK_16.11; +} DPDK_16.04; DPDK_17.05 { global: