app/test: fix qat autotest failure
authorDeepak Kumar Jain <deepak.k.jain@intel.com>
Tue, 1 Mar 2016 16:55:16 +0000 (16:55 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 10 Mar 2016 21:50:48 +0000 (22:50 +0100)
This patch fix the QAT autotest failure when run for multiple times.
it was caused as mbuf was not freed.

Fixes: 202d375c60b (app/test: add cryptodev unit and performance tests)

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
app/test/test_cryptodev.c

index 3240ecd..b247a69 100644 (file)
@@ -1844,6 +1844,18 @@ test_multi_session(void)
                                sessions[i], ut_params, ts_params),
                                "Failed to perform decrypt on request "
                                "number %u.", i);
+               /* free crypto operation structure */
+               if (ut_params->op)
+                       rte_crypto_op_free(ut_params->op);
+
+               /*
+                * free mbuf - both obuf and ibuf are usually the same,
+                * but rte copes even if we call free twice
+                */
+               if (ut_params->obuf) {
+                       rte_pktmbuf_free(ut_params->obuf);
+                       ut_params->obuf = 0;
+               }
        }
 
        /* Next session create should fail */