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 D8F4043829 for ; Tue, 5 Mar 2024 16:35:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3F0D42E14; Tue, 5 Mar 2024 16:35:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E6B42402AF for ; Tue, 5 Mar 2024 16:35:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709652946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x7knThtB77XXCjnkKwS9DxfImoyuW/jfIK3h06POeQI=; b=KuZRYDPvOyrs8BkkhPSepcnQDvd3G4tNPfYZu0/vSCJ1B9S4H787+LXxaM3G4SQRS3g9pW T69ZJS5QhbMw5AyRbUQ5ZGnY/rBAh//uiOAhXKqDH0uTV3k0zcCUbogmCiVeJckfGzxeFK VLZDn9H/zZTTBd3upuZAK7iFEBG5yAw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-_bbv9V3CMtSx3ESPEGVmCQ-1; Tue, 05 Mar 2024 10:35:43 -0500 X-MC-Unique: _bbv9V3CMtSx3ESPEGVmCQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FE71101A523; Tue, 5 Mar 2024 15:35:43 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DB37200B01D; Tue, 5 Mar 2024 15:35:42 +0000 (UTC) From: Kevin Traynor To: Suanming Mou Cc: Anoob Joseph , dpdk stable Subject: patch 'app/crypto-perf: fix encrypt operation verification' has been queued to stable release 21.11.7 Date: Tue, 5 Mar 2024 15:34:08 +0000 Message-ID: <20240305153449.263666-35-ktraynor@redhat.com> In-Reply-To: <20240305153449.263666-1-ktraynor@redhat.com> References: <20240305153449.263666-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/11/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/33266c133110744050d629007949033f977c7235 Thanks. Kevin --- >From 33266c133110744050d629007949033f977c7235 Mon Sep 17 00:00:00 2001 From: Suanming Mou Date: Fri, 5 Jan 2024 08:03:23 +0800 Subject: [PATCH] app/crypto-perf: fix encrypt operation verification [ upstream commit 7d55ca15124c47561120d23d5023843ad99c1a81 ] AEAD uses RTE_CRYPTO_AEAD_OP_* with aead_op and CIPHER uses RTE_CRYPTO_CIPHER_OP_* with cipher_op in current code. This commit aligns aead_op and cipher_op operation to fix incorrect AEAD verification. Fixes: df52cb3b6e13 ("app/crypto-perf: move verify as single test type") Signed-off-by: Suanming Mou Acked-by: Anoob Joseph --- app/test-crypto-perf/cperf_test_verify.c | 55 ++++++++++++------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 372d1560e3..5574429196 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -101,6 +101,8 @@ cperf_verify_op(struct rte_crypto_op *op, uint16_t nb_segs; uint8_t *data; - uint32_t cipher_offset, auth_offset; - uint8_t cipher, auth; + uint32_t cipher_offset, auth_offset = 0; + bool cipher = false; + bool digest_verify = false; + bool is_encrypt = false; int res = 0; @@ -140,32 +142,33 @@ cperf_verify_op(struct rte_crypto_op *op, switch (options->op_type) { case CPERF_CIPHER_ONLY: - cipher = 1; + cipher = true; cipher_offset = 0; - auth = 0; - auth_offset = 0; - break; - case CPERF_CIPHER_THEN_AUTH: - cipher = 1; - cipher_offset = 0; - auth = 1; - auth_offset = options->test_buffer_size; + is_encrypt = options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT; break; case CPERF_AUTH_ONLY: - cipher = 0; cipher_offset = 0; - auth = 1; - auth_offset = options->test_buffer_size; + if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE) { + auth_offset = options->test_buffer_size; + digest_verify = true; + } break; + case CPERF_CIPHER_THEN_AUTH: case CPERF_AUTH_THEN_CIPHER: - cipher = 1; + cipher = true; cipher_offset = 0; - auth = 1; - auth_offset = options->test_buffer_size; + if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) { + auth_offset = options->test_buffer_size; + digest_verify = true; + is_encrypt = true; + } break; case CPERF_AEAD: - cipher = 1; + cipher = true; cipher_offset = 0; - auth = 1; - auth_offset = options->test_buffer_size; + if (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) { + auth_offset = options->test_buffer_size; + digest_verify = true; + is_encrypt = true; + } break; default: @@ -174,6 +177,6 @@ cperf_verify_op(struct rte_crypto_op *op, } - if (cipher == 1) { - if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) + if (cipher) { + if (is_encrypt) res += !!memcmp(data + cipher_offset, vector->ciphertext.data, @@ -185,10 +188,6 @@ cperf_verify_op(struct rte_crypto_op *op, } - if (auth == 1) { - if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE) - res += !!memcmp(data + auth_offset, - vector->digest.data, - options->digest_sz); - } + if (digest_verify) + res += !!memcmp(data + auth_offset, vector->digest.data, options->digest_sz); out: -- 2.43.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 14:08:55.509548391 +0000 +++ 0035-app-crypto-perf-fix-encrypt-operation-verification.patch 2024-03-05 14:08:54.650520765 +0000 @@ -1 +1 @@ -From 7d55ca15124c47561120d23d5023843ad99c1a81 Mon Sep 17 00:00:00 2001 +From 33266c133110744050d629007949033f977c7235 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7d55ca15124c47561120d23d5023843ad99c1a81 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 8aa714b969..2b0d3f142b 100644 +index 372d1560e3..5574429196 100644 @@ -25 +26 @@ -@@ -112,6 +112,8 @@ cperf_verify_op(struct rte_crypto_op *op, +@@ -101,6 +101,8 @@ cperf_verify_op(struct rte_crypto_op *op, @@ -36 +37 @@ -@@ -151,32 +153,33 @@ cperf_verify_op(struct rte_crypto_op *op, +@@ -140,32 +142,33 @@ cperf_verify_op(struct rte_crypto_op *op, @@ -88 +89 @@ -@@ -185,6 +188,6 @@ cperf_verify_op(struct rte_crypto_op *op, +@@ -174,6 +177,6 @@ cperf_verify_op(struct rte_crypto_op *op, @@ -97 +98 @@ -@@ -196,10 +199,6 @@ cperf_verify_op(struct rte_crypto_op *op, +@@ -185,10 +188,6 @@ cperf_verify_op(struct rte_crypto_op *op,