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 CEF9F4307C for ; Wed, 16 Aug 2023 09:31:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2F7F43261; Wed, 16 Aug 2023 09:31:39 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2086.outbound.protection.outlook.com [40.107.212.86]) by mails.dpdk.org (Postfix) with ESMTP id E9B7440EF0; Wed, 16 Aug 2023 09:31:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hqK2UZYr7HjXjRRvmL9y6bRJuCOlTbQngDI/I789m23QWDrkZ/mOeM0nPIDrT4lzFzoTWsP7DtyjrmwX2f1cEpld25TApJKHLjvOjxr4UlYVKOFbVmoNzfOCcmtsoJ1Qq0WaG0bDmPKtCZK8DYPO+CXvLTDo9b3YUDpFgOjZmvYK5fkIeKPmwgxvmjDYswUGhyPO3arLB0ngbjxxgU/WWlnc4TPOoPf7B1j0QSlSYHvIwm89aJGH9qfRHx9GcdhoizKZdFcdK4493xDZNEMAnMTFhmFPhTj0kkDv+c1d6uv061e1c3KJ8wkffYcEIWE3uTVKInt7mku//wxhhDOwLw== 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=Ob2jwAlUmshQxsJH2NtYgm2bcVQIe75cn46/TmrO9dw=; b=SXEslgfrZwdEVXpoxFowzccmRfjc8iQrqxZBD7E4GEgqtCT9IEJLe89iZhGfqnYyjFCvsxWcRD4zM0ym5n1twrqW1Do3PRONwj4CYN3s/Hd8OjPGogWax7idFBU3JmMgjFB26KQ8QVbZyRS/kdYM0zEJCDcoID0gYZh9Nt+I8XRnkL5hY0wL/Lo3Z+FvviFPnjB6imSyHeCJ9zQ+kixILvQ/ioVINmg0KfijVabQW4hJ0Z0LzpsI2bbMOzjCHJJKnw1KPll8fqeR02sYPqKcWN5I6P933OodLJWu0E/fzG2WrS+JXSkw5aTk5eytc1Rjy/gCrEWDwQbpgNTgf32wEw== 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=Ob2jwAlUmshQxsJH2NtYgm2bcVQIe75cn46/TmrO9dw=; b=k1nVmDs3ALu2uHW4fXxgXLTnAtTuxleAynIbP1OwlUWgdVKdGcIssbtZAkpA2z1bfIxort3eAcEWkVg/vFNdBktka/sPrbsM0LNHvYiH2Uag3s+u4k5rlo5rZ5vhEAnPNGLWSxVoxbEqjW/Dr2cJF+vzLYMhqZu4w2SBITMeKyI= Received: from MN2PR12MB3085.namprd12.prod.outlook.com (2603:10b6:208:c5::29) by BN9PR12MB5242.namprd12.prod.outlook.com (2603:10b6:408:11f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 07:31:35 +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:31:35 +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: [EXT] [PATCH] app/dma-perf: fix physical address seg-fault Thread-Topic: [EXT] [PATCH] app/dma-perf: fix physical address seg-fault Thread-Index: AQHZ0BHfJzRAxCKuYU6sJySLFuaVfK/shfAAgAAAXhA= Date: Wed, 16 Aug 2023 07:31:35 +0000 Message-ID: References: <20230816071810.1796-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=7559ba98-aeac-4e08-a041-8e25de1564f2; 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-16T07:28:16Z; 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_|BN9PR12MB5242:EE_ x-ms-office365-filtering-correlation-id: c7ecb02e-f448-4055-07a6-08db9e2ad239 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gX/jEwe5OU1dsRz3ydKuwIaDqakJcMlRk8P0RkVvWe8T+DlxbLphZWOTqofI5Ugw2GzeZZnzfG3MbAxmjybrsIby6OD3hMx1Y6lVEYm9dh/+6fvk33lTGDFGDzIEuiV4mDWnCcTVFotxdFA93qhiOblB057jSQfh0Dx6vmZHkGCsjfDHTrKxZffgsPEEDyqHXMP/EorKHWyNw86qE5tRFzI0H5ou+kLwwOuYNXuHs6Ydyf/9oOYgm7r6w7D12WXdVu/3m//beoj3uTlGO1dL5xZ2lCw+PpyhR+Awt5eguvD38fSsFJHxqdfE8MKYOQm8Fxcn6F42SOzaMMDUrwIIDTqcpG7ps/KL9TWtgJWHHbe3WUkPw8MPJzVINs19DbdjYPKWRldjFW2P7LsoUb7E8+ybjHTQqFl9HgFwt9TzfILhiEJP2Qjb9q8Rn2aR4/YBxP6JvYwUUio9CLi8U/DiE5ozfZvV+6Ru7MnwgzyW3fXmQG73CSwW6YJx+hcuBcsgbd+6zlPmIge+XPZkris0gcOOFPMPqevc9yh5JCA0fddyu2LaijlJe22qBCuZorb/LJBzEuPAcW2oZNPVDYKsQ07LEt9cGryQqXMy7wr7YyGK0DEKZ8rpHAfWeysoNNrc 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)(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?GF7MIuQJVkNYbQhzMP2oj4MMpujlHQyaPYRMG93hWLq/he2BnJ2ydKQq4txY?= =?us-ascii?Q?P1ciIGOVHr2bLkBHISjnVAT8CvxHAAmUM+FKOCiyJl4VweIrt6ihrjXVXPzo?= =?us-ascii?Q?LMlQVAmy1Y3qyH11IDS2ERkH/zxBdRVcvL2J1xGDdfhXspre7yLeBsHCxFFq?= =?us-ascii?Q?mZ7QWF97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= =?us-ascii?Q?5aKKusqXZEiXiBZpydwEpV1tlDecuQGZjbcWKphM2nWpN3zzMUOR4PQT2o/l?= =?us-ascii?Q?edtBfuuvat3LhwiTE6StyKy6mR3QW6HAL/in2lxS/OsoYlt4bw9pU4gUKhHj?= =?us-ascii?Q?CdmPAEOusMWmfi+wt71ZLCEmCuTt+RkZRyeHUYDvcJBXz0eies/GFszM2s8Q?= =?us-ascii?Q?xTLA29eKbONK/LR6DBfozkGAt9qe2DrPTirSI7OXP8AAu9DSk2jaK4LGtAal?= =?us-ascii?Q?a2MU2KZJ8kBWnQafoS2eW3ygUyyBzYCTOzvUJciTpSLKn63bcOkw9+p84F6p?= =?us-ascii?Q?nUHHCH96bmICaHcdTnCFHwbRrvMC+lyVGnHrIFLRAwesLkv+vp/duTQnqVvO?= =?us-ascii?Q?Sed0TZiTi4oLcKfXvHkyDarXs9hl0uZmlidgIdWwaxC9CTb1TpJM4DFoNP8W?= =?us-ascii?Q?5nVcpM/nMDolLl12hp6S/4DhUaGfpjtNDDR78+7B0ipmbmfz01Y8wnkGfnG3?= =?us-ascii?Q?UwHodtW2YW2Q9Tfz5+A=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: c7ecb02e-f448-4055-07a6-08db9e2ad239 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2023 07:31:35.5653 (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: 8faEfiMgIkPBJTNeUI/MK38IU0JhcSAmmQ1yaLT3w5e6hgGZkKh+CTnudBbVU+HN6JPKRWug9av+vBJ4qg3olw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5242 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] > -----Original Message----- > From: Anoob Joseph > Sent: Wednesday, August 16, 2023 12:57 PM > To: Varghese, Vipin > Cc: Yigit, Ferruh ; cheng1.jiang@intel.com; > stable@dpdk.org; thomas@monjalon.net; dev@dpdk.org; Jerin Jacob > Kollanukkaran > Subject: RE: [EXT] [PATCH] app/dma-perf: fix physical address seg-fault > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Hi Vipin, > > Thanks for the update. Please see inline. > > Thanks, > Anoob > > > -----Original Message----- > > From: Vipin Varghese > > Sent: Wednesday, August 16, 2023 12:48 PM > > To: thomas@monjalon.net; dev@dpdk.org > > Cc: Ferruh.Yigit@amd.com; cheng1.jiang@intel.com; stable@dpdk.org > > Subject: [EXT] [PATCH] app/dma-perf: fix physical address seg-fault > > > > External Email > > > > ---------------------------------------------------------------------- > > 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 | 39 +++++++++++++++++++++++++++---- > > ---- > > 1 file changed, 30 insertions(+), 9 deletions(-) > > > > diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma- > > perf/benchmark.c index 0601e0d171..5573acc9f9 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,33 @@ 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_iova(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++) { > > + void *src =3D rte_pktmbuf_mtod(dsts[i], > > + void > > *); > > + void *dst =3D rte_pktmbuf_mtod(srcs[i], > > + void > > *); > > + > > + /* copy buffer form src to dst */ > > + rte_memcpy(dst, > > + src, > > + (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_data_iova(srcs[i]), > > + (size_t)buf_size); > > [Anoob] Even in case of VA as IOVA, rte_pktmbuf_mtod() should work, right= ? I > was imagining a simple replacement of ' rte_mbuf_data_iova' with > 'rte_pktmbuf_mtod' as the fix. Ferruh and myself believe the rte_mbuf_data_iova should have been working f= or both PA and VA. But internally does not. I think what you are recommending is for both PA and VA just use ` rte_pktm= buf_mtod` for both. Thus we can avoid the check itself. > > > + worker_info->total_cpl++; > > + } > > + if (worker_info->stop_flag) > > + break; > > } > > - if (worker_info->stop_flag) > > - break; > > } > > > > return 0; > > -- > > 2.34.1