From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D9FD3F949 for ; Thu, 9 Feb 2017 12:52:34 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2017 03:52:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,349,1484035200"; d="scan'208";a="1092715104" Received: from gklab-246-019.igk.intel.com (HELO intel.com) ([10.217.246.19]) by orsmga001.jf.intel.com with SMTP; 09 Feb 2017 03:52:31 -0800 Received: by intel.com (sSMTP sendmail emulation); Thu, 09 Feb 2017 14:52:27 +0100 From: Slawomir Mrozowicz To: declan.doherty@intel.com Cc: dev@dpdk.org, Slawomir Mrozowicz Date: Thu, 9 Feb 2017 14:52:23 +0100 Message-Id: <1486648343-28944-1-git-send-email-slawomirx.mrozowicz@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: fix segmentation fault when use qat pmd 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: , X-List-Received-Date: Thu, 09 Feb 2017 11:52:35 -0000 Fix segmentation fault happened when use QAT PMD's kasumi, snow3g or zug algorithm to do cipher-then-auth performance test application. The mentioned algorithms required authentication key data be set value equal to cipher key data. Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Slawomir Mrozowicz --- app/test-crypto-perf/cperf_test_vectors.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c index e47a581..a27565f 100644 --- a/app/test-crypto-perf/cperf_test_vectors.c +++ b/app/test-crypto-perf/cperf_test_vectors.c @@ -439,14 +439,25 @@ cperf_test_vector_get_dummy(struct cperf_options *options) t_vec->aad.data = NULL; } else if (options->auth_algo == RTE_CRYPTO_AUTH_AES_GCM || options->auth_algo == - RTE_CRYPTO_AUTH_AES_GMAC || - options->auth_algo == + RTE_CRYPTO_AUTH_AES_GMAC) { + t_vec->auth_key.data = NULL; + t_vec->aad.data = rte_malloc(NULL, options->auth_aad_sz, + 16); + if (t_vec->aad.data == NULL) { + if (options->op_type != CPERF_AUTH_ONLY) + rte_free(t_vec->iv.data); + rte_free(t_vec); + return NULL; + } + memcpy(t_vec->aad.data, aad, options->auth_aad_sz); + } else if (options->auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2 || options->auth_algo == RTE_CRYPTO_AUTH_KASUMI_F9 || options->auth_algo == RTE_CRYPTO_AUTH_ZUC_EIA3) { - t_vec->auth_key.data = NULL; + /* auth key should be the same as cipher key */ + t_vec->auth_key.data = cipher_key; t_vec->aad.data = rte_malloc(NULL, options->auth_aad_sz, 16); if (t_vec->aad.data == NULL) { -- 2.5.0