X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=app%2Ftest-crypto-perf%2Fcperf_test_pmd_cyclecount.c;h=4e67d3aebdc8f7c18b968b6adfc495ed52b35fdb;hb=439009e4ef3469ff1cd68d4ec71ca922f3a6d68f;hp=74371faa8d27eef651e31b282e28afaf0eecde55;hpb=90e03347ca7d6d1a0e1b85d71d71ec5ae3b17a90;p=dpdk.git diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c index 74371faa8d..4e67d3aebd 100644 --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c @@ -59,23 +59,36 @@ static const uint16_t iv_offset = static void cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx) { - if (ctx) { - if (ctx->sess) { + if (!ctx) + return; + + if (ctx->sess) { +#ifdef RTE_LIB_SECURITY + if (ctx->options->op_type == CPERF_PDCP || + ctx->options->op_type == CPERF_DOCSIS) { + struct rte_security_ctx *sec_ctx = + (struct rte_security_ctx *) + rte_cryptodev_get_sec_ctx(ctx->dev_id); + rte_security_session_destroy(sec_ctx, + (struct rte_security_session *)ctx->sess); + } else +#endif + { rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess); rte_cryptodev_sym_session_free(ctx->sess); } + } - if (ctx->pool) - rte_mempool_free(ctx->pool); + if (ctx->pool) + rte_mempool_free(ctx->pool); - if (ctx->ops) - rte_free(ctx->ops); + if (ctx->ops) + rte_free(ctx->ops); - if (ctx->ops_processed) - rte_free(ctx->ops_processed); + if (ctx->ops_processed) + rte_free(ctx->ops_processed); - rte_free(ctx); - } + rte_free(ctx); } void *