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 4641243C60 for ; Thu, 7 Mar 2024 02:35:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B2A042EF9; Thu, 7 Mar 2024 02:35:20 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id 8564642EE3 for ; Thu, 7 Mar 2024 02:35:18 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33e2268ed96so255294f8f.3 for ; Wed, 06 Mar 2024 17:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775318; x=1710380118; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oWwqtuhb3GEDRwSWMVjCbyYaAEfQygeap+65UH4Ckr8=; b=E1G0/Qx9230PilscasA47aoJ8xyFC0TDkOKZlHKEEvLojXsvdtAE4L+FAWvHU+vpIV rr0afuw0MH/nOGhN+BxubLmYf9CQz250he0ZLceeTftFK+moyuPkCuWP81cg9x7cIbSr s56oKaL+5YoLDXHt6b7mvwa9BwtbtQHn/wf/U4Ziiwl+pIe6SyNzKgAeHfIYuyeLEJl7 520qctaKr+bwQ2RbN8yLkuwt8dBfpmqKx80D18AIOdLiPfXqutotYt2AVt6ySQP8NF4+ Dsz9i0UEEcmqvTcTbuXDWzbeGq1jfJmUsbqJOy5+T5eL87EbELP7uZ/GePEeETqFVWje 6HRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775318; x=1710380118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oWwqtuhb3GEDRwSWMVjCbyYaAEfQygeap+65UH4Ckr8=; b=TDbdxsyIM+OM15kxsd/MCPBF7GSIqoOPlKhzrGH30KRAbkHAvA8jkqZsExGRWRHJtg ysdX2+wVTdM5e0TY2XbiKHfrbWnnyTeSHGxVp2TBCVoBkLK5YJmoAiAonEV+HW4OAdHU msK0MltKGiA90otc5TNMkicQ07klPK5+RiSqTL53rVFdQ7xHOs4/LP/qrOnJcjELqKqR vti4te1RLlCdXxbuHE7AKdy9cXdtJ6mKmLJCjtelaDHIRzAycxyQXlmInaAVY9IwiGnY kReRp8BQCyxyBMVtYWVdB1dDwmc3CyG1yDtVCs+6Jf6lEmau+5QgCsbvlBpw187bRfZh ReuA== X-Forwarded-Encrypted: i=1; AJvYcCUGITVg4oQE6P9nY86YCUBm5hBF6wf3e275NTPAbC3BDC+Lu9WF2PGU0tDBKe7UDk3KAQOlVHb9PEartg+ejoM= X-Gm-Message-State: AOJu0YyjRKxxDqdymRZq+NEPKgKPmE8MNO8iHPkCHGIY8/dv/N7KiRD1 e7yJ0mxsxFvg1UsC3krMlIfRbISpIHSH+YdEiHsojzzKTSKYNmjR X-Google-Smtp-Source: AGHT+IEX5ghtupxoawu0jw4mRV35t9kZRBJLwh6h3d8+cs9O3Y1f8VOToZ1qFTbm3Lu5JBowY0MP+Q== X-Received: by 2002:adf:cf0e:0:b0:33e:21e:26aa with SMTP id o14-20020adfcf0e000000b0033e021e26aamr12522362wrj.7.1709775318231; Wed, 06 Mar 2024 17:35:18 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id j3-20020adff003000000b0033e01e397d6sm18813508wro.54.2024.03.06.17.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:35:17 -0800 (PST) From: luca.boccassi@gmail.com To: Suanming Mou Cc: Anoob Joseph , dpdk stable Subject: patch 'app/crypto-perf: fix encrypt operation verification' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:31:11 +0000 Message-Id: <20240307013159.1735343-54-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.5 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/09/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/7c0e5bd8ed2cbed7f2adde948210bb768e447976 Thanks. Luca Boccassi --- >From 7c0e5bd8ed2cbed7f2adde948210bb768e447976 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 02e90941ce..5a963fa3cc 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -111,8 +111,10 @@ cperf_verify_op(struct rte_crypto_op *op, uint32_t len; 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; if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) @@ -150,42 +152,43 @@ 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: res = 1; goto out; } - 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, options->test_buffer_size); @@ -195,12 +198,8 @@ cperf_verify_op(struct rte_crypto_op *op, options->test_buffer_size); } - 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: rte_free(data); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:39.494804725 +0000 +++ 0054-app-crypto-perf-fix-encrypt-operation-verification.patch 2024-03-07 01:05:34.806940186 +0000 @@ -1 +1 @@ -From 7d55ca15124c47561120d23d5023843ad99c1a81 Mon Sep 17 00:00:00 2001 +From 7c0e5bd8ed2cbed7f2adde948210bb768e447976 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 02e90941ce..5a963fa3cc 100644