crypto/aesni_mb: free ring memory on queue release
authorFiona Trahe <fiona.trahe@intel.com>
Thu, 6 Oct 2016 17:34:26 +0000 (18:34 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Sat, 8 Oct 2016 15:54:38 +0000 (17:54 +0200)
Free ring memory on queue_pair release, else
releasing and setting up queue-pair of a different size fails.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c

index d3c46ac..3d49e2a 100644 (file)
@@ -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;