From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13644A0526; Tue, 21 Jul 2020 17:21:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D26401BFF9; Tue, 21 Jul 2020 17:21:34 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id F25C21BFEB for ; Tue, 21 Jul 2020 17:21:32 +0200 (CEST) IronPort-SDR: B4GqSkdJz1ERFoiS6SXyRxp9jPPA+VUQlnBia1KYxYQQZsdT9XwqtZhw6Dq7oyzIbvfPDgRVs+ YdB3VDLtQLXg== X-IronPort-AV: E=McAfee;i="6000,8403,9689"; a="168292209" X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="168292209" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2020 08:21:31 -0700 IronPort-SDR: 4f6+yTfE7U5KLajerYmkoTNVfSxp0EmntXDxZcDoG+pBudaAEhZ5CWP/9D+xlMpLEetTYQyYC/ wIuaT8jxYj9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="271743508" Received: from silpixa00399912.ir.intel.com (HELO silpixa00399912.ger.corp.intel.com) ([10.237.223.64]) by fmsmga008.fm.intel.com with ESMTP; 21 Jul 2020 08:21:30 -0700 From: David Coyle To: akhil.goyal@nxp.com, declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com Cc: dev@dpdk.org, brendan.ryan@intel.com, mairtin.oloingsigh@intel.com, David Coyle Date: Tue, 21 Jul 2020 15:56:48 +0100 Message-Id: <20200721145648.29168-1-david.coyle@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200720153909.18552-1-david.coyle@intel.com> References: <20200720153909.18552-1-david.coyle@intel.com> Subject: [dpdk-dev] [PATCH v2] app/crypto-perf: support security protocol in PMDCC mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds support for DOCSIS and PDCP security protocols to the pmd-cyclecount mode of the crypto performance tool. Adding this support involves freeing the correct session type (i.e. security or cryptodev session) when the test ends, depending on the op_type specified. Signed-off-by: David Coyle --- v2: * Fixing typo in commit message (specified) .../cperf_test_pmd_cyclecount.c | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c index 74371faa8..69f0943d1 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_LIBRTE_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 * -- 2.17.1