diff --git a/module/bdev/crypto/vbdev_crypto.c b/module/bdev/crypto/vbdev_crypto.c index 16c965622a..dfad1f96fd 100644 --- a/module/bdev/crypto/vbdev_crypto.c +++ b/module/bdev/crypto/vbdev_crypto.c @@ -43,7 +43,6 @@ #include #include #include -#include #include /* Used to store IO context in mbuf */ @@ -1569,7 +1568,6 @@ vbdev_crypto_finish(void) struct bdev_names *name; struct vbdev_dev *device; struct device_qp *dev_qp; - unsigned i; int rc; while ((name = TAILQ_FIRST(&g_bdev_names))) { @@ -1583,21 +1581,13 @@ vbdev_crypto_finish(void) } while ((device = TAILQ_FIRST(&g_vbdev_devs))) { - struct rte_cryptodev *rte_dev; - TAILQ_REMOVE(&g_vbdev_devs, device, link); rte_cryptodev_stop(device->cdev_id); - - assert(device->cdev_id < RTE_CRYPTO_MAX_DEVS); - rte_dev = &rte_cryptodevs[device->cdev_id]; - - if (rte_dev->dev_ops->queue_pair_release != NULL) { - for (i = 0; i < device->cdev_info.max_nb_queue_pairs; i++) { - rte_dev->dev_ops->queue_pair_release(rte_dev, i); - } - } + rc = rte_cryptodev_close(device->cdev_id); + assert(rc == 0); free(device); } + rc = rte_vdev_uninit(AESNI_MB); if (rc) { SPDK_ERRLOG("%d from rte_vdev_uninit\n", rc); diff --git a/test/unit/lib/bdev/crypto.c/crypto_ut.c b/test/unit/lib/bdev/crypto.c/crypto_ut.c index 6dbc646cb9..70d8c66688 100644 --- a/test/unit/lib/bdev/crypto.c/crypto_ut.c +++ b/test/unit/lib/bdev/crypto.c/crypto_ut.c @@ -40,7 +40,6 @@ #include #include -#include #define MAX_TEST_BLOCKS 8192 struct rte_crypto_op *g_test_crypto_ops[MAX_TEST_BLOCKS]; @@ -191,6 +190,7 @@ DEFINE_STUB(rte_cryptodev_sym_session_pool_create, struct rte_mempool *, (const int socket_id), (struct rte_mempool *)1); DEFINE_STUB(rte_cryptodev_start, int, (uint8_t dev_id), 0); DEFINE_STUB_V(rte_cryptodev_stop, (uint8_t dev_id)); +DEFINE_STUB(rte_cryptodev_close, int, (uint8_t dev_id), 0); DEFINE_STUB(rte_cryptodev_sym_session_create, struct rte_cryptodev_sym_session *, (struct rte_mempool *mempool), (struct rte_cryptodev_sym_session *)1); DEFINE_STUB(rte_cryptodev_sym_session_init, int, (uint8_t dev_id,