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 A67F4431A4 for ; Thu, 19 Oct 2023 06:16:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E89C406B6; Thu, 19 Oct 2023 06:16:33 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) by mails.dpdk.org (Postfix) with ESMTP id C9E2340272; Thu, 19 Oct 2023 06:16:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1G07QsrUKgauwMnIg2Le8dwkRIpVBIwzqUAy4TDrNRG4V2DcuOLcwbni7le4xkmBsTQMf0eWiVzjeXD74hp9KRNYxygVcbzHA+J1edkoAxrPhob8gFDZAqh596agQDv5iplmSZQ05YNGH9evXDafs9PgleCGopM3tJdylop6UnPDmTXJd40GDVkyERDN+OnD1sacoWyNi8HFKcogZUowFOtOkxsNj2SQnvNB1zWdj/P2UJfwfE2h87QaexZTO56R4hK6avTNcYYzdGH3Au5ge3Y8Pyb4BK0F2EFBt2LdMVf83iMFv6l0v0Si37GzNFxkvqQd2rX4A+GYpC+k92I7A== 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=o+hNLeeZfmIQqJKmtMB1/MB95T5BT+DWnFnAt/r60NM=; b=WGQ8g7y6vp7m7juSU+Q2/AwBHIFFcKPbaIKBtwRlYlLPkrt7zwVjVbleKNDk6eb6uUU9tjjdlk44KunidtEai2u1AtummLchJobpWBCZJOWKTh9Ll5EG3JPPIHYcrqTWAqI6jRDjGiUA+XIQ2/ThiHxqjNMv4tan9eEWALRDQCiBKR+j6FvpRHyW/Y8HSpbmQA6y15CWLC1Nhj+MBJPgDDdfluFEhfpvWMq5KnOBR3hus5ZHXQJRehhFRBrijVXslD2Gzd1tRwibczXrY0cwas8Tvpvbk0NcUr6yQnQDoBcx5E0U0IgH38ibLyX0wSk2C7uc760OrrFm4pnfkRcZVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=o+hNLeeZfmIQqJKmtMB1/MB95T5BT+DWnFnAt/r60NM=; b=YpxLZnnygkueK9s00whPBxdaUVZo3n7tY2Oxlf5+mdB2jL50GekMqebnL39iRCgVSpBtbHDUeiKmZ3cZHTBKPOasHX2GzEBCDdklR4BxJYj9NTWJyy8RNLCf9ePLCkzmyNrCNCZOBGG62DuR8Fd/Ubptcx10Iq3OXF0Y9OnJuBU= Received: from SA9PR10CA0002.namprd10.prod.outlook.com (2603:10b6:806:a7::7) by PH8PR12MB6795.namprd12.prod.outlook.com (2603:10b6:510:1c6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21; Thu, 19 Oct 2023 04:16:30 +0000 Received: from SN1PEPF0002636B.namprd02.prod.outlook.com (2603:10b6:806:a7:cafe::27) by SA9PR10CA0002.outlook.office365.com (2603:10b6:806:a7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Thu, 19 Oct 2023 04:16:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002636B.mail.protection.outlook.com (10.167.241.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Thu, 19 Oct 2023 04:16:29 +0000 Received: from BLR-5CG134626B.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 18 Oct 2023 23:16:26 -0500 From: Vipin Varghese To: , , , , Subject: [PATCH v3] app/dma-perf: fix physical address seg-fault Date: Thu, 19 Oct 2023 09:46:07 +0530 Message-ID: <20231019041607.570-1-vipin.varghese@amd.com> X-Mailer: git-send-email 2.41.0.windows.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636B:EE_|PH8PR12MB6795:EE_ X-MS-Office365-Filtering-Correlation-Id: a535af71-35dd-4608-0a6d-08dbd05a2b4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: twh7VJzzEXCfwMDChP7DclFk0dnRLh/60t5m/KJjOwdIgiUT6Ofpf6mJ3kHQRkLrdhnrA+n3qr4XZHUyiYDVowE0pase2SyFgzzdUlJ6xTdvmazPRKmW3QiywXHIp29TxQu/F9ttYC0OmLBsbF5hYu7b4tzeXce8cmcScC19JQj93cjaGWPs4ycesq9NLldvRMBiMSKFYR6E9ec2UMDV/cZ71jQRnhUKPE9fub0qZxajPDSFpQ8uKPNwrmAbnKG1oV2KwJQKOTr+3isvVvTr2meUzTO+Y3jSvOBzhLurzm10cGPZTif7jiX98Qk4rCjasrUBK1gWpmTAo4XB1J3lIx0a5lKwEBIRTfKy1SGaNJccLHWvWnJxvheeV85X40VI2L+24ctIwE9j52bzJkk+AgWZoAW64QNw/eNyBci5a42A65Zuj+PAShpwMWfOmcO6naegksWsKg2Io4XVnBOM1UoVE8OYPsOv8Z6W+QridH7b8FA6Ldxj5gI/zeZCWDKZaA7AUw21RJyVFo/N/OrMroFYkU0sa4sHqz8mafkdz1fPidcj7asyQxsmuY6T6p9cBNbO0fPAw1n2Ad+tWl1FGXuWkY0cven4ktKubZx+QgWJyk7ILeSBRRLFqa75D3VA0tem9bkR+WwHv/zVy+2TOEj8+tw/X+Bq+cyBk8vSIeNEEwQZLNMcdgYY0rW5Zmcl1Pc4lBT5lcwuu30svZNltD7NDyRzebCTk56BsZ9skdgkt/DTb1iR+pekM94PCmKeCMEzaQU6K3rFGylWuOKIbA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(346002)(39860400002)(136003)(396003)(376002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(82310400011)(40470700004)(46966006)(36840700001)(40480700001)(6666004)(40460700003)(47076005)(110136005)(70206006)(70586007)(478600001)(44832011)(82740400003)(36756003)(41300700001)(316002)(8676002)(5660300002)(2906002)(86362001)(81166007)(36860700001)(356005)(8936002)(1076003)(426003)(336012)(26005)(16526019)(2616005)(7696005)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 04:16:29.4535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a535af71-35dd-4608-0a6d-08dbd05a2b4d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6795 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 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 Suggested-by: Jerin Jacob --- v2: - suggest use of pktmbuf_mtod for both va and pa by Anoob. V3: - add const to src suggested by Jerin. --- 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..9b1f58c78c 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 = 0; i < nr_buf; i++) { + const void *src = rte_pktmbuf_mtod(dsts[i], void *); + void *dst = rte_pktmbuf_mtod(srcs[i], void *); + /* 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); + rte_memcpy(dst, src, (size_t)buf_size); worker_info->total_cpl++; } if (worker_info->stop_flag) -- 2.34.1