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 F21504307C for ; Wed, 16 Aug 2023 09:24:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBB1F40EF0; Wed, 16 Aug 2023 09:24:41 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2074.outbound.protection.outlook.com [40.107.93.74]) by mails.dpdk.org (Postfix) with ESMTP id 422304325B; Wed, 16 Aug 2023 09:24:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YdT6zOrF0mwhtikCO6OPmWrqm7acuiq31SsdyoiB/L1zt4yy1CbjZx5jl67c6zcQwEBg2vuXVX+fMlJ9FpRVNq5SGwEcPWlmA78Br5cRULt4ZD+vVhYc8SqPZfiEc7F33JWhmjpq1pXuWRErtJ1iOgDbrjWro/yPv5/cQjuoB2Skh6TsjnriYKOlj1NgxvNZSS2MdgKv42grL5egGqJsvy3a2MsXOWHGt+u6BIOMvsPgm7Ghk7ObbxR/ux9airRkRyOqWklcqjO3bPMxk2gUZgeMzKrjZ1qKOi38+QYEBMSyqvCqqkJo0gD3dUxBf8MFnfhp76KmJqZCtjlfsc3AtQ== 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=Tq4kOCmbHey8RrlzFOcLOCiemfeqMQeO1DbjglvM3Bc=; b=IxDI3VhjERRoytCaryWabooEq2bzeyVUaMSNKSxJkk1/Gl60SodxNhQm6Yxad0LGyPqxBQSQYVjk4eGoNtnzMCtev7t7cbLQN4miZUB5R19CR8MH2zS1l3DQiDjj4I7+IKvRD44QpMDnhvORK2UIzufSpeibzGbAaK/cKsjPccav2ro8AMJN7lfPK+YSMpZ3BqWUDs4VlVoBhijiwxLEsLaRLRo8QYTZMMARbh0UlWXeytKUNz0toUq+2QnyXAIzIExA9bDURk2s+rTnSKX/iLagtmui9fiTK0/EDTxes3DlrRJK6EPkxuSdSZb5Y6K+KGpEOlMxgpo5yIzNHyYG+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tq4kOCmbHey8RrlzFOcLOCiemfeqMQeO1DbjglvM3Bc=; b=go3SoQiLLNsWAU9qt4WaxXN1z1Y+kCo5+P7GzcOPOdcm3r+Udt0TfBehXWSRxKddcqP+oE+JOp2syitxVIt6U/wiIst9NDtexlYQANastAG2Q8FBMLIHyTxMxyzndbGxqTHw/GIyGr/JUQM2RHI/I21Ds5x2v2VxBWPpvoLCL7c= Received: from MN2PR12MB3085.namprd12.prod.outlook.com (2603:10b6:208:c5::29) by MN0PR12MB5716.namprd12.prod.outlook.com (2603:10b6:208:373::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Wed, 16 Aug 2023 07:24:37 +0000 Received: from MN2PR12MB3085.namprd12.prod.outlook.com ([fe80::5527:ce19:d57f:4172]) by MN2PR12MB3085.namprd12.prod.outlook.com ([fe80::5527:ce19:d57f:4172%7]) with mapi id 15.20.6678.025; Wed, 16 Aug 2023 07:24:36 +0000 From: "Varghese, Vipin" To: Anoob Joseph CC: "Yigit, Ferruh" , "cheng1.jiang@intel.com" , "stable@dpdk.org" , "thomas@monjalon.net" , "dev@dpdk.org" , Jerin Jacob Kollanukkaran Subject: RE: [PATCH] app/dma-perf: fix physical address seg-fault Thread-Topic: [PATCH] app/dma-perf: fix physical address seg-fault Thread-Index: AQHZz4q2Yj3M17hjGkuzGFVNff8ByK/rdxUggAD5uwCAABVWgA== Date: Wed, 16 Aug 2023 07:24:36 +0000 Message-ID: References: <20230815151042.1778-1-vipin.varghese@amd.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=9e677697-2470-4ce2-9758-157e681b9d05; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-08-15T15:13:44Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3085:EE_|MN0PR12MB5716:EE_ x-ms-office365-filtering-correlation-id: 1ad42b8b-974d-486f-e366-08db9e29d87c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QNyChzCQKYd64qxkV0vt4R7aCkKYoeWk9SuegAtVubQbmt+3YFBT1g9Q4qrVuiEmEtnAp4CKQL2bz4uQmcoMTK6Oo4BHdgW0SuOG1O4o5zR7pLSA0iZb7+9HJ+tQl8IlpEDfHwnHYWCQsoEigvxJ1dRyzdgbiaFHMFLkdMX69V2DL+p3NyKxenjh4vDIY39b9KtkYPyoJKdV7w7ruQfDTKFUsv/Y5ZKERR000fHO516/W5mvGajZmkHkNZ3ktTqh8zih2w7NS5yqi9HD8vJzsuGEYtIWQ83YIXrsNOjZmyUOhXwj12MXOXGtQP+bY4MgjL07AjOl5SgqdCIciqepkqigJUxwiH9rLeWPwOypnA4rowCMcj3bl3nejH/OwDseg3HwANuKCJ/OymfCVoqgIdddce3X5MVSHPFJkoM0DWpO2rW70KDerTxNBOSw1+1SgAtolfcT+cqiLOtaFbQ8cKHbwrHFaU+FRkU6NymX9GtzUBgVWP0oydv0ZFO+DTgWD5dFQZ+4Zs85OoIXH/EieOhA6k8tYwguhzaZE7y0tLzNzQvBi2hz64AXFRES4nP2+j07R7feKO9+5qGNAt96VYOTdIpOuE1B79AnrPg80t0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB3085.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(39860400002)(396003)(346002)(136003)(1800799009)(451199024)(186009)(71200400001)(64756008)(54906003)(66446008)(76116006)(66476007)(66556008)(66946007)(7696005)(6506007)(2906002)(478600001)(9686003)(966005)(26005)(6916009)(5660300002)(83380400001)(52536014)(41300700001)(316002)(53546011)(8936002)(4326008)(8676002)(122000001)(38100700002)(38070700005)(33656002)(86362001)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UoClIz14vszsltJ9N7yEhWtXs99ZgSpjOJkOBzjB1uj7eed+ZELbwE8wZ6/d?= =?us-ascii?Q?wpQPPY2yrbFbvuqK9StPAbG6+8UKoAUm/0MGKIn/5HvOMl0E3yE8sCFfPh04?= =?us-ascii?Q?5fmyi6anJAeiW5YsbQ0g0GibbzTqi4wPzXUhrp27Rf08UtKQh2qJVvdv707b?= =?us-ascii?Q?VS5IP7eQy9j08wHSf6dU2RyAnBpszWd5LCiCDc672kxzHfhPSQm37r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OAUR8uH5qnogKmfQh4IpxYoMPT5MmtU9CrbSlxgu3+TNm?= =?us-ascii?Q?mgt5CmovQ3QkoIoHuFXdkO6/hvarfHqsNMOYRgcDntF55mgsRZfx2DZyME0x?= =?us-ascii?Q?FZba73Ph/QNa2thRMqWP/Gv5BFtz58qe90NWqTTWHowjc9eOKiVECRYkf7Vy?= =?us-ascii?Q?SVJf/4JqXSA+Os509Pfh16GuGPS9wPdygznyjqEYdGrJ3yggInoorZyo8XXe?= =?us-ascii?Q?JPBMcNeD2XSvCvwn/jNYn1vyaw8MVxywor2exsxC0Rn+tHaB5/cyMsH5FXiY?= =?us-ascii?Q?2t8qkfJT6VIWiIC1g0KaAaMLIhiCgHsfiA0w2ifjdf3n0ybIXAxF4Yoe7IAs?= =?us-ascii?Q?Z/5BsFZ0nX46vPfKQpR+CBBJPcI7RswbHP20mfFNxOK9AoLWjFVxQwjwpn6T?= =?us-ascii?Q?Z0O08CrsfeNlU51uoHMftwGBMoZsiFTHUdtu6Zg4siVcfUR9OCeHxPebMsqN?= =?us-ascii?Q?EdYbTx2WVWXzTHWt0oo=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3085.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ad42b8b-974d-486f-e366-08db9e29d87c X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2023 07:24:36.5900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Y4XOGzjIFwe6ST+iw01Dprj6bCCuyUDorSENzISl28adiAfZVaAKdvbc2zKpxzeQBOz4ZWNU942wC2HBRfi62g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5716 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [AMD Official Use Only - General] Hi Anoob, > -----Original Message----- > From: Anoob Joseph > Sent: Wednesday, August 16, 2023 11:38 AM > To: Varghese, Vipin > Cc: Yigit, Ferruh ; cheng1.jiang@intel.com; > stable@dpdk.org; thomas@monjalon.net; dev@dpdk.org; Jerin Jacob > Kollanukkaran > Subject: RE: [PATCH] app/dma-perf: fix physical address seg-fault > > [AMD Official Use Only - General] > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Hi Vipin, > > Would using 'rte_pktmbuf_mtod' in 'do_cpu_mem_copy' function resolve the > issue? https://patchwork.dpdk.org/project/dpdk/patch/20230816071810.1796-1-vipin.v= arghese@amd.com/ thanks, that is what we tried and tested. > > Thanks, > Anoob > > > -----Original Message----- > > From: Varghese, Vipin > > Sent: Tuesday, August 15, 2023 8:45 PM > > To: Varghese, Vipin ; thomas@monjalon.net; > > dev@dpdk.org > > Cc: Yigit, Ferruh ; cheng1.jiang@intel.com; > > stable@dpdk.org > > Subject: [EXT] RE: [PATCH] app/dma-perf: fix physical address > > seg-fault > > > > External Email > > > > ---------------------------------------------------------------------- > > [AMD Official Use Only - General] > > > > Apologies, marking this as `NA`. After recheck of this logic without > > use of ` rte_mbuf_data_iova` will result in mbuf meta-data corruption. > > > > Need to fix this in a different way. > > > > > -----Original Message----- > > > From: Vipin Varghese > > > Sent: Tuesday, August 15, 2023 8:41 PM > > > To: thomas@monjalon.net; dev@dpdk.org > > > Cc: Yigit, Ferruh ; cheng1.jiang@intel.com; > > > stable@dpdk.org > > > Subject: [PATCH] app/dma-perf: fix physical address seg-fault > > > > > > Caution: This message originated from an External Source. Use proper > > > caution when opening attachments, clicking links, or responding. > > > > > > > > > do_cpu_mem_copy uses DPDK API rte_mbuf_data_iova to return the start > > > of the virtual address for both src and dst. > > > But in case of iova mode set as PA, this results in seg-fault. > > > This is because rte_memcpy VA address and not PA. > > > > > > this fix checks the iova mode and invokes rte_memcpy with the right > > > arguments. > > > > > > Bugzilla ID: 1269 > > > Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test") > > > Cc: cheng1.jiang@intel.com > > > > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Vipin Varghese > > > --- > > > > > > tested for both va and pa > > > > > > CMD: > > > PA: dpdk-test-dma-perf --iova-mode=3Dpa -- --config test.ini > > > VA: dpdk-test-dma-perf --iova-mode=3Dva -- --config test.ini > > > DC: dpdk-test-dma-perf --iova-mode=3Ddc -- --config test.ini > > > > > > Log: fails for dc mode `EAL: invalid parameters for --iova-mode` > > > > > > test.ini: > > > ``` > > > [case1] > > > type=3DCPU_MEM_COPY > > > mem_size=3D10 > > > buf_size=3D64,8192,2,MUL > > > src_numa_node=3D0 > > > dst_numa_node=3D0 > > > cache_flush=3D0 > > > test_seconds=3D2 > > > lcore =3D 7 > > > eal_args=3D--in-memory --no-pci > > > ``` > > > --- > > > app/test-dma-perf/benchmark.c | 36 > > > ++++++++++++++++++++++++++--------- > > > 1 file changed, 27 insertions(+), 9 deletions(-) > > > > > > diff --git a/app/test-dma-perf/benchmark.c > > > b/app/test-dma-perf/benchmark.c index 0601e0d171..73200e1935 100644 > > > --- a/app/test-dma-perf/benchmark.c > > > +++ b/app/test-dma-perf/benchmark.c > > > @@ -279,6 +279,10 @@ do_cpu_mem_copy(void *p) > > > struct rte_mbuf **srcs =3D para->srcs; > > > struct rte_mbuf **dsts =3D para->dsts; > > > uint32_t i; > > > + bool isAddrPaMode =3D false; > > > + > > > + if (rte_eal_iova_mode() =3D=3D RTE_IOVA_PA) > > > + isAddrPaMode =3D true; > > > > > > worker_info->stop_flag =3D false; > > > worker_info->ready_flag =3D true; @@ -286,16 +290,30 @@ > > > do_cpu_mem_copy(void *p) > > > while (!worker_info->start_flag) > > > ; > > > > > > - while (1) { > > > - for (i =3D 0; i < nr_buf; i++) { > > > - /* copy buffer form src to dst */ > > > - rte_memcpy((void *)(uintptr_t)rte_mbuf_data_i= ova(dsts[i]), > > > - (void *)(uintptr_t)rte_mbuf_data_iova= (srcs[i]), > > > - (size_t)buf_size); > > > - worker_info->total_cpl++; > > > + if (true =3D=3D isAddrPaMode) { > > > + while (1) { > > > + for (i =3D 0; i < nr_buf; i++) { > > > + /* copy buffer form src to dst */ > > > + rte_memcpy((void *)dsts[i], > > > + (void *)srcs[i], > > > + (size_t)buf_size); > > > + worker_info->total_cpl++; > > > + } > > > + if (worker_info->stop_flag) > > > + break; > > > + } > > > + } else { > > > + while (1) { > > > + for (i =3D 0; i < nr_buf; i++) { > > > + /* copy buffer form src to dst */ > > > + rte_memcpy((void > > > *)(uintptr_t)rte_mbuf_data_iova(dsts[i]), > > > + (void *)(uintptr_t)rte_mbuf_d= ata_iova(srcs[i]), > > > + (size_t)buf_size); > > > + worker_info->total_cpl++; > > > + } > > > + if (worker_info->stop_flag) > > > + break; > > > } > > > - if (worker_info->stop_flag) > > > - break; > > > } > > > > > > return 0; > > > -- > > > 2.34.1