From a831c318c54d388321a67bd3ad29366c02920eff Mon Sep 17 00:00:00 2001 From: Fiona Trahe Date: Thu, 6 Oct 2016 18:34:26 +0100 Subject: [PATCH] crypto/aesni_mb: free ring memory on queue release Free ring memory on queue_pair release, else releasing and setting up queue-pair of a different size fails. Signed-off-by: Fiona Trahe --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c index d3c46aceef..3d49e2aec8 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c @@ -311,8 +311,14 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev, static int aesni_mb_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { - if (dev->data->queue_pairs[qp_id] != NULL) { - rte_free(dev->data->queue_pairs[qp_id]); + struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id]; + struct rte_ring *r = NULL; + + if (qp != NULL) { + r = rte_ring_lookup(qp->name); + if (r) + rte_ring_free(r); + rte_free(qp); dev->data->queue_pairs[qp_id] = NULL; } return 0; -- 2.20.1