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 6C4F9A034F; Tue, 9 Nov 2021 11:32:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38D0040E03; Tue, 9 Nov 2021 11:32:09 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 63F5F4068B for ; Tue, 9 Nov 2021 11:32:08 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1A979Ucp003407; Tue, 9 Nov 2021 02:32:07 -0800 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3c7mba0vnn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Nov 2021 02:32:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NMigkv1nkgDYQpWbXIDgIZqxk64Sv50JQx7RKxiFrNxDXvLA+8RZBMSbtBvuu+WVSaLaEHuYDzIiFbAcvvkr1CXFVfhIP2YuZ97gj3EyPKhOFYPNmsOZyN7cmbcQamkllYEY+xpdVNlQqUGzD9bKn4GscTrT1ZYb/wFTFUdfxh4+Ok5qEQr0dxAHI6SPuIZb53iPb1OuwFDhjIx750AWTPEjUGZL2mpyShFm2R19k/rcCxo45gOGtbB6U84xe3ydsC9kNOIItqukz6siIys6lnwDVi0XDF8M0RqKj1/ol1QwlVN8KXbdv2M13sfGXiRSHwooUoYJy/vIKoFuJBnWlg== 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=HuQm0RqpJhhFTmhnU+3WRTBSvYN3iIRhT66ff+8zjOM=; b=FMr4UuYhq4GKHJc9FtrBdOh5+EvG9l59J1Oh/2LlOBYJE6p/Pa/+VNHDs7atE5GEubgLo0v4+iefnk3ENag5aDBUqrPjqs8YLpmbENBISMtrpC976jU9LUyIUT2rJgLkhHLSRl4au8qxVMuvzld3yyUMbbAnFhFbm1zJ7sagQN+sMosCKnEeBPDuhISckZAn8dm+GtmK/Up7ZAGZZ8X4EEE1A2g1STcF3VocpqGCzveWodl4wxalRI/dgvyNRjoHubGNFdo0Y+0KRxlZVOLdn5i/6O0r6ZhfrB8KlHpyM9E/fzJThy/O2QmBNNwPfRU5OSfPtInX6vSIGyTTbvjaMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HuQm0RqpJhhFTmhnU+3WRTBSvYN3iIRhT66ff+8zjOM=; b=ZLd4mDJ8fERBkNvE0bD5+yzeCWgKAe/Jn4Q/JRSE18fx4hYsrMIQ5DzKWjcchx6NJ9q0tIhPDuw5p1UapCEaauwgz8CirEanapZL5OuNimnIgwsQzagee46PrMszpEtiZiwScMnkRIE27mm0PzUb7O2dyD0S2LzZjYGKboyjjTA= Received: from PH0PR18MB4672.namprd18.prod.outlook.com (2603:10b6:510:c9::16) by PH0PR18MB4560.namprd18.prod.outlook.com (2603:10b6:510:c0::12) 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 10:32:05 +0000 Received: from PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::30fa:e30f:a8cc:92aa]) by PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::30fa:e30f:a8cc:92aa%8]) with mapi id 15.20.4669.016; Tue, 9 Nov 2021 10:32:05 +0000 From: Anoob Joseph To: Kai Ji , "dev@dpdk.org" CC: "pablo.de.lara.guarch@intel.com" , "adamx.dybkowski@intel.com" , "damianx.nowak@intel.com" Thread-Topic: [EXT] [dpdk-dev] [dpdk-dev v2] test/cryptodev: fix incomplete data length Thread-Index: AQHX1VRe/v7yaD3fGk6Ax+VtUSw9A6v6/t3w Date: Tue, 9 Nov 2021 10:32:05 +0000 Message-ID: References: <20211105154204.7191-1-kai.ji@intel.com> <20211109102703.23006-1-kai.ji@intel.com> In-Reply-To: <20211109102703.23006-1-kai.ji@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f0e8e9e3-d279-4f7e-89d6-08d9a36c2ce1 x-ms-traffictypediagnostic: PH0PR18MB4560: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SEODIsG+s6Lt8TKPheYQTHdkam5/vJPhURG8Of8CFraWdZW5KqYfvZtzHqETkl1yMYR3Z9++nAmWXI6ht6WoV7PGSc2+JK8LZifxyspTQesH+aZLL0lHKT+dxfo+9VxKJcgCiUzVsY+YuwyHoJ6OhadTwohzfcWs+Gn0gQlij2R2Z2IRHZqvpZtRXAJVY8g/V3vjQTv/iFrPfWOopt9v46kZasln7AWamlsqzmXnCECnUszm8qHRPOzrHxLtE0DTyligjCBE0mZn2hj9GEkGE/++NtTqX4WjvXl8HQU0ONh4/YDNi60vFsNigf8g2dDRPuOIcWjfyK37xtHWYTP3hqvYfwwVh1egmhKCo4YzOwUo7ehgxCG+iWkIZeM6LbZpsju85tUbWE7UKBEBwAuWz7PXFvaA4wrK6ParAuDwxGq1aBSg24GAiguF+vKGC7rpvWLBANzslcY32q7DED1xYh19a2LS0cF3wExff9LDWfS4f+APUdbfDUoux7gGviOyAI4+FbCY0PDjsRWktqIr9HJO2EzGVOfGPVxh00YSChPHjnt3F4UAjNX45yxdz4P5VIGs26ouG1NaRZXnLbc9o8Eqt2uIAYTBP6NGJFlGguAbglp4sNib4nzpX4nMyJWNc25+xERL0sqrgE8dpborRXd9zRVUKkYVLgy2gcHRsQFcKMz/1LlpJ1p/2w9/RIJe29n8w8ZkkGe8Qb4rziYT5A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4672.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(110136005)(52536014)(316002)(33656002)(6506007)(5660300002)(508600001)(26005)(64756008)(8676002)(86362001)(2906002)(54906003)(53546011)(55016002)(7696005)(38070700005)(122000001)(83380400001)(186003)(66476007)(66556008)(8936002)(71200400001)(38100700002)(76116006)(4326008)(66946007)(66446008)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fqd7QopqHnnA4wV3nXb6f2KPgK1YvAIGZaNh1eESxMg2PAd1BdoTlncPgJr2?= =?us-ascii?Q?zCynpZ/k7U+sC5WRcP9CcLPyqMgKbh3BxMOrm6+l4gWxesY0BVyXwpgw+vgZ?= =?us-ascii?Q?pFOo4v2SLLws1ooZu1zlQIoxPfogFkymCKcrcbWRI3l3GWS5+KxXDSQH8DlW?= =?us-ascii?Q?/n++YiAe87+b3uek2UMnOk92bxM3kn9Sl/4PPuPH0PLbUu9xMpN0bLkTkhqG?= =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xD2azSj8rb8cF1M2DQLq+qfcCgduvjFKJ1?= =?us-ascii?Q?P0Od1UehbgtW/WQitH6tCzZsqhn+fNAAViRWrCHud1Xza1TOeqkzmoGmlWKT?= =?us-ascii?Q?ryqvDDaikfdOoXkn9hGn69eGOe7m709UEZTCDqX/PeYf1viNAj+/EXVTLObi?= =?us-ascii?Q?IZzoX6IXyT4Ddt16/5swtIIPdp8a+2SK2gHUswmWLot/t2aq2g41ojt2T0Ag?= =?us-ascii?Q?WJZtNT/YW4GmQxYmAXjtMxMWNqz1lqbGp49EDKB01fwmyDeybO79KQnBZKg8?= =?us-ascii?Q?LrDKalz0qtpQkqNhf1oZmGfkPxuetbtu2tRXdTVY2mRK/ePjLIqW2CXf38T6?= =?us-ascii?Q?cwCpxuH18DNhtGfCdg2KqvTuwTLFYHbGN7HKSDR1vQYNMWOlYGshvgTHVFy5?= =?us-ascii?Q?m01JGMQ2FXZR99pNerokrZuCBfPxnzMjvQj7F+oi/zI4LYmRuMakdMH6loIX?= =?us-ascii?Q?Y35p/jZHMq9irSCvdzb8tdF2DBgoTgnZOr7RAISTLpAs6qkT2cdJ4EsLo/HI?= =?us-ascii?Q?RWrsanYqvrllRU2gbuHWKYI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4672.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0e8e9e3-d279-4f7e-89d6-08d9a36c2ce1 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2021 10:32:05.3125 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: l1/CuI8cL6iVOo8YxqcuewxP8Sc9TWMPREQiB9fE2ZrJjrZKYBUj1zApCz3aQGx1EwNuj+7E6V9xnm05hbNMGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB4560 X-Proofpoint-ORIG-GUID: LzjtAA_kwKfY_VO0rjhLZAkQs1pTOX-0 X-Proofpoint-GUID: LzjtAA_kwKfY_VO0rjhLZAkQs1pTOX-0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-09_03,2021-11-08_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [dpdk-dev v2] 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 Kai, Minor nit inline. Thanks, Anoob > -----Original Message----- > From: dev On Behalf Of Kai Ji > Sent: Tuesday, November 9, 2021 3:57 PM > To: dev@dpdk.org > Cc: Kai Ji ; pablo.de.lara.guarch@intel.com; > adamx.dybkowski@intel.com; damianx.nowak@intel.com > Subject: [EXT] [dpdk-dev] [dpdk-dev v2] test/cryptodev: fix incomplete da= ta > length >=20 > External Email >=20 > ---------------------------------------------------------------------- > This patch fixes incorrect data lengths computation in cryptodev unit tes= t. > 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. >=20 > Fixes: 681f540da52b ("cryptodev: do not use AAD in wireless algorithms") > Cc: pablo.de.lara.guarch@intel.com >=20 > Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR- > CMAC") > Cc: adamx.dybkowski@intel.com >=20 > Fixes: b1c1df46878d ("test/crypto: add ZUC test cases for auth-cipher") > Cc: damianx.nowak@intel.com >=20 > Signed-off-by: Kai Ji > --- > app/test/test_cryptodev.c | 28 +++++++++++++++------------- > 1 file changed, 15 insertions(+), 13 deletions(-) >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index > 52457596e2..2dd1bbb64c 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -4102,9 +4102,9 @@ test_kasumi_decryption(const struct > kasumi_test_data *tdata) >=20 > /* Create KASUMI operation */ > retval =3D create_wireless_algo_cipher_operation(tdata- > >cipher_iv.data, > - tdata->cipher_iv.len, > - tdata->ciphertext.len, > - tdata->validCipherOffsetInBits.len); > + tdata->cipher_iv.len, > + RTE_ALIGN_CEIL(tdata->validCipherLenInBits.len, 8), > + tdata->validCipherOffsetInBits.len); > if (retval < 0) > return retval; >=20 > @@ -6332,20 +6332,20 @@ test_zuc_auth_cipher(const struct > wireless_test_data *tdata, > ciphertext =3D (uint8_t *)rte_pktmbuf_append(ut_params- > >ibuf, > ciphertext_pad_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); > debug_hexdump(stdout, "ciphertext:", ciphertext, > ciphertext_len); > } else { > + /* make sure enough space to cover partial digest verify case > */ > plaintext =3D (uint8_t *)rte_pktmbuf_append(ut_params- > >ibuf, > - plaintext_pad_len); > + ciphertext_pad_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); > debug_hexdump(stdout, "plaintext:", plaintext, > plaintext_len); > } >=20 > + if (op_mode =3D=3D OUT_OF_PLACE) > + rte_pktmbuf_append(ut_params->obuf, > ciphertext_pad_len); > + > /* Create ZUC operation */ > retval =3D create_wireless_algo_auth_cipher_operation( > tdata->digest.data, tdata->digest.len, @@ -7395,24 +7395,26 > @@ 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); > + if (ciphertext_pad_len > plaintext_pad_len) > + printf("NOOB: \n"); [Anoob] Is the above intentional? =20 >=20 > if (verify) { > ciphertext =3D (uint8_t *)rte_pktmbuf_append(ut_params- > >ibuf, > ciphertext_pad_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); > debug_hexdump(stdout, "ciphertext:", ciphertext, > ciphertext_len); > } else { > + /* make sure enough space to cover partial digest verify case > */ > plaintext =3D (uint8_t *)rte_pktmbuf_append(ut_params- > >ibuf, > - plaintext_pad_len); > + ciphertext_pad_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); > debug_hexdump(stdout, "plaintext:", plaintext, > plaintext_len); > } >=20 > + if (op_mode =3D=3D OUT_OF_PLACE) > + rte_pktmbuf_append(ut_params->obuf, > ciphertext_pad_len); > + > /* Create the operation */ > retval =3D create_wireless_algo_auth_cipher_operation( > tdata->digest_enc.data, tdata->digest_enc.len, > -- > 2.17.1