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 D03EA43052 for ; Tue, 15 Aug 2023 17:15:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9BA243259; Tue, 15 Aug 2023 17:15:14 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2069.outbound.protection.outlook.com [40.107.223.69]) by mails.dpdk.org (Postfix) with ESMTP id 0D41D43251; Tue, 15 Aug 2023 17:15:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oghQEODdvyGUSmO+fm236t6nFS0QsIDAFqbXXkNBNApi3OV6+BTE0r8GW9hE+ZQGumtLuxsUxB9+Mo7tzKJZOfHcRwRuWSZFLVr/hJVX7IofdZ+kGgvJJEBfnu9bUjCeTzL7Vsi4nZtftUnIpE56591ogkA7d8taUvdkMtUs4/viaA04fvOxGV4/+R5fZK59c69dmuZXYMY/jdSn+hFQOtt5Hl7x9h4BV+W6tSzPsuUBRvDeVIba5LacnhTaSV04pbr6nvdqY0u/ruQhk9nVTfL16LW3rMJsDx0xEPlKQMswwBlggSncj/DKMONu4QMznVtmQ0rN5QTt2aQdSilhww== 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=YjavAO74AzEPkVIZso03P0Gfnj9wb1S6lPo+Bi6USMo=; b=nhEpCIINMkJRUPNLSfEnYMI6iHaPBYnKTjuN+eED1tqEC+H4zsRd9tzitwwOeWYw4H4rnO543/JB5PFxouOhQMMuOXVqz7eQthTD73Xh2r5X6urr8fx6iO2F4tF4xs3tSKwIbNZp2KcNSqOYbULJUK9unJRrCKdVMMc7euZoqJTL/et5aZTpQPDRwxPut4odtX9ZVBvYXlCFcDijabPS5iF9h6/T5ztR2Ewt1lVfBn3794S6ICA8XLy8JpVE8RvqHHCWbLJ4cawrHxF6VnTfz92KsPFjxd+KMf4JWwNWO73ElMr1QRsn+fAZNdV0ck37mo9DjcN8o2fSZUBMYo6+pw== 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=YjavAO74AzEPkVIZso03P0Gfnj9wb1S6lPo+Bi6USMo=; b=ULaNYs+VvLPNyLt6XuS79cxqEgdQqVt7dUTUJPB+0etdDp273ftfRdSQK6hzxyDrD1YRzz5sR/YG6oiqPhd0TbCwBBOucFXYhdI+6hgbS5TApR9fgmarb8KZ+GitFNILRgr//NWrPxSdgeNcgthEeJv24zpPOdvW5NXB50aS9rA= Received: from MN2PR12MB3085.namprd12.prod.outlook.com (2603:10b6:208:c5::29) by SA1PR12MB8697.namprd12.prod.outlook.com (2603:10b6:806:385::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Tue, 15 Aug 2023 15:15:10 +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; Tue, 15 Aug 2023 15:15:10 +0000 From: "Varghese, Vipin" To: "Varghese, Vipin" , "thomas@monjalon.net" , "dev@dpdk.org" CC: "Yigit, Ferruh" , "cheng1.jiang@intel.com" , "stable@dpdk.org" 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/rdxUg Date: Tue, 15 Aug 2023 15:15:09 +0000 Message-ID: References: <20230815151042.1778-1-vipin.varghese@amd.com> In-Reply-To: <20230815151042.1778-1-vipin.varghese@amd.com> 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_|SA1PR12MB8697:EE_ x-ms-office365-filtering-correlation-id: 03bc2155-c312-459b-d75d-08db9da26a6b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: z9qrz0r7+dRNwPRxeQ4ks6AEN8iDEuMz0tEKTMYLme325XGXclCWUZBLBxvl+i1/x2X1A0lSpjDkmyz/w09dUBbG+kxFiOagDADGJoBMkg/l4n7oLaY/8TPzd/COZ4TRaCExD9UevnZGeq24JOUlYx5Oddh898d9zrCrU2u/HwlJBNIdhYPb3OqvP/gjJ4UXjrJQz49/G54krDDxKqduazbZdAet6izbaRxaZ7LH4b4mNl9nzpx+XFEfMAQDyf5POXcMxt0pIuAFDa304zeAYBw+drX6KXNsvfMVw5TBq69UIg+81XTfHQ5tyFLK5VguoQTGfPKfbUwRBhjJ2NqYzKFXlXoKZew/2uSI7Zjrbk2hiQ435uJMhaJacxHx2eSgK9jtfTTdTP9XiQ/yjq68BVV7+Xdb6CCIVezHxOgozpGBzC21n2bxgxCwlrkoIU+WC06QGxGJa+rmVd7e27CGcuGmOTBGZFAiMcAY0m14ArThkHcn5dzSR9Z2BsudfhHOmGn+7jDxUQvua8l1W1VsJ/Nf/VAFL1lPno8t9cYYezW4htiEy3yOkTrwH6482lFMBiRczk0vcjVCiKJOMdpstx5ivyHeN96VlEwx1vR8S22Fr5h4GAhp/8GhHaOjlTHR 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)(136003)(39860400002)(396003)(346002)(1800799009)(186009)(451199024)(478600001)(110136005)(66446008)(5660300002)(66946007)(66556008)(66476007)(7696005)(52536014)(54906003)(9686003)(41300700001)(53546011)(6506007)(316002)(8676002)(55016003)(26005)(71200400001)(64756008)(76116006)(33656002)(38070700005)(83380400001)(2906002)(4326008)(8936002)(122000001)(86362001)(38100700002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9aHw4GwDAlcfgO/hv0AgYuMHnMJnodszS0EUDup/rhuyZfs4/j5IUpcwGFr3?= =?us-ascii?Q?6Bg+HrrqxVlslvljqnzEC2/l8yb7yzFvVt8EvVJNnO7191G299+bEng2DM3U?= =?us-ascii?Q?NCP1qd07yUf+UK2LM7GGTpuN5khacc2rutpA+xefWBTzuyQt4vH+0mrBeND0?= =?us-ascii?Q?mfDwmCwYZI4xStmBANmWuvNgOqAJtbGDGk+0cMRJZmzQYvo/v0v8Wzxt8DFt?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D1oEFxwIOXqbTBXHhRoqTUdKmWLIWmga?= =?us-ascii?Q?c0EQKyulrA2+o5NfbZKPbXhflo/vQeJfz+1+nolq6aN/GuVSSTnayqYBkkAq?= =?us-ascii?Q?8l90dHNl7xxTGXtdlRuM+0QEjMyk1j/Gdf63j4F5n/AMyXNrP/ifX4A3K/r8?= =?us-ascii?Q?+5PnaVdHkntAcH+y0UdmIAfTdiC5ZgKHYV+sx7NcEzba5keHO2Xxx5R4oVHM?= =?us-ascii?Q?mPaVXclb3S+DukkeKnY+jn9TpB3kG9BM9rVj5541RTIa9YIp+X/BwoO4PtJX?= =?us-ascii?Q?aCTzu6RgvBOuTzF+3uH6ZP3+xXcEzf+Qe/GlgskniWH4CbOwXY9zLkrxv5SL?= =?us-ascii?Q?n/+vf8L3lwF+r0TvbwT/0na7KSIobO/uCCUZeuKvm82lYTNEhtpfpEAPTkG7?= =?us-ascii?Q?e8IqhLTKcbTdInGP1MfmPVfshz3TapTQe9N5tMv1m19kZM8f65j8FQF6vNCi?= =?us-ascii?Q?2g73oAcWDt6rVd59pT4=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: 03bc2155-c312-459b-d75d-08db9da26a6b X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Aug 2023 15:15:09.8375 (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: MZk/6Ae61Ikihiz03s7rAOxhPL5tKXwVnjMkXfECTOlbqA0NcfBEpW6bUWHP5u6ciTcHo2iTy15MVFW4mgJRjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8697 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] 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 caut= ion > 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_iova(= dsts[i]), > - (void *)(uintptr_t)rte_mbuf_data_iova(src= s[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_data_= 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