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 8210EA0C4B; Tue, 9 Nov 2021 01:52:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F23440687; Tue, 9 Nov 2021 01:52:59 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 9881140151 for ; Tue, 9 Nov 2021 01:52:56 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10162"; a="318551499" X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="318551499" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2021 16:52:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,218,1631602800"; d="scan'208";a="451738826" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga003.jf.intel.com with ESMTP; 08 Nov 2021 16:52:55 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 8 Nov 2021 16:52:54 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 8 Nov 2021 16:52:54 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.45) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 8 Nov 2021 16:52:54 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X2Grc36aidYXASSxGTDqt+cJNX9CDEUhN5bgsBOHn0zLGu9GQExPq7ZlaFm56nKmXgDJ/BNa84/0Qm+X9N4Evt6GcjykUCHBq5lJMI3KpheUCfP2+6XNZeaOOwdl+wwXNBHTAfjczvImSJWCNxDAR1jh40SPHw4hy9Ajm9nXvvINvlgaLXuzTvx11UJ2x2Yf24HmPaPgCGeks6FEIVs9IhDkyGtFE4FCVSzGMpQLE4VhszTChDloQzKrkiIN1cVRvPHEAMBc6rJg7x7fjw/es/nqMlUnkEx0A2dGlbTUODbw9NzRF0sGRvoIRkVxE7qi72rnbvC6sYWVWuMUAaqe5g== 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=P0L8WfvlkvxTpZY08DutZ3SfYwjsHMOkC8HbhtTrvpY=; b=Zvd9Yo6ACtibExPeBGeuaihQifU2yVWeiQdEGFj0sB6uc/I/Cd8AnHYu5xrOEM17Z2nQivldXnhCcUj0BpEIH5PEPTjvzdogtMHS8J570lPXHQIL1ijtDi76f7qBhN6LBVGRcsfGcB6Ss+LMfYU84bR0ih5ctXIL/96PhXLJWXwyldQAHfEzmZhtPNwHSHe5weBjNXKwM15+1cwxOB72/RVFvsO6I9vUFSvQhfAp9j4zHrOOh0Mt/MDw/ndTpZRGXTXyRAoFOX6yJP+bgjWYAStqrNd+KCqr0yQm/ouHElNrN7B0ZP2P/uLP3miAT70fUcAybBCmxJRBZ7D6bkrzbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P0L8WfvlkvxTpZY08DutZ3SfYwjsHMOkC8HbhtTrvpY=; b=v8mJqzkIYSAqc5NbB5p9CMfnxaEyhl5VvBn+iG7WOXCDU3Ke5gJpOEUrxtM9ALwvJCTIJw/wDUQgi4MOt5jXvxTi7ZeYRo0w3vRLgAek6r1+XUBaB/dzYESVwU+fjLFXZm6mp0cpfjQrChnd6ZTt7T1WwzEMEsUOucdLiYrKXhM= Received: from SN6PR11MB3408.namprd11.prod.outlook.com (2603:10b6:805:bc::22) by SN6PR11MB2557.namprd11.prod.outlook.com (2603:10b6:805:56::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Tue, 9 Nov 2021 00:52:51 +0000 Received: from SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::990:798c:6e6d:1d72]) by SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::990:798c:6e6d:1d72%4]) with mapi id 15.20.4669.016; Tue, 9 Nov 2021 00:52:51 +0000 From: "Ji, Kai" To: Anoob Joseph , "dev@dpdk.org" , "Akhil Goyal" CC: "De Lara Guarch, Pablo" , "adamx.dybkowski@intel.com" , "Zhang, Roy Fan" Thread-Topic: [dpdk-dev] [EXT] [dpdk-dev v1] test/cryptodev: fix incomplete data length Thread-Index: AQHX1Fmd4JESgTLM6U+g4VAUVlFglKv6W1QA Date: Tue, 9 Nov 2021 00:52:51 +0000 Message-ID: References: <20211105154204.7191-1-kai.ji@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4849ea94-c6c6-400d-a5b6-08d9a31b41e9 x-ms-traffictypediagnostic: SN6PR11MB2557: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H2j6YKxDcuEXLe6n0CRWg5H9/+sRvXkPeI3ivS2o/V7oV1T8YuGEH2Sas358W9/TkHV0oEBXU7ikUnlqlbSbUEI36hOdFDPL7pKfZZaIi/GROx3m2386hZOINSkJ6jkRUkeDt+RdMGON4S91DCVrAYboqVwYeMtLVllx7/7ajupuYiLRVgNTuukfrlUVjn/JCi/9+MAt5vHQY33cIdDfvA6mvkIl6+FhP8vv7Uu2IYS5qJWeC2/Pe5O6ka3kaYMxxojERxFqwiOlpHr//UTWZUX8UnEpmEC8TP4L9LnVMZy2xtEv3jYzsNqwUEM2puaYBSZmWWIviYdUIq81weQGi+vmnHIvin+NT6BWH0nChaVyj5IWbCia+yluRGyuFTWyeP31bGDaAOAfoN4rueMwYJrJVpQo4/Oo9ZD9Blu9EeCTVgsdIts6fJJHYBAnV4T5OFaeNhSxFcFfB8bxLzCBDQOTsAm/bzBFNMd5GNQXf2wojVvHpb3QELKiOYYqNMQpJt1jc8nGITQRXIeqqgTT22Uh9ook32yp5MmXQ8v+2piR/64/4URZ3alSrm/XqPoW9MXNYBuG6QRTsaWOl5DCS+CpP//Er+pTIAlkBRRrMyyt2AdbYoFrXnc9vezk9TqPjToePjRmkAzsH0CkbisSmC2Rhp/5dK4thFJSpEr+Vjm4pJHjbKH+k7FRV5csjEXZy+SDRTsptUNkiyu3nn8EQg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3408.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6506007)(33656002)(71200400001)(53546011)(9686003)(55016002)(4326008)(8676002)(5660300002)(110136005)(316002)(86362001)(54906003)(508600001)(7696005)(8936002)(66446008)(186003)(66556008)(64756008)(66476007)(52536014)(38070700005)(38100700002)(107886003)(83380400001)(76116006)(122000001)(66946007)(26005)(82960400001)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?J+REPSRo0tPHvZgbae4941tGy1OTFtMgpyHUmHwYxAoJkzBWb8xX+VbW0WUA?= =?us-ascii?Q?lJAmj2QbKAHv9ArcEcpzXJFZk7GCsnlPqnL9CE3kWEbxzzo7mQ2HGTd2BjEC?= =?us-ascii?Q?moTWJY6ssRcy+5Q2SHZh8cWcnqjTzA+/kZacm+mB7jIEbpY8aCT+6qDw7xle?= =?us-ascii?Q?BjifYrs18Ao+1n2aYuaD2UR4b19py0vqQ7m7Vk1QSIdTAoNB0I2fnB8Kvzpv?= =?us-ascii?Q?zC2+iRvJh3LQY2kFyGUskoR8iuyduYXV0hElVHRL255Fq40YBm4JbRYYv7KG?= =?us-ascii?Q?Zasw26jf90u8yPztHQkeG/AbIl6MujJQjepzTa761gw6/d0L8MYWLEca2TFE?= =?us-ascii?Q?WkNc2saCVhMvWsosr7+sUrpFpbZ0L/9uXZUUIkKQRUUorwOVyj1w9Ov1DopM?= =?us-ascii?Q?mfD8N6MlRh18bE+g4O11R02AXp01GHuOHbBq4LtNuqpLQB4soKuI+MKYT2mM?= =?us-ascii?Q?YUfZ0gVGl/ghx58R4aPBt8UKdibY8JvTPiYEm5ZTrBJ9pq1aGjfXqKeSWkO6?= =?us-ascii?Q?bt+V3l5OWxHVbzVtbpxnxKFVizmn+J70KGqIgqC9TeN9lh8XSnNgqxQtGkDb?= =?us-ascii?Q?gBtOoGIcvHPGUCi7HcpAFHMmmbQWKN+lRanI8LaEHVdkkKiNeiXeXr4pueIl?= =?us-ascii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UJx5DrgTl+R0?= =?us-ascii?Q?DQYOHd1jWEBImONJ1eaA9MDQfG5CfKjaupkLetmBiF8nBK/BymE0n8dfhMAq?= =?us-ascii?Q?BMeHhqypNuIuHj5GXE9X1Do=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3408.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4849ea94-c6c6-400d-a5b6-08d9a31b41e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2021 00:52:51.3162 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FU5+A/AP/AkP4HdcgM8Jv1UJdsYWmmskrzaicWlVDZzTkZQ6pYvRnwtTz0Ilu5Pst5xhGOMcl9+xULNCcFkhCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2557 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [EXT] [dpdk-dev v1] test/cryptodev: fix incomplete data length 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 Sender: "dev" Hi Anoob,=20 Please see my commit inline below.=20 Thanks Kai=20 > -----Original Message----- > From: Anoob Joseph > Sent: Monday, November 8, 2021 4:32 AM > To: Anoob Joseph ; Ji, Kai ; > dev@dpdk.org; Akhil Goyal > Cc: De Lara Guarch, Pablo ; > adamx.dybkowski@intel.com; Zhang, Roy Fan > Subject: RE: [dpdk-dev] [EXT] [dpdk-dev v1] test/cryptodev: fix incomplet= e > data length >=20 > Hi Kai, >=20 > Also, couple of nits. Please check inline. >=20 > Thanks, > Anoob >=20 > > -----Original Message----- > > From: dev On Behalf Of Anoob Joseph > > Sent: Monday, November 8, 2021 9:36 AM > > To: Kai Ji ; dev@dpdk.org; Akhil Goyal > > > > Cc: pablo.de.lara.guarch@intel.com; adamx.dybkowski@intel.com; > > roy.fan.zhang@intel.com > > Subject: Re: [dpdk-dev] [EXT] [dpdk-dev v1] test/cryptodev: fix > > incomplete data length > > > > Hi Kai, > > > > Patch looks good. Wondering if we need same fix in functions such as " > > test_zuc_auth_cipher()". > > > > We were also hitting this issue when we enabled few additional > > features in Marvell PMDs. Upon investigation, we realized that this > > issue would come up for certain packet size combinations if the padded > > lengths are not same. We observed the issue only with > > test_mixed_auth_cipher(), which is getting addressed with this patch. > > Just wondering if you have checked whether other places also would need > a fix. > > [Kai] Yes, this fix should apply to test_zuc_auth_cipher(). However, I do= n't see any zuc test failed from my side as there is no zuc test vector to= cover the OOP partial digest case. I think I will add this fix into the zu= c test anyway. =20 > > Thanks, > > Anoob > > > > > -----Original Message----- > > > From: dev On Behalf Of Kai Ji > > > Sent: Friday, November 5, 2021 9:12 PM > > > To: dev@dpdk.org > > > Cc: Kai Ji ; pablo.de.lara.guarch@intel.com; > > > adamx.dybkowski@intel.com > > > Subject: [EXT] [dpdk-dev] [dpdk-dev v1] test/cryptodev: fix > > > incomplete data length > > > > > > External Email > > > > > > -------------------------------------------------------------------- > > > -- This patch fixes incorrect data lengths computation in cryptodev > > > unit test. > > > Previously some data lengths were incorrectly set, which was > > > insensitive for crypto op unit tets but is critical for raw data > > > path API unit tests. The patch addressed the issue by setting the > > > correct data > > lengths for some tests. > > > > > > Fixes: 681f540da52b ("cryptodev: do not use AAD in wireless > > > algorithms") > > > Cc: pablo.de.lara.guarch@intel.com > > > > > > Fixes: e847fc512817 ("test/crypto: add encrypted digest case for > > > AES-CTR- > > > CMAC") > > > Cc: adamx.dybkowski@intel.com > > > > > > Signed-off-by: Kai Ji > > > --- > > > @@ -7335,6 +7335,7 @@ test_mixed_auth_cipher(const struct > > > mixed_cipher_auth_test_data *tdata, > > > unsigned int plaintext_len; > > > unsigned int ciphertext_pad_len; > > > unsigned int ciphertext_len; > > > + unsigned int data_len; > > > > > > struct rte_cryptodev_info dev_info; > > > struct rte_crypto_op *op; > > > @@ -7395,21 +7396,22 @@ test_mixed_auth_cipher(const struct > > > mixed_cipher_auth_test_data *tdata, > > > plaintext_len =3D ceil_byte_length(tdata->plaintext.len_bits); > > > ciphertext_pad_len =3D RTE_ALIGN_CEIL(ciphertext_len, 16); > > > plaintext_pad_len =3D RTE_ALIGN_CEIL(plaintext_len, 16); > > > + data_len =3D RTE_MAX(ciphertext_pad_len, plaintext_pad_len); >=20 > [Anoob] Isn't ciphertext_pad_len guaranteed to be the larger one of the t= wo? > Do we need another variable and the RTE_MAX? [Kai] the ciphertext_pad_len should be always bigger than plaintext_pad_len= , code changed in v2.=20 >=20 > > > > > > if (verify) { > > > ciphertext =3D (uint8_t *)rte_pktmbuf_append(ut_params- > > > >ibuf, > > > - ciphertext_pad_len); > > > + data_len); > > > memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); > > > if (op_mode =3D=3D OUT_OF_PLACE) > > > - rte_pktmbuf_append(ut_params->obuf, > > > ciphertext_pad_len); > > > + rte_pktmbuf_append(ut_params->obuf, data_len); > > > debug_hexdump(stdout, "ciphertext:", ciphertext, > > > ciphertext_len); > > > } else { > > > plaintext =3D (uint8_t *)rte_pktmbuf_append(ut_params- > > > >ibuf, > > > - plaintext_pad_len); > > > + data_len); > > > memcpy(plaintext, tdata->plaintext.data, plaintext_len); > > > if (op_mode =3D=3D OUT_OF_PLACE) > > > - rte_pktmbuf_append(ut_params->obuf, > > > plaintext_pad_len); > > > + rte_pktmbuf_append(ut_params->obuf, data_len); >=20 > [Anoob] Now that more things are common across the branches, can we > move out some bits outside the if condition? Like, the above line is defi= nitely > same and be kept outside condition. The append call prior to this can als= o be > kept common if we can rename the local variable. [Kai] code changed in v2=20 >=20 > > > debug_hexdump(stdout, "plaintext:", plaintext, > > plaintext_len); > > > } > > > > > > -- > > > 2.17.1