modules/crypto: remove dependency on rte_cryptodev_pmd.h

Call rte_cryptodev_close() to free qpair memory instead of using
an internal function.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I1bd7f0dd86de83f278f6be3263cdf3fbd8e1c77f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9720
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
paul luse 2021-10-04 13:42:29 +00:00 committed by Tomasz Zawadzki
parent e50d1e0f59
commit bcd3ed39e7
2 changed files with 4 additions and 14 deletions

View File

@ -43,7 +43,6 @@
#include <rte_bus_vdev.h>
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
#include <rte_mbuf_dyn.h>
/* 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);

View File

@ -40,7 +40,6 @@
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
#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,