[dpdk-dev,09/11] crypto/ccp: update queue-pair release to enable reset

Message ID 1512047553-118101-9-git-send-email-Ravi1.kumar@amd.com
State Changes Requested, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Kumar, Ravi1 Nov. 30, 2017, 1:12 p.m.
Signed-off-by: Ravi Kumar <Ravi1.kumar@amd.com>
---
 drivers/crypto/ccp/ccp_pmd_ops.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c
index 9e94dcf..daeb59c 100644
--- a/drivers/crypto/ccp/ccp_pmd_ops.c
+++ b/drivers/crypto/ccp/ccp_pmd_ops.c
@@ -647,8 +647,13 @@  ccp_pmd_info_get(struct rte_cryptodev *dev,
 static int
 ccp_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 {
+	struct ccp_qp *qp;
+
 	if (dev->data->queue_pairs[qp_id] != NULL) {
-		rte_free(dev->data->queue_pairs[qp_id]);
+		qp = (struct ccp_qp *)dev->data->queue_pairs[qp_id];
+		rte_ring_free(qp->processed_pkts);
+		rte_mempool_free(qp->batch_mp);
+		rte_free(qp);
 		dev->data->queue_pairs[qp_id] = NULL;
 	}
 	return 0;