From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13409454FF for ; Wed, 26 Jun 2024 10:48:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9417942E9B; Wed, 26 Jun 2024 10:48:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 113D040611; Wed, 26 Jun 2024 10:48:11 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45Q0jWHD002938; Wed, 26 Jun 2024 01:48:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=2 lmFfdQcgtt9pUcklFKdsv4MAdPM0+uCuR4jBphDoP4=; b=kS+yo3Jl0PYXJ5uyp AwZ4WsRd5Lx+eE+o3LzcHqh5DsZ1xuKOnqN8KQ0Zu/XHQEfvhDyD67JIWc6mFkzA PEM7jdTbzeBt7ahz0HyuI7gS8BWYeicTyN04qQFlQ9iVFE1b4gIqrfqQgbg3BFS0 5wEFqXTLaxNvYMQ4Y/RMT3vdl7oh00lHdBpQ5SYHSQhAMot6iM8ghDIGsKP7IAED mdls97YjUdrRaf30xJb4L1jWqXxTgxvSc7owhxLwTSMPkSwFqtEwYCUcx0e1h5p9 VmRBJzfwdEFrpu2l81E8/sQyFUHFrg2nAHYnNDR1ZWwzn5+IPi0qMtZZzfm8uSNx 5aHaQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4008qt984u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 01:48:10 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 01:48:10 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 01:48:10 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id CBB263F707B; Wed, 26 Jun 2024 01:48:07 -0700 (PDT) From: Gowrishankar Muthukrishnan To: , Ciara Power , Akhil Goyal , Kiran Kumar K CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH v2 3/6] app/crypto-perf: fix result location for asymmetric test Date: Wed, 26 Jun 2024 14:17:42 +0530 Message-ID: <20240626084747.1595-4-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20240626084747.1595-1-gmuthukrishn@marvell.com> References: <20240615115309.2678-1-gmuthukrishn@marvell.com> <20240626084747.1595-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: V4HzORs2_W_vPJAbjR1lqsrTwep1viQJ X-Proofpoint-GUID: V4HzORs2_W_vPJAbjR1lqsrTwep1viQJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_03,2024-06-25_01,2024-05-17_01 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org For asymmetric op, private test data should be stored after rte_crypto_asym_op struct. Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test") Cc: stable@dpdk.org Signed-off-by: Gowrishankar Muthukrishnan --- app/test-crypto-perf/cperf_test_common.c | 6 ++++-- app/test-crypto-perf/cperf_test_latency.c | 14 +++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 94d39fb177..6b8ab65731 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -149,11 +149,11 @@ cperf_alloc_common_memory(const struct cperf_options *options, int ret; /* Calculate the object size */ - uint16_t crypto_op_size = sizeof(struct rte_crypto_op) + - sizeof(struct rte_crypto_sym_op); + uint16_t crypto_op_size = sizeof(struct rte_crypto_op); uint16_t crypto_op_private_size; if (options->op_type == CPERF_ASYM_MODEX) { + crypto_op_size += sizeof(struct rte_crypto_asym_op); snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u", rte_socket_id()); *pool = rte_crypto_op_pool_create( @@ -170,6 +170,8 @@ cperf_alloc_common_memory(const struct cperf_options *options, return 0; } + crypto_op_size += sizeof(struct rte_crypto_sym_op); + /* * If doing AES-CCM, IV field needs to be 16 bytes long, * and AAD field needs to be long enough to have 18 bytes, diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index b8ad6bf4d4..376847e761 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -122,7 +122,11 @@ store_timestamp(struct rte_crypto_op *op, uint64_t timestamp) { struct priv_op_data *priv_data; - priv_data = (struct priv_op_data *) (op->sym + 1); + if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) + priv_data = (struct priv_op_data *) (op->sym + 1); + else + priv_data = (struct priv_op_data *) (op->asym + 1); + priv_data->result->status = op->status; priv_data->result->tsc_end = timestamp; } @@ -251,9 +255,13 @@ cperf_latency_test_runner(void *arg) ctx->res[tsc_idx].tsc_start = tsc_start; /* * Private data structure starts after the end of the - * rte_crypto_sym_op structure. + * rte_crypto_sym_op (or rte_crypto_asym_op) structure. */ - priv_data = (struct priv_op_data *) (ops[i]->sym + 1); + if (ops[i]->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) + priv_data = (struct priv_op_data *) (ops[i]->sym + 1); + else + priv_data = (struct priv_op_data *) (ops[i]->asym + 1); + priv_data->result = (void *)&ctx->res[tsc_idx]; tsc_idx++; } -- 2.25.1