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 214AB42665; Thu, 28 Sep 2023 23:12:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2A424025F; Thu, 28 Sep 2023 23:12:12 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 96A5B4021E for ; Thu, 28 Sep 2023 23:12:10 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SAfcWg003479; Thu, 28 Sep 2023 14:12:09 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2176.outbound.protection.outlook.com [104.47.57.176]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3td7y6tac0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 14:12:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gjfzcFX+M4OROsNQ0nAmVRzGG6MQK/Wiy9M20IjfBkIAWr2hW6t4KUaud+imn1sJaqAfvm8DyR//RP1UWXRLFAqjPIxzd4EK0iDdoTmFDjbX8AXpa44JXkenUJeV8gSvaqJ66brMF6+J+QZzpzr5PKzhtosSiv1+7K7LJQ4q1MaKw8CC4nKZbUF5EOC5df1GSSTWc3ONz+yhjlLVlDPuvphK6hPbIvtTg2ONv44HtZ2DjHWRoZ8kF1yiXoWmFeTh2D1Qs56APM/13Z+VV/NliOZOgKTZusuNowO+RKJeHuYs+yJHRjGc8KoiWnTq/jVjLeC1/sTdTUr4lXs/So+FQA== 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=xwfvLUR5IbgmI5fv22TErQCsAbmVSpuAZFSV7a4hUTE=; b=ddxsMRHKQZlNAhktLYXwCLRJGeHxysA0+sbP5WcuricQqSiwctkPARoTc/gAkqWdcy3tM/6y+OrEhkS6XWNjL3TV7Aguf5M+qkTawAE4F9frcxRJp+eV8NgwzNnxgLD/fUfnZ8IN1H2Qc9X14Ykn1H2qn3a4vJKaitlssIxx1DwowWTqhLdquue8WPWy+nUjFjVOP9MSge/iL/DZKM39c64reD9PC/Knr1qtOdA2DrNVw0CYwintL1NViHklWPYjnq+PcB+QFoFLaU3rgax8y44ISECxClDZ9i7NrEMXqC7l6qccMP8HKt+2IZP0n+tfmXso6uHPqvtsPDtb70IRmQ== 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=xwfvLUR5IbgmI5fv22TErQCsAbmVSpuAZFSV7a4hUTE=; b=Ft1yby2bE21yioKIXDitGr2iecjSGMZWnakb5tfbT1m7G9ub8ODctYiXN67UIh7yZMoZeiIvZPWYTMOTqBPjnZ2x24N1GJqIMNpzEcSRBAFGUGt82ogG+nLq+iXjSRTx/p4JPXB+PLsoowdmvpUmNziay2FbWrAcRYvFi1LExHU= Received: from PH0PR18MB4086.namprd18.prod.outlook.com (2603:10b6:510:3::9) by SN7PR18MB5293.namprd18.prod.outlook.com (2603:10b6:806:2e5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Thu, 28 Sep 2023 21:12:06 +0000 Received: from PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::e6de:4d63:8f64:f0b1]) by PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::e6de:4d63:8f64:f0b1%4]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 21:12:05 +0000 From: Pavan Nikhilesh Bhagavatula To: Gowrishankar Muthukrishnan , "dev@dpdk.org" CC: Anoob Joseph , Cheng Jiang , Kevin Laatz , Bruce Richardson , Gowrishankar Muthukrishnan Subject: RE: [PATCH v4 2/2] app/dma-perf: add SG copy support Thread-Topic: [PATCH v4 2/2] app/dma-perf: add SG copy support Thread-Index: AQHZ7soJGi0sPK1gpUK0gdPHvMC2UbAwwV/w Date: Thu, 28 Sep 2023 21:12:04 +0000 Message-ID: References: <20230810130137.2529-1-gmuthukrishn@marvell.com> <20230924093208.1061-1-gmuthukrishn@marvell.com> <20230924093208.1061-3-gmuthukrishn@marvell.com> In-Reply-To: <20230924093208.1061-3-gmuthukrishn@marvell.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-traffictypediagnostic: PH0PR18MB4086:EE_|SN7PR18MB5293:EE_ x-ms-office365-filtering-correlation-id: ab52827f-7927-4664-0634-08dbc0679105 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8cshf/gw3KkHfotx9lTaH5WkVfVzDIVd2sM+9A2V12PbEkKvvy1MzDyZVLGjWNCDVrqecP5jdotTC0epehixLCbPNIpj2W6Mmz5FCRf7bQbhs71GX4IhTW2fdF7xzslf1C/X90wpPM0CZnFPss3mH/jZjbcTi2y6lppmrBUYhNyaSrZP0xr8rfE+JK/DhLZr+IZht5U9rdmyqvsYaY3Rn65O5y+F1oO84GcSecjWJzQ6YZddG/pkvXkU/itDQtyQPki+VRnuYeusEmqCsy+FHNj/Su/LXXcax56Xhgtgseaps6xnfixOyk7kqmoyr7MxM1V0QrkxvotFgGhGCKR6C2RBCzaZpvdwuy7sT76c+HOyAas9xditn0giQzjbtepFBkXmOwt6eyLsfx45cBn5xUiXcfkRZhYUFxuXpjl681dJ/iq1ANN77S0UX9n7NQ2aORiK2gZfyXAIYRqyjgxKP27ZKJB4Y0kNB+3/s4qkdyNYme45AA+bUrlcKXxoAFpKAB2/awpcqUXreiEEOqfNQo/jfqNcMXwPCkccK+T/5rLI/tom3ofiGstdYoq4LFFlQBtBdPymima5OmoCaDHU1SgcVRUPlHAm2ypSX4b70Ld3XgHli4vf+rpKRLqJAL+W x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4086.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(376002)(136003)(366004)(39860400002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(33656002)(86362001)(6506007)(107886003)(71200400001)(66476007)(66556008)(52536014)(26005)(5660300002)(7696005)(54906003)(8676002)(64756008)(9686003)(55016003)(53546011)(66446008)(316002)(76116006)(8936002)(41300700001)(110136005)(4326008)(478600001)(66946007)(2906002)(38100700002)(83380400001)(38070700005)(122000001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?52wlPY48LPRXXRqwhA2uouhP7lcnP76UxybxiiUZXmfv0WeB/NR/BFD1TQGN?= =?us-ascii?Q?kBwURWljmoBv9qe4AMArmDenmxt9tnPH/M/ns4I/+uGLewySwr7s6y6m/pI4?= =?us-ascii?Q?PJCSHjx3dyZWOFTwuOYV4obPjdNJSIit8PVppvzSoUCUGbuEbjhPM23/krlu?= =?us-ascii?Q?SG8LylpYxXBjXnv6NddlM6vhq27ACM4BrQSOCNuKDD5ZHKePnLXsd4cG+/6M?= =?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BN8MFd4xMwiXUbc+BK7wMo?= =?us-ascii?Q?yxIPTuWvxInG5Vnz0ixoQEBliCzrHmqFnExt3GHSapLVs2hd+HkPHXmhEtHK?= =?us-ascii?Q?mV/E6xBnO82yayX0PyU6KpvS+mtMySasX0TIls4RZx3Gv1rbZ10Xm2H9zaIW?= =?us-ascii?Q?sQTnX9JMggPsC0gkQoVm4QAVh8j7q2yowtWAvUL+Ae1I967benL1R8PMDI3J?= =?us-ascii?Q?lvxF2tFFh90DQYMUzFlDrICVWJ+2sSooPZgZRJ/QcSpd7n6N/cbmkUJXW9ZA?= =?us-ascii?Q?0YvlAmmCNJ2iFMrzvZstNpOTjzRDumaTwUh+NTsuXPvpvSe76+Ej7R8oOJ/0?= =?us-ascii?Q?rEDiw5GZDQEtgW5NYZAmH5CjWuaf7IqpQPu/ZlZS1DM2hYnTpsDWyYfGXDAI?= =?us-ascii?Q?8P5pEvcSp5t94oD2FtGkq8TzDIaHiJrXAKgOmro7LZcsPHJgtXEbJDAKRrEV?= =?us-ascii?Q?bTssHbZaW9GCkKBOuCB+qyBkn1K8JUOLgTH7wPwN?= 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: PH0PR18MB4086.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab52827f-7927-4664-0634-08dbc0679105 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2023 21:12:05.0194 (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: TIaC8Kj6213Ftpo8AYIRaXWZcTP2WQXmw8kD2uVy1aU2T4VCxXo7PZAbw9jmogodMD5bGQNca7J9NPHVxwu17F3ph5mtsOa2WVwdfPEuQEo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR18MB5293 X-Proofpoint-ORIG-GUID: XgeH-kS3jbfqQ7OAOSTyUNqeqlLOnNjE X-Proofpoint-GUID: XgeH-kS3jbfqQ7OAOSTyUNqeqlLOnNjE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-28_20,2023-09-28_03,2023-05-22_02 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: Gowrishankar Muthukrishnan > Sent: Sunday, September 24, 2023 3:02 PM > To: dev@dpdk.org > Cc: Anoob Joseph ; Cheng Jiang > ; Kevin Laatz ; Bruce > Richardson ; Pavan Nikhilesh Bhagavatula > ; Gowrishankar Muthukrishnan > > Subject: [PATCH v4 2/2] app/dma-perf: add SG copy support >=20 > Add SG copy support. >=20 > Signed-off-by: Gowrishankar Muthukrishnan > --- > app/test-dma-perf/benchmark.c | 243 > +++++++++++++++++++++++++++++----- > app/test-dma-perf/config.ini | 17 +++ > app/test-dma-perf/main.c | 34 ++++- > app/test-dma-perf/main.h | 5 +- > 4 files changed, 260 insertions(+), 39 deletions(-) >=20 > @@ -462,13 +599,46 @@ mem_copy_benchmark(struct test_configure *cfg, > bool is_dma) >=20 > rte_eal_mp_wait_lcore(); >=20 > - for (i =3D 0; i < (nr_buf / nb_workers) * nb_workers; i++) { > - if (memcmp(rte_pktmbuf_mtod(srcs[i], void *), > - rte_pktmbuf_mtod(dsts[i], void *), > - cfg->buf_size.cur) !=3D 0) { > - printf("Copy validation fails for buffer number %d\n", > i); > - ret =3D -1; > - goto out; > + if (!cfg->is_sg) { > + for (i =3D 0; i < (nr_buf / nb_workers) * nb_workers; i++) { > + if (memcmp(rte_pktmbuf_mtod(srcs[i], void *), > + rte_pktmbuf_mtod(dsts[i], void *), > + cfg->buf_size.cur) !=3D 0) { > + printf("Copy validation fails for buffer > number %d\n", i); > + ret =3D -1; > + goto out; > + } > + } > + } else { > + size_t src_sz =3D buf_size / cfg->src_ptrs; > + size_t dst_sz =3D buf_size / cfg->dst_ptrs; > + uint8_t src[buf_size], dst[buf_size]; > + uint8_t *sbuf, *dbuf; > + > + for (i =3D 0; i < (nr_buf / cfg->src_ptrs); i++) { > + sbuf =3D src; > + dbuf =3D dst; > + > + for (j =3D 0; j < cfg->src_ptrs; j++) { > + memcpy(sbuf, > + rte_pktmbuf_mtod(srcs[i * cfg- > >src_ptrs + j], uint8_t *), > + src_sz); > + sbuf +=3D src_sz; > + } > + > + for (j =3D 0; j < cfg->dst_ptrs; j++) { > + memcpy(dbuf, > + rte_pktmbuf_mtod(dsts[i * cfg- > >dst_ptrs + j], uint8_t *), > + dst_sz); > + dbuf +=3D dst_sz; > + } > + > + if (memcmp(src, dst, buf_size) !=3D 0) { buf_size should be normalized to actual buffer size sent to the DMA engine,= =20 i.e., either cfg->src_ptrs * src_sz or cfg->dst_ptrs * dst_sz Example, with 15 source segments and 15 destination segments and 64B buf_si= ze the actual buffer size copied by the DMA engine would be 60 bytes (64B / 15 =3D 4B per= segment). > + printf("SG Copy validation fails for buffer > number %d\n", > + i * cfg->src_ptrs); > + ret =3D -1; > + goto out; > + } > } > } >=20