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 11B5A43804; Wed, 3 Jan 2024 04:56:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A1F840648; Wed, 3 Jan 2024 04:56:48 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2053.outbound.protection.outlook.com [40.107.220.53]) by mails.dpdk.org (Postfix) with ESMTP id 016BA40648 for ; Wed, 3 Jan 2024 04:56:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VoccPhvzonw9BazUh3wQnpO2K+QAoWXXL9KsjaACmloHz5OEefSOfzSP/ccCfMD4NCetWe4BTtDIauuE3MxKZIfpfd0bgY7r7ha66ErdPvtjPveCNudddHEzwmvTKseGn7BHRIlT5wRgfa1ewnua/8zCjRXlwTy8IM/WL0eEnj3AKE6kaA60589ERZO+fB39Z5OywUppu5wrwtTh/Eo9ati665CcKaKLNhxEJR2eInvvIUbDYfpLoPW6QrY3jSdO7xoYuUwfKlklFZ/uOhi+ygZZb0aO8gGnQ6qAl0/bgIkEyYumqAPd4ROTO5K8UsPlBl/8MURiX6TZE/tCq/+rcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iB4HvWoKgkiSPa/wFOoaiylbVzJXRIqdHj4ZtjjnauA=; b=bU9B4WseQunNEFyeQix9klEsNI53YiuuZs8Bdj7M71csK6yEO8sPi8be/kNaAx7316dCkTR9fNdgNWbBU7RV1CmxUQ+K1qr/fkKB8FvLGa/9RhYzDZEhBMuCcldo4bhXr5p/kbEC2j/1nX8Fo9KxrcorXbGXFI9qK1OfCbO4aHkGqqC3vc+buMbFf9ygTi7VNqZedUSkqj/lLJCDR3pq5Yc8JcfadBk4a8ZU7Nrxxvo9RESV9ndhwNdUgjkdyrAKxbWIxcHJMoiSC8pCfDx/ZdrjxvBiplktVokXIbrpOe4UdjQ3BXaYvZxK8BG8FVGIe4WjU/CUQHxnW2kUDzwqgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iB4HvWoKgkiSPa/wFOoaiylbVzJXRIqdHj4ZtjjnauA=; b=Rqvi2ycKdBq+5NwqYf7ycYZj13/gQ21uNuAfST98OGHx8a+wXdAvCWsB+QbL6CSlKux2+aWp6kGsPDZA5PM0maQtyJJD3Szh1AyLk9VaP714IpFkhuWX39IC7LUdwhlGoqCzT1wvZl1UnQPtiiNEIsylkdc1HyddaPLbyBTFzFpntY3uh73990PcBOL/P5B2eHIggG/d4uOa2aitBX865/6jFkqmkF6gWsYVg45pmeR0jynIvr+mOwo6nEKTSQjOK9KmMNoyIJwSAU2wAGXZMOoarjKpebNkwv27nFRQTB9nJ4dWelHQz8M/nXLdraagDAl34zfgUXogpyPtPlfKrg== Received: from BLAPR03CA0054.namprd03.prod.outlook.com (2603:10b6:208:32d::29) by SN7PR12MB7321.namprd12.prod.outlook.com (2603:10b6:806:298::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 3 Jan 2024 03:56:44 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:32d:cafe::8c) by BLAPR03CA0054.outlook.office365.com (2603:10b6:208:32d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25 via Frontend Transport; Wed, 3 Jan 2024 03:56:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Wed, 3 Jan 2024 03:56:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 2 Jan 2024 19:56:24 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 2 Jan 2024 19:56:22 -0800 From: Suanming Mou To: Ciara Power CC: Subject: [PATCH 2/2] app/test-crypto-perf: fix encrypt operation verify Date: Wed, 3 Jan 2024 11:56:05 +0800 Message-ID: <20240103035605.720256-2-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240103035605.720256-1-suanmingm@nvidia.com> References: <20240103035605.720256-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|SN7PR12MB7321:EE_ X-MS-Office365-Filtering-Correlation-Id: 50bb40e1-23d1-4201-1b50-08dc0c100036 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ihyT14E4sOgNs87Y3merdx9QUkV5D+UEwkx5Y/FCG0BW5h12vXGJQtgWXz2prncY4u0edERZeEZRGvfI/703xqxhg3a9QW4culTMyLQLJuOylpFcMO33Y9R40pb2H/luG3nASAMbmKk7VIHn7PZemJ17DCSDicVHXsEeLJUHeUMgbu7zb6Luft3I0NgDT90/7/69BIV1bs4/I3i+oDaDKVnDbMLnX2KxGV5bFHQoXJQMmejRoEzi4hEQKIC8kRekkxyptl5v++LwDrizeUrfVBWit6/a10HyNlh6O/OLVzZjM2xq+9sc1+muKpApTh+4uNafzdemE+Q/AqLvCygzMSKyvqHlzXkGq/iNkMBIEtqnsYWBA8TtioQQXNjGcuc4zV2V9Ub1OXzbgDkYG6Hjl8Sp7JKLCphB8VAHpoet5R/HFsL9HkhTqDQ7OgEMN1QBCda8F0mAlBGb42t2V3sg6Z075VorhbgtZWv6WmYN8vs3wtiNux9yc5W6SND/YPtAXnC+CM9LEcCxEgJz0cf/zBeE15pYuzoneKcW49nO9iPb703SZizlHQHQ50xGO4cgYZmQlIwLPtxsVvB48whb+D6norgxTkFS7XGJRzRGtKAg7yimR5DfZ6D8EkOiaohwaibLVgkGbIWLt1ZPzqXTQBFQI7MvHwHAevvzCUuOvME09kfTsx4N0pzD91mOWc/gS44z3tfMkPHgkQOpCJBUiC0L3Jh9YZKacDETIKI+32OW9+8FxgPgdnH6Sz3XbxtCDUKu+c7TrUqosDbiEMqkyw== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(396003)(346002)(376002)(230922051799003)(82310400011)(451199024)(186009)(64100799003)(1800799012)(40470700004)(36840700001)(46966006)(7636003)(82740400003)(2906002)(15650500001)(36756003)(356005)(86362001)(41300700001)(6916009)(70206006)(316002)(40480700001)(16526019)(70586007)(83380400001)(6286002)(2616005)(7696005)(478600001)(26005)(55016003)(1076003)(8936002)(6666004)(336012)(40460700003)(426003)(8676002)(4326008)(47076005)(36860700001)(5660300002)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 03:56:44.0292 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50bb40e1-23d1-4201-1b50-08dc0c100036 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7321 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org AEAD users 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 --- app/test-crypto-perf/cperf_test_verify.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 8aa714b969..525a2b1373 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -113,6 +113,7 @@ cperf_verify_op(struct rte_crypto_op *op, uint8_t *data; uint32_t cipher_offset, auth_offset; uint8_t cipher, auth; + bool is_encrypt = false; int res = 0; if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) @@ -154,12 +155,14 @@ cperf_verify_op(struct rte_crypto_op *op, cipher_offset = 0; auth = 0; auth_offset = 0; + is_encrypt = options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT; 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; @@ -172,12 +175,14 @@ cperf_verify_op(struct rte_crypto_op *op, cipher_offset = 0; auth = 1; auth_offset = options->test_buffer_size; + is_encrypt = options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT; break; case CPERF_AEAD: cipher = 1; cipher_offset = 0; - auth = 1; + auth = options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT; auth_offset = options->test_buffer_size; + is_encrypt = !!auth; break; default: res = 1; @@ -185,7 +190,7 @@ cperf_verify_op(struct rte_crypto_op *op, } if (cipher == 1) { - if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) + if (is_encrypt) res += !!memcmp(data + cipher_offset, vector->ciphertext.data, options->test_buffer_size); -- 2.34.1