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 7FE0443813; Thu, 4 Jan 2024 09:56:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4839340262; Thu, 4 Jan 2024 09:56:21 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) by mails.dpdk.org (Postfix) with ESMTP id 6958E4013F for ; Thu, 4 Jan 2024 09:56:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EMnRqYnk1jnY9xRTWHKXN7thGEEpWPFg5oHIaPfKDG+qr8fcEam/jCd6+0NWhZ5bjn+V2LILetBqlDha21L710Yvj9gu4/6anzfFRlQuhJLCHncpqXLfbs4O+n5Se8EPz8vWMEMaNWsWigaOCwmyvhW5/jladMnhvXJ017L2yJqb4L9PLqwqrMNFYxX9cPKCm4j4U3WC3A3bRE15zLimSDpWMyQbgsCVGcEozmrP7lw751QrRsFa3JbDYsOH7UMNErNRp6XGE7f6A/T99boV8yVBTQcNR2kD+6d02l2aHEsB0vTnUT7whvrvHI7ppdvYhTGai8XyKcRaMIdFMpz/qQ== 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=TO/wwIOSZK8/P8IGMNrp4MHsptqHx+6NmZJwR+HB4oo=; b=CH6+6AKhKdsi+YOuRNWjK4NhH62AJOrAKVIa15CSOYpjj4dtlk30/Cq75x9XL6pS/FFZrgNkw9hlyl2TOfeG22IjtkJbOWxeBlbjz0rzOBbrRd21rGhFlvJmV0VfcuyQxNY0ktDwuluoXk4uqHMsEXX+vdJXCRzuJDEp1N9zGMXEl5/c/lHw5dEKsTwg7gDHl/uFN3Nd+lyqMqqK5MkYlnlpsArkob+NJdI8IKvVbHWPvTaPo6bx7QJ8RD3sLYDmI4r+1bZ7tdeZ3seQxhde5dLJh2jPPnLxgiLx2Ek2xDu2XRmzG4kcWjVG2uxSs6jQrrwIXx4M8GRDp/wkKZkN2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=TO/wwIOSZK8/P8IGMNrp4MHsptqHx+6NmZJwR+HB4oo=; b=ca6CJmzIGUOTA/1Yo/QwFbSRGikKljvB+HGdbM3cW74XjOCYEcIDnvJ+b4fYZAJo+sZZC2meIidHSehWguHgX4xZVl8bX99o5XjxIJ+Fo3ZqqWUmBZfYz5eyITU/hkOXexz0H7fFYJ7BlX5MdsQyW4cb43BZfEFAdrQoEXIpuvgbEKwhheStYisJ9SErBghbfVa7cjxU6azH98e+PlYzEXHcpguuvb9PNg77yqeG2GIzhZejSpFiLPm4O7d1F+Ny5lzXe2YEmKTz0yDhfidt7k5o39y4gjPOF1td+8X0MtM3zzlVj3V5ay8r49mL0/Bog5GWHYZZQJ+kIA1uVqX84Q== Received: from CO6PR12MB5396.namprd12.prod.outlook.com (2603:10b6:303:139::8) by CY8PR12MB7436.namprd12.prod.outlook.com (2603:10b6:930:50::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13; Thu, 4 Jan 2024 08:56:17 +0000 Received: from CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::18b:c5f5:5d5:d9cc]) by CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::18b:c5f5:5d5:d9cc%7]) with mapi id 15.20.7159.015; Thu, 4 Jan 2024 08:56:16 +0000 From: Suanming Mou To: Anoob Joseph , Ciara Power CC: "dev@dpdk.org" Subject: RE: [EXT] [PATCH 2/2] app/test-crypto-perf: fix encrypt operation verify Thread-Topic: [EXT] [PATCH 2/2] app/test-crypto-perf: fix encrypt operation verify Thread-Index: AQHaPfjlySmCGzUI2E+jjck7R+Q/8rDJHXyAgAA+CeA= Date: Thu, 4 Jan 2024 08:56:16 +0000 Message-ID: References: <20240103035605.720256-1-suanmingm@nvidia.com> <20240103035605.720256-2-suanmingm@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR12MB5396:EE_|CY8PR12MB7436:EE_ x-ms-office365-filtering-correlation-id: 744757db-7f4c-4264-f510-08dc0d03032c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FTyhI/PRamfNN/R8v/q1zYzqbicPB/ieEVhRAuvbBP78PqXyRKaYPn3l+kyGxXwS0Xu/jYMbfTlL+gjsDmZ8hRlE4wSZpPRxUnwnjVXuph++aUY+R/vbxBmC+D+CO1r58EHFG1U40W73gb0/0jXf46la1StqcTpqcO7wXJhnQRY8jC7+36p82lIOe/lFRW47grDey18Un7lkvRYF8CEzpN0qqx7aa/qnX17TMg9J607uOGs9Up01DtOP6lQYogoLWq2Nmh5bLrFQkrplB46Q2eXH8CHnZJxi1pCkHKG6DDMCLo2FT2oCw2KCd5YVDUhPmrbHJpQKIN3e1G7PSApp607uqbLezebBvsoTviwDvrYTVUl/DGzMHhrBFoP85pR3Sp2Kojo7tDylUNefLH8afwH+PL70SeJaRbb/74HFCgIWKAxRsL1aTSs1rkWtGGjT12Vl2I+yD0zFNmu627vUB/k085RFhEjRqGSSnsngtQfKyeJdSeEDHulFqaAmBoqKRoaNPf6NaWt31XREi5rHwY3+EhhIu3Hf3U1epeFnrbrhnm0BuxJ8pBnJvq+BFM8S8uCLU+L/1yE+R43jNr0qXJGT3jb1zfeCeXxVD3C15FWXaJ8uSiRtWh7bcv3nN8xRzCx2SidzkVhzyV7FOc+H+TTygx1YuWde62+CI6KH8syVGIpttx2p9VG3o3qEVpUz x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR12MB5396.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(39860400002)(346002)(396003)(376002)(136003)(230273577357003)(230922051799003)(230173577357003)(64100799003)(186009)(1800799012)(451199024)(66476007)(4326008)(66446008)(64756008)(110136005)(8936002)(52536014)(66556008)(66946007)(76116006)(83380400001)(6506007)(71200400001)(7696005)(478600001)(53546011)(9686003)(316002)(8676002)(41300700001)(5660300002)(2906002)(15650500001)(26005)(33656002)(38070700009)(122000001)(38100700002)(86362001)(55016003)(309714004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oMy3qV2Zv8ogbFp/jboTuRmNUW/GTeNRv2AYoqNX/teoiR/vv5kD3z2wB/F+?= =?us-ascii?Q?dhIafhBwCAeQv1iOOmpwCIHMBiBT6c9KPW0mVg12IzlTnQajXCkeBV3obUcv?= =?us-ascii?Q?bXJbZfVbhx+R07ZsrKwvvOes4ijiaDphpkmEn/s0aKdwvjRmxyYPH6XdWaZo?= =?us-ascii?Q?I8gMvnKOUxkK4Xyo/OTrbRMacXXbDpoOgTt9IM+7tS/sBCNilsWLjyxu/oTa?= =?us-ascii?Q?gUsNzrvRfyAK0pdQkoRbfjGsvLNQX/yos1S58cCYIH9dKOwLaJBbWrr9xaI3?= =?us-ascii?Q?fE5I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?= =?us-ascii?Q?LcoBu1h7gIsuUUY1Hs3zrNnxiRoorwUQA3uw41vjliDy3yAbT3//rOYFq/VP?= =?us-ascii?Q?X+Cw3AG6y2bu8/501VsxDm4L1zxqVtJEolKx9np9Nknhf9p/aqFlaJp0crjl?= =?us-ascii?Q?ua4x0rLkR5P82yPLGOX9lpvaZnS/MD1a2E8xBwgba90p7LQ7zytYKp9QbMga?= =?us-ascii?Q?h6P6kW/5tDyrcIbb+gHqFJPjzmjSVixBfIy5biES0F4UsuxBFUEwP35t2hfy?= =?us-ascii?Q?boFmbmPprej0Y5PArGFH7CJzmQS27dIysv0hxqJcGPYyyzpG6IWErIph/zzf?= =?us-ascii?Q?CDavEZ4y0zt8HZk2WToHyGPcur+zTo0VAq6sXBrxrrfjNoIGxobE1/wAhIRn?= =?us-ascii?Q?CJgLpBi6icOX7cRQ/YR0+wiMfLovElsy7TKZI3TM?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5396.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 744757db-7f4c-4264-f510-08dc0d03032c X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2024 08:56:16.8770 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uT/7HkgxBW/wp/wZ37X5KSiHJOtknrgC/GK9pLR1+dsbTtTs6aLs8vMATSgwfLOM1vGjFRu+PXRLAt28u/alPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7436 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 Hi, > -----Original Message----- > From: Anoob Joseph > Sent: Thursday, January 4, 2024 1:13 PM > To: Suanming Mou ; Ciara Power > > Cc: dev@dpdk.org > Subject: RE: [EXT] [PATCH 2/2] app/test-crypto-perf: fix encrypt operatio= n verify >=20 > Hi Suanming, >=20 > Please see inline. >=20 > Thanks, > Anoob >=20 > > -----Original Message----- > > From: Suanming Mou > > Sent: Wednesday, January 3, 2024 9:26 AM > > To: Ciara Power > > Cc: dev@dpdk.org > > Subject: [EXT] [PATCH 2/2] app/test-crypto-perf: fix encrypt operation > > verify > > > > External Email > > > > ---------------------------------------------------------------------- > > AEAD users RTE_CRYPTO_AEAD_OP_* with aead_op and CIPHER uses > [Anoob] users -> uses >=20 > > 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 =3D false; > > int res =3D 0; > > > > if (op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) @@ -154,12 > > +155,14 @@ cperf_verify_op(struct rte_crypto_op *op, > > cipher_offset =3D 0; > > auth =3D 0; > > auth_offset =3D 0; > > + is_encrypt =3D options->cipher_op =3D=3D > > RTE_CRYPTO_CIPHER_OP_ENCRYPT; > > break; > > case CPERF_CIPHER_THEN_AUTH: > > cipher =3D 1; > > cipher_offset =3D 0; > > auth =3D 1; > > auth_offset =3D options->test_buffer_size; > > + is_encrypt =3D options->cipher_op =3D=3D > > RTE_CRYPTO_CIPHER_OP_ENCRYPT; > > break; > > case CPERF_AUTH_ONLY: > > cipher =3D 0; > > @@ -172,12 +175,14 @@ cperf_verify_op(struct rte_crypto_op *op, > > cipher_offset =3D 0; > > auth =3D 1; > > auth_offset =3D options->test_buffer_size; > > + is_encrypt =3D options->cipher_op =3D=3D > > RTE_CRYPTO_CIPHER_OP_ENCRYPT; > > break; > > case CPERF_AEAD: > > cipher =3D 1; > > cipher_offset =3D 0; > > - auth =3D 1; > > + auth =3D options->aead_op =3D=3D RTE_CRYPTO_AEAD_OP_ENCRYPT; > > auth_offset =3D options->test_buffer_size; > > + is_encrypt =3D !!auth; > > break; > > default: > > res =3D 1; > > @@ -185,7 +190,7 @@ cperf_verify_op(struct rte_crypto_op *op, > > } > > > > if (cipher =3D=3D 1) { > > - if (options->cipher_op =3D=3D RTE_CRYPTO_CIPHER_OP_ENCRYPT) > > + if (is_encrypt) >=20 > [Anoob] A similar check is there under 'auth =3D=3D 1' check, right? Won'= t that also > need fixing? >=20 > if (auth =3D=3D 1) { > if (options->auth_op =3D=3D RTE_CRYPTO_AUTH_OP_GENERATE) >=20 > I think some renaming of the local variables might make code better. > bool cipher, digest_verify =3D false, is_encrypt =3D false; >=20 > case CPERF_CIPHER_THEN_AUTH: > cipher =3D true; > cipher_offset =3D 0; > if (options->cipher_op =3D=3D RTE_CRYPTO_CIPHER_OP_ENCRYPT) { > is_encrypt =3D true; > digest_verify =3D true; /* Assumption - options->auth_op > =3D=3D RTE_CRYPTO_AUTH_OP_GENERATE is verified elsewhere */ > auth_offset =3D options->test_buffer_size; > } > break; > <...> > case CPERF_AEAD: > cipher =3D true; > cipher_offset =3D 0; > if (options->aead_op =3D=3D RTE_CRYPTO_AEAD_= OP_ENCRYPT) { > is_encrypt =3D true; > digest_verify =3D true; > auth_offset =3D options->test_buffer_size; > } >=20 > What do you think? Yes, so we can totally remove the auth for now. I will do that. Thanks for = the suggestion. >=20 > > res +=3D !!memcmp(data + cipher_offset, > > vector->ciphertext.data, > > options->test_buffer_size); > > -- > > 2.34.1