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 E84764307E; Wed, 16 Aug 2023 11:25:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1DBB410D0; Wed, 16 Aug 2023 11:25:09 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by mails.dpdk.org (Postfix) with ESMTP id 37E5F40EF0; Wed, 16 Aug 2023 11:25:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BwFzWQ+u5iDGdCoy+HRfkIU4xJe/nq2j3ij/PWYx5DdYC/YtT+5yCTDtaejtVRm1JP5+jzc5mIlzjRJqaqosld5uRWA+4DuzKQbmhnsq1zpXNu/4GRqFPBhJukaZcoFbSqTVIEOPWrZIuAjcpW/BIUQFkLfo9f0Zyc+BvkpbkdAEVOq+Z8dhIr1ZhY+hKKBSeScucoL4sVJLKfBleHVeLffx8E9PfBS1GKO9gLABs1rXmQlht0bnnj12mZaY7XP1V6B6i3CrD0raUV0bhd8IAEvC/LFE4rDvz0XG1og6xgtq89fxLXw4tCH997z+zYqYK+4KSiy7Ll8Ye3m68TlbPQ== 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=Pwayr5LyE8P7GwEgVoVi3gRGdQNzkRqb/l43P3hQzGM=; b=RRiXxmu7a/oM4KiRhEyS1bqtWWZO2F3uN5GBjqLUERtTTvmBk0mckyNiU1q6m3GD+0UZbq6XMhsF6xA/f9F3kgsYYPIHlNwzX4PCMFLarhfgVTXe78Yt+NmaDIOGDAJmVQtto3p+TEvPlURP6QgCSgyqupbR2UiLRH9L4f9asV6lL2c35UEVQup3U8BwBEtrnECqAUZKfxUOhnSZbTm6KDQjbkGiJHveBC6EGkex8IBHji7rQx7pa6KfWlkK8BqiWv7tiERXO6+ItlQTo8HHwQBN803y/FhK7+pALUX1pijUdgLKcyxJSeogMSrOO4S44+vE46emd+4z+zOj7w0qWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=monjalon.net 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=Pwayr5LyE8P7GwEgVoVi3gRGdQNzkRqb/l43P3hQzGM=; b=aWW1Bog0DKWQ7oBoo5bKs1inpDbf0IbvzXYI9nYUhjlf/hhyrFYQJA9tmiAa2L/Ew3Uu2l82ZeUmy4vj+bSsY8f8ao6DPtifhN8PxHdeZjj5zZonT2K+OkO3jbBVkfElcqfjCeIzzIhHCqp7gORbsbyYyt2za624w0TaKGLxEuI= Received: from CH0PR03CA0022.namprd03.prod.outlook.com (2603:10b6:610:b0::27) by LV3PR12MB9166.namprd12.prod.outlook.com (2603:10b6:408:19c::13) 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 09:25:07 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:610:b0:cafe::b8) by CH0PR03CA0022.outlook.office365.com (2603:10b6:610:b0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Wed, 16 Aug 2023 09:25:06 +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 CY4PEPF0000EE3E.mail.protection.outlook.com (10.167.242.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Wed, 16 Aug 2023 09:25:06 +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, 16 Aug 2023 04:25:04 -0500 From: Vipin Varghese To: , , CC: , , Subject: [PATCH v2] app/dma-perf: fix physical address seg-fault Date: Wed, 16 Aug 2023 14:54:41 +0530 Message-ID: <20230816092441.1814-1-vipin.varghese@amd.com> X-Mailer: git-send-email 2.41.0.windows.3 In-Reply-To: <20230816071810.1796-1-vipin.varghese@amd.com> References: <20230816071810.1796-1-vipin.varghese@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|LV3PR12MB9166:EE_ X-MS-Office365-Filtering-Correlation-Id: 651cfdb4-5113-4793-f316-08db9e3aae01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IWG0Zua8KMU4mp0iseZJU+EaDCQj0wA2bj+XbHYxOsiVzACnpDyc9x4uJ8BOdgtF2nYGZJ5wVWixFY5/t2G+bgOAmeGINxKDTm/mDHQkhW4EQSPdcJA6AbMSk5KMEVgmedGumqy6TiuuBNl6NGBT+u9Mpc7CG3RiiG5JtLKkoWf7CPQzu5kbginQLlu4OQRxFvWCJ+s4qfcfCAv8dcjGY6DNwV0S6CpMl7KVEDgeJXrGQXu4QTYNfM9szoUbDr0PCVl48zMs2Kfv4GaUNEwhvFmAUQ0VFlg0o2GWkRFWmpW3Gz4U3urNynwKku7OmavFB85e9lqkPn6MN8PVVkdy0iOx/Gn/MKFRzBcVBT3UwLyDkvQlJP0kWTAuuKzUZeES0soQ3gAO/6bluIHNtGyRFOsv203PYtTU65Fs99eTKKEqjjQgFjC6b5lQzS5K/kxXplxSIkRefSUD0Ag1x+RefHPUYy48dF6fVuUspgQ5DfBZljw5/pVUwSnZW2tKXiNOjq4l4gYXvIt0KnjHFXe41eJtGJ/5p7JcCJgdHrXqDxP/7n8MR461Go0CeDVIBOpVHHs4u1zjZEeXFY0qKbaUAUNgwrWCP8kdpUoDwKEDQGoehF/vgTuJ8PqUMMP5OX2juFZw6XuzkcWTT4lahhHh2/PshY3cXxkwqAJqspAD0QXaUUooDpZVAGMwDtYwRMJ7y5wCMOWIcAfLX/93/pDBCxeg1qSvRVhIMnUPbfwFACUFhUpJFae2IazoJlPFlTlHv7I5U1joo4M1346M6Nh80Q== 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)(396003)(136003)(376002)(39860400002)(1800799009)(451199024)(82310400011)(186009)(46966006)(36840700001)(40470700004)(40460700003)(2906002)(83380400001)(86362001)(478600001)(40480700001)(336012)(426003)(36756003)(2616005)(7696005)(6666004)(1076003)(26005)(16526019)(5660300002)(44832011)(41300700001)(36860700001)(82740400003)(316002)(54906003)(356005)(81166007)(70206006)(70586007)(110136005)(4326008)(8676002)(8936002)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 09:25:06.6618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 651cfdb4-5113-4793-f316-08db9e3aae01 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: CY4PEPF0000EE3E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9166 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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 --- 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=pa -- --config test.ini VA: dpdk-test-dma-perf --iova-mode=va -- --config test.ini DC: dpdk-test-dma-perf --iova-mode=dc -- --config test.ini Log: fails for dc mode `EAL: invalid parameters for --iova-mode` test.ini: ``` [case1] type=CPU_MEM_COPY mem_size=10 buf_size=64,8192,2,MUL src_numa_node=0 dst_numa_node=0 cache_flush=0 test_seconds=2 lcore = 7 eal_args=--in-memory --no-pci ``` --- app/test-dma-perf/benchmark.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c index 0601e0d171..9059253057 100644 --- a/app/test-dma-perf/benchmark.c +++ b/app/test-dma-perf/benchmark.c @@ -288,9 +288,12 @@ do_cpu_mem_copy(void *p) while (1) { for (i = 0; i < nr_buf; i++) { + 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]), + rte_memcpy(dst, + src, (size_t)buf_size); worker_info->total_cpl++; } -- 2.34.1