crypto/aesni_mb: fix queue pair free
authorFan Zhang <roy.fan.zhang@intel.com>
Tue, 16 Oct 2018 09:45:54 +0000 (10:45 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Mon, 12 Nov 2018 12:41:58 +0000 (13:41 +0100)
This patch fixes the queue pair free for AESNI-MB PMD. Originally
the queue pair ring name are different than the object name,
caused the aesni_mb_pmd_qp_release() cannot find the ring to
release. This patch uses the same name between queue pair object
name and ring name.

Fixes: a831c318c54d ("crypto/aesni_mb: free ring memory on queue release")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c

index 43f6c26..f3eff26 100644 (file)
@@ -535,14 +535,12 @@ aesni_mb_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 /** Create a ring to place processed operations on */
 static struct rte_ring *
 aesni_mb_pmd_qp_create_processed_ops_ring(struct aesni_mb_qp *qp,
-               const char *str, unsigned int ring_size, int socket_id)
+               unsigned int ring_size, int socket_id)
 {
        struct rte_ring *r;
        char ring_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 
-       unsigned int n = snprintf(ring_name, sizeof(ring_name),
-                               "%s_%s",
-                               qp->name, str);
+       unsigned int n = snprintf(ring_name, sizeof(ring_name), "%s", qp->name);
 
        if (n >= sizeof(ring_name))
                return NULL;
@@ -600,7 +598,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
        qp->op_fns = &job_ops[internals->vector_mode];
 
        qp->ingress_queue = aesni_mb_pmd_qp_create_processed_ops_ring(qp,
-                       "ingress", qp_conf->nb_descriptors, socket_id);
+                       qp_conf->nb_descriptors, socket_id);
        if (qp->ingress_queue == NULL) {
                ret = -1;
                goto qp_setup_cleanup;