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 9063445AAD; Fri, 4 Oct 2024 13:48:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A26940E5E; Fri, 4 Oct 2024 13:48:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A975A4027F for ; Fri, 4 Oct 2024 13:48:40 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4943hvdJ024662; Fri, 4 Oct 2024 04:48:40 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 42204thpgm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Oct 2024 04:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WERwZLPYTdANAMtnor3DHNrtG3mnDJ9Bv3SiB0A/2ZTYI3oB5w+wQ3M1C9jmjBw3LcVgVBjbfdzuZWIPzefXsMv5LHbTAQLu/grfzO3Ug12Sv2F1v+aGhW68Q1mgHeLItKFbFAFu4zM1LEDT5lwxYlqfmvIjSqD8wHirAl5fLRy5cTiL7t95y+5yoRAe+dj7MwNWbtk33ofdurVoH28YSmUfqd05Hna9CaB1UbonXt7rfLkrdIMotN6PRvquSqf/ECZ6rZKbmEfTPfcmad6tpBBzcg9tpuDaREFoAMJDFbImN73tFMewKwCPHjUuhUAjZgQbQVcsRxxZAXhhxvkO8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=AEfML/Oe+T9PxDtfk4UblYPjcnUk9IfhUVBM6cEQJ0Q=; b=xF30LDHjlpr5UFWe/SvVZ1XHnx1jOUe0KltrG5hBwQSuDaHp5HPyTkxc7O6aJ7YVkm/xNUmltUKsteUqaMBj3IIngiuWAeBlqe7UCQstwkzjzlvq55TF/QYtSyKguMyJ6jqRCl2UAYgX/uHP0y0kvuXYy/LIw+H9ThfACHRYmvKm3hWFzFwxLz4MYVj4yTOFPAtOqQ3FP7BC8iEkLUL+Y/GoH2qnQ/ZiZCKn7Lwvc8bl/k5dEnHhDGmyuaMUuTDeMjI6DAMrQ+6uOboLNKXpY/5OEhc7n77DnrK2b6+B953Bjb4vFazVxwVjghVhuScgpvWQS46iwL8BXzx4xMPBrQ== 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.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AEfML/Oe+T9PxDtfk4UblYPjcnUk9IfhUVBM6cEQJ0Q=; b=QGw9VpD6iYApGEB4UxNxFhxJhxhBh1Hfr2N6lNvwg8KtSUXNxa452fXyzTIIM3Ma+FsYxWGeLomLV1NgPKvDQ5mYegGpocI4onFvu7Ca2XCREoG9F7Yqp7RS/MZv/QzBUDA/IJvQgyoUQ2RfGmU1xtSA4eCOExTjG8Zvs1Fvytw= Received: from SJ0PR18MB5161.namprd18.prod.outlook.com (2603:10b6:a03:438::6) by IA2PR18MB6084.namprd18.prod.outlook.com (2603:10b6:208:4b7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18; Fri, 4 Oct 2024 11:48:18 +0000 Received: from SJ0PR18MB5161.namprd18.prod.outlook.com ([fe80::de87:f6c:99c2:9625]) by SJ0PR18MB5161.namprd18.prod.outlook.com ([fe80::de87:f6c:99c2:9625%4]) with mapi id 15.20.8026.016; Fri, 4 Oct 2024 11:48:17 +0000 From: Amit Prakash Shukla To: Vidya Sagar Velumuri , "fengchengwen@huawei.com" , "kevin.laatz@intel.com" , "bruce.richardson@intel.com" CC: Jerin Jacob , Anoob Joseph , Vidya Sagar Velumuri , Aakash Sasidharan , Tejasree Kondoj , Gowrishankar Muthukrishnan , "dev@dpdk.org" Subject: RE: [EXTERNAL] [PATCH v2 2/2] test/dma: add functions to verify zero and one fill Thread-Topic: [EXTERNAL] [PATCH v2 2/2] test/dma: add functions to verify zero and one fill Thread-Index: AQHakjkzEgWC3RqyZ0SK+YSQgMZO77J3gcOA Date: Fri, 4 Oct 2024 11:48:17 +0000 Message-ID: References: <20240416123747.4133884-1-vvelumuri@marvell.com> <20240419090734.43613-1-vvelumuri@marvell.com> <20240419090734.43613-2-vvelumuri@marvell.com> In-Reply-To: <20240419090734.43613-2-vvelumuri@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR18MB5161:EE_|IA2PR18MB6084:EE_ x-ms-office365-filtering-correlation-id: 0c37ef1d-f141-47f6-cc1a-08dce46a6fda x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?MioV6qSa81oqTpb2hXvK7oCpThZPzJ9+tq2DrZa/39FfqQFgUw4R9LG+uulv?= =?us-ascii?Q?B+E2L+KNR7Q3G+fgLxlF0AaGwP6AdmJRj2CqDUfvB9rYTddM0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gNDwYf2Kr1tGaNfG6ZKDkbYw3kdBi+BCSQ4GNhg99Db?= =?us-ascii?Q?oxgvbXfYBtA3F6K86mPOKfwU5l/zuhtDUq53jTOerLNx9J+e77tL9+b6bS08?= =?us-ascii?Q?oQZKedR9mHWU2FgZ3dxDI2xab9c8yqbiwZnF/LY3GADWXx5YbV4Y4umeDMe9?= =?us-ascii?Q?vi7+vK9KRhkA7xCHSDjgbEb1BZpMsWh/A1LigNP7E5YZQDRdZwnVqkplm0Pq?= =?us-ascii?Q?VCOoBELcOPwarTPkrOJTsqGZVUtLRyh7DQTS+SlY+8cKuKUigQYN5OKo09hZ?= =?us-ascii?Q?K9fF8yAk+W7lMmvoSDoP7AZc3XrV+c+nyDqPkg475o1lC2DuCSSW2ga0PXfV?= =?us-ascii?Q?rgGL75EKMP/pPZ1DgSq7l9nfSX2O/mdv1BVhkT+kZDWH3w=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR18MB5161.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hyRRW12dm56c8Qpd0eN70njzs61NIYf4TEzoEvbzqt1929Q5zZjYp7PcDMvx?= =?us-ascii?Q?I/NRQdoxUmEd67g/aBDgDb0pGvITDlaipDhNCBbOw77QJPpJ5OfNkU9UtU8g?= =?us-ascii?Q?lwxNWx8K+fNIZDl0QGFSIewfRwS/hUJs0nD2/eYv96Cglb+vFXZYmoaIsi6A?= =?us-ascii?Q?kquT63tIf/Z0m4qYCFwHGebGRME0cBC5CaBx44m1HdAl84rKlQchdgkaBeDU?= =?us-ascii?Q?eV/PqcV47OkRzATejGoHboVMA8sZOotUy2vMrwpRHCKtgOb4B98rV0dljgUS?= =?us-ascii?Q?cT5cILBQ60VR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yHi2IYQSsdBb?= =?us-ascii?Q?cHLZtctVmtXA75oXQcadKFW5IEjS2sup6fs9obR7IbWzZms/E06M+MjDUNbc?= =?us-ascii?Q?W2CDGyjeiQzxsxwzqzndEPGvfK4eSfMJlcqI91PKcRcKbDC4hfh/dLhEsXKc?= =?us-ascii?Q?StErUn0f4cjvmeXRHXqQX1SBPoZXFxfAInvps/Pv5EtPed4Z7WUxbfTtViIl?= =?us-ascii?Q?bQoIKbcZDZ91CVrMJiNdIevpGptgZDv/ny8XqHYahW2CeN8ccVt/iWcDzJex?= =?us-ascii?Q?wLKB8KflJ+R4Pookel85DFe9bRQ4UP7cPk2mpmwbM/dCr+hXyCsEtLtqpJRp?= =?us-ascii?Q?vPl7kCnimnTwAM+0X6s4DJJ76/GidcdY8TbwDEb4MzL/BBkWgSxhlHV++YVk?= =?us-ascii?Q?Vf1T6D4W2YSufINsjSIKb1UHklN2PtpeldkCQjRv?= 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: SJ0PR18MB5161.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c37ef1d-f141-47f6-cc1a-08dce46a6fda X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2024 11:48:17.3442 (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: aG81DARkj0APxTzx4XEvrpMuADl6UlFeYTvLqU4LqZucGx5MGdx1kXmvjc6Rx0/U3qjV5aw0ONZRLlKipAUHBAFvAjjliVzLqA4LOjRypkI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA2PR18MB6084 X-Proofpoint-ORIG-GUID: ypdw9Kydiso55nNymQAhZseUoKy5oMDr X-Proofpoint-GUID: ypdw9Kydiso55nNymQAhZseUoKy5oMDr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 > -----Original Message----- > From: Vidya Sagar Velumuri > Sent: Friday, April 19, 2024 2:38 PM > To: fengchengwen@huawei.com; kevin.laatz@intel.com; > bruce.richardson@intel.com > Cc: Jerin Jacob ; Anoob Joseph > ; Vidya Sagar Velumuri ; > Aakash Sasidharan ; Tejasree Kondoj > ; Gowrishankar Muthukrishnan > ; dev@dpdk.org > Subject: [EXTERNAL] [PATCH v2 2/2] test/dma: add functions to verify zero > and one fill >=20 > Prioritize security for external emails: Confirm sender and content safet= y > before clicking links or opening attachments >=20 > ---------------------------------------------------------------------- > Add test cases to verify zero fill and one fill >=20 > Signed-off-by: Vidya Sagar Velumuri diff --git > a/app/test/test.h b/app/test/test.h index 15e23d297f..0ca6519f6e 100644 > --- a/app/test/test.h > +++ b/app/test/test.h > @@ -27,6 +27,10 @@ >=20 > #include >=20 > +#ifndef ARRAY_SIZE > +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif > + > #define TEST_ASSERT RTE_TEST_ASSERT >=20 > #define TEST_ASSERT_EQUAL RTE_TEST_ASSERT_EQUAL diff --git > a/app/test/test_dmadev.c b/app/test/test_dmadev.c index > 7462e90831..ec896a4905 100644 > --- a/app/test/test_dmadev.c > +++ b/app/test/test_dmadev.c > @@ -869,42 +869,51 @@ test_completion_handling(int16_t dev_id, uint16_t > vchan) static int test_enqueue_fill(int16_t dev_id, uint16_t vchan) { > + uint64_t pattern[3] =3D {0x0, 0xfedcba9876543210, 0xffffffffffffffff}; > const unsigned int lengths[] =3D {8, 64, 1024, 50, 100, 89}; > + unsigned int i, j, k; > struct rte_mbuf *dst; > char *dst_data; > - uint64_t pattern =3D 0xfedcba9876543210; > - unsigned int i, j; >=20 > dst =3D rte_pktmbuf_alloc(pool); > if (dst =3D=3D NULL) > ERR_RETURN("Failed to allocate mbuf\n"); > dst_data =3D rte_pktmbuf_mtod(dst, char *); >=20 > - for (i =3D 0; i < RTE_DIM(lengths); i++) { > - /* reset dst_data */ > - memset(dst_data, 0, rte_pktmbuf_data_len(dst)); > + for (k =3D 0; k < ARRAY_SIZE(pattern); k++) { > + for (i =3D 0; i < RTE_DIM(lengths); i++) { > + /* reset dst_data */ > + memset(dst_data, 0, rte_pktmbuf_data_len(dst)); > + > + /* perform the fill operation */ > + int id =3D rte_dma_fill(dev_id, vchan, pattern[k], > + rte_pktmbuf_iova(dst), lengths[i], > RTE_DMA_OP_FLAG_SUBMIT); > + if (id < 0) { > + if (id =3D=3D -ENOTSUP) { > + rte_pktmbuf_free(dst); > + break; > + } > + ERR_RETURN("Error with rte_dma_fill\n"); > + } > + await_hw(dev_id, vchan); >=20 > - /* perform the fill operation */ > - int id =3D rte_dma_fill(dev_id, vchan, pattern, > - rte_pktmbuf_iova(dst), lengths[i], > RTE_DMA_OP_FLAG_SUBMIT); > - if (id < 0) > - ERR_RETURN("Error with rte_dma_fill\n"); > - await_hw(dev_id, vchan); > + if (rte_dma_completed(dev_id, vchan, 1, NULL, NULL) > !=3D 1) > + ERR_RETURN("Error: fill operation failed > (length: %u)\n", > + lengths[i]); > + /* check the data from the fill operation is correct */ > + for (j =3D 0; j < lengths[i]; j++) { > + char pat_byte =3D ((char *)&pattern[k])[j % 8]; >=20 > - if (rte_dma_completed(dev_id, vchan, 1, NULL, NULL) !=3D 1) > - ERR_RETURN("Error: fill operation failed (length: > %u)\n", lengths[i]); > - /* check the data from the fill operation is correct */ > - for (j =3D 0; j < lengths[i]; j++) { > - char pat_byte =3D ((char *)&pattern)[j % 8]; > - if (dst_data[j] !=3D pat_byte) > - ERR_RETURN("Error with fill operation > (lengths =3D %u): got (%x), not (%x)\n", > - lengths[i], dst_data[j], > pat_byte); > + if (dst_data[j] !=3D pat_byte) > + ERR_RETURN("Error with fill > operation (lengths =3D %u): got (%x), not (%x)\n", > + lengths[i], dst_data[j], > pat_byte); > + } > + /* check that the data after the fill operation was not > written to */ > + for (; j < rte_pktmbuf_data_len(dst); j++) > + if (dst_data[j] !=3D 0) > + ERR_RETURN("Error, fill operation > wrote too far (lengths =3D %u): got (%x), not (%x)\n", > + lengths[i], dst_data[j], > 0); > } > - /* check that the data after the fill operation was not written > to */ > - for (; j < rte_pktmbuf_data_len(dst); j++) > - if (dst_data[j] !=3D 0) > - ERR_RETURN("Error, fill operation wrote too > far (lengths =3D %u): got (%x), not (%x)\n", > - lengths[i], dst_data[j], 0); > } >=20 > rte_pktmbuf_free(dst); > -- > 2.25.1 Acked-by: Amit Prakash Shukla Thanks