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 D660B4266F for ; Wed, 4 Oct 2023 11:00:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB8484067A; Wed, 4 Oct 2023 11:00:56 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2058.outbound.protection.outlook.com [40.107.92.58]) by mails.dpdk.org (Postfix) with ESMTP id C380440289; Wed, 4 Oct 2023 11:00:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0Lu/kgjXc8SWCAESps4/oJKBAACTK0Ohehilx1FodDudQU1iFxss2q9phzZeV2grf74YBfX9VJvknMOk/fIENJVKM6ey2wjnFbMlfS0HqmDYOOfANvQUhUoUpQtfZ3g+4fzTgvn4bDDMTkzkBiaUQBMUCJ57OfMH773Gs9dtj3nz4hpCz3mje4kgdz5IJcb8/NCqs9uOQLVtJ+bkdqVriaHRYuks3ix66P96pkfNiCs2Byxv0ZZeGBftzr04vr3VjofcuJ15yNi4WJew2wNwTI3MP+xBot+6kO57DvvsoDjMUmPG7exCNBPTFDqY8ysODi+PCQ/yg2IlSr566tRBQ== 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=E16wTiRHevvaDNk+D+P+or3k/WtsSFqNxqSGhBmSWMU=; b=KZU8bPzePM0WOSMbDk5tWyvDw2Pifk4gf8G8iOkROw34bNG2LkXRvaeLftnKKrKRqKCXIj9Fxl4IXyM+lm8sI20i+n1uvigLYPJy58nk6dQQjmyA3/TJLLsE7bM3xqKXYTg63bvlaT+hcusmdquTHDhJSecXJMqNLfBi18n0akdbIcPjNiFKZfrg7jp4CtQDyza/3vd0xroXn424Wcfh4xUvmORZT3tGr0aNz34/OQkq7cUXQOsEtKsriYjXluAggt47+nbgQ+aYDaDEKQfhvCKRmGO47n2TXmDZktihy1kaXnUj+3og9wPaJSjMcsYUzWo/Fz6aPmCcT8LCGnOwmg== 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=E16wTiRHevvaDNk+D+P+or3k/WtsSFqNxqSGhBmSWMU=; b=IERMKpNjOkCUa3iAu7KmoX7aNqL+ppF++LSTkaoXBCTV3xk9oGo42fR4gkm/Xr+zBZWdnjgxy8POMpfBWR+jgcJ3M/D1BmJ4DudoL+vGjQDAVq8Bd0zSqDS7PM5MTmOrwo2EFo3vZPj9nQirIlkKoLOS4LZjbiA8xMQhWd7mq2A= Received: from MN2PR12MB3085.namprd12.prod.outlook.com (2603:10b6:208:c5::29) by MN2PR12MB4158.namprd12.prod.outlook.com (2603:10b6:208:15f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 09:00:51 +0000 Received: from MN2PR12MB3085.namprd12.prod.outlook.com ([fe80::156a:c34a:60c8:2e6d]) by MN2PR12MB3085.namprd12.prod.outlook.com ([fe80::156a:c34a:60c8:2e6d%5]) with mapi id 15.20.6838.033; Wed, 4 Oct 2023 09:00:51 +0000 From: "Varghese, Vipin" To: "Jiang, Cheng1" , "thomas@monjalon.net" , "dev@dpdk.org" , "anoobj@marvell.com" , Jerin Jacob CC: "Yigit, Ferruh" , "stable@dpdk.org" Subject: RE: [PATCH v2] app/dma-perf: fix physical address seg-fault Thread-Topic: [PATCH v2] app/dma-perf: fix physical address seg-fault Thread-Index: AQHZ0CYDdXnt3jFR2E+zEe85tyQ5SLAkxkEAgBTZTbA= Date: Wed, 4 Oct 2023 09:00:50 +0000 Message-ID: References: <20230816071810.1796-1-vipin.varghese@amd.com> <20230816094216.1847-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=e29a22ad-606d-4452-87f7-c84d36aa6a5c; 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-10-04T08:51:12Z; 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_|MN2PR12MB4158:EE_ x-ms-office365-filtering-correlation-id: bd3d944f-f829-4d74-00d0-08dbc4b8680a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wyBuqcVzDqHN+Kahb6UQAfH1+H/dyMfUrtxVbSVre6W4KtEbHDhfZmQZh6GflLbGZN/wth9wejLB8xX20kZPOMKoIWv1gAJVO8beXjmcxfxDJaDyktix3kVS3Ume43RlIJ9KE8hF4P5Bo7+xLgKkQQAup/q3iXsOmG0tVZyJmPFc6gf5aktFdMP90XhBdYUpiff03Oq1mzDTaAxF75Njs4twiTDWcgtAea6VIl/Bmg1iWyVHO2xAy6PwxfI8PamcOFLKzhdMqo424NOEEkilYrRfuluQv1a8VszCJGMhrBZTRdDCJOezA1QoN2KjfIR+2bKmDTuRnDIq9JlvpGKY1BJjL2/Nd76lteTIcZ4uN15wnhmIYZpP1t0/XJNH7NLZtCqJm3H+A6gHiikRDva4YMUEHD9JDdtn+e4CnjBUi6EZuqWmyt/K+qSR+K1HNrOp7HY3tK7uy7smbtOpii5iuILIWb27sa7qC9zH7P7RSSyZXmO/KMA/FmNbh3eDN7qfHfsVE8jI1DwKHSfX8dM91+1KxF6CqEJOgzWrfBDr4y7SCfLeXkOL5DE2EJq8uZQimdYPSsGHtyN7nDvkr3+FE2K4Tom/P9es/TgItgxTNMtAY4Mhrd3No5mZZrzhxb8P 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)(366004)(376002)(39860400002)(136003)(396003)(346002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(2906002)(83380400001)(38100700002)(86362001)(33656002)(122000001)(38070700005)(55016003)(316002)(76116006)(64756008)(66556008)(54906003)(66476007)(66946007)(66446008)(53546011)(9686003)(6506007)(7696005)(110136005)(41300700001)(478600001)(71200400001)(8676002)(4326008)(52536014)(5660300002)(26005)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xhdtgKhdHKuFYlggFAM6RddSZ6tQ8lidpijq2TNP9Z+uA5BaIE0yD4uBKa/W?= =?us-ascii?Q?PIe84ivueYPYHv3gsTBoiYG6QJ2Zk7sBWdmo8AHy2/USiu/voMgv09UWg4za?= =?us-ascii?Q?epLbEtBikPL3LWV12O6TGAaQ7B2AJcg3yCfwD2MCRUzH7RF9qDD3i1nDqrpC?= =?us-ascii?Q?//N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GA2qlWOJr?= =?us-ascii?Q?QtZPzCGtMzgZKAGuWMCAFnK2Fi936kMPOwIHplZyRHOxSn19Khxr2jQe5tMq?= =?us-ascii?Q?vdzwqwNnzDjs2sJqjapi7GP/XnDeOcV+wxCWqiBYddAGZgUiOhsb070/Sd6t?= =?us-ascii?Q?Rw8kcbES3omdq48ot1YjzaEH8VjX6JdWkQildAEUdKE1fExyIilfdNajx9ji?= =?us-ascii?Q?rIaiNhtR7H3w+NXjvlsAV92fpQ8mQBi5usiCstJk1Wx/ppirxrTLQtUgGEaV?= =?us-ascii?Q?Q1HdvdDfEKDzZVrMLOJZYhW0j6vHTzHziRgvNLtdR1ezpWr6IMUDk3bcHntd?= =?us-ascii?Q?S5EJWW2Kw8W1kz9vByKDu2hKytJbb1OH3K9kjecnl5AmbVAzL5uVXsn66o8v?= =?us-ascii?Q?jcRRP6icESkgC2ieL3hB4FUqc/Dway2sCxB5FrUFC0cYVoWcT5G6798bzeSW?= =?us-ascii?Q?tHaTBcFCTZ1etCTAnaQnhOqhgT+G46WkJB/wScMfibOlok4u6fKRQMG2W1kY?= =?us-ascii?Q?Dbkx6BZzw73+fU2b+P/0pQW8Y15Jgs1PrYTL1NZ1?= 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: bd3d944f-f829-4d74-00d0-08dbc4b8680a X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2023 09:00:50.1435 (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: m9ebr3uhyNAwcYO8RmanurwPTHGX4Jbq73ckXoRbc1Pyx3UmJbANGV4xAzWmaSnzzojHcPZ0Jh4ki6jVqkQzfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4158 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 Jerrin, Apologies for the delay, I missed on the comment ``` > 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 *); Use _const_ in fast path if src and dst in not changing as better optimizat= ion hint to compiler. ``` Thanks for the suggestion, but may I ask this differently `rte_memcpy` is d= efined with `always_inline` and all places where src used is with `const *`= . Hence I have different view there as `setting const * for always_inline d= efinition has the same effect too`. > -----Original Message----- > From: Jiang, Cheng1 > Sent: Thursday, September 21, 2023 7:58 AM > To: Varghese, Vipin ; thomas@monjalon.net; > dev@dpdk.org; anoobj@marvell.com > Cc: Yigit, Ferruh ; stable@dpdk.org > Subject: RE: [PATCH v2] 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, > > > -----Original Message----- > > From: Vipin Varghese > > Sent: Wednesday, August 16, 2023 5:42 PM > > To: thomas@monjalon.net; dev@dpdk.org; anoobj@marvell.com > > Cc: Ferruh.Yigit@amd.com; Jiang, Cheng1 ; > > stable@dpdk.org > > Subject: [PATCH v2] app/dma-perf: fix physical address seg-fault > > > > 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 uses VA address and not PA. > > > > This fix invokes `rte_pktmbuf_mtod` for both src and dst. > > > > 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 > > Suggested-by: Anoob Joseph > > --- > > > > v2: > > - suggest use of pktmbuf_mtod for both va and pa. > > > > 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 | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma- > > perf/benchmark.c index 0601e0d171..1d1c9bde99 100644 > > --- a/app/test-dma-perf/benchmark.c > > +++ b/app/test-dma-perf/benchmark.c > > @@ -288,10 +288,11 @@ do_cpu_mem_copy(void *p) > > > > 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 *); > > + > > Thank you for fixing it. > Sorry that I missed the discussion earlier. > > Reviewed-by: Cheng Jiang > > Thanks, > Cheng