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 A336B431A4 for ; Thu, 19 Oct 2023 06:20:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 314BF42DA1; Thu, 19 Oct 2023 06:20:21 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by mails.dpdk.org (Postfix) with ESMTP id 38500427DC; Thu, 19 Oct 2023 06:20:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BV8W+tPJZdRpfRoYGtL51EkBz3sz5TJameIIsaDVIxFcIUWk5kdmNyBKHe0JPFF5RWJ1dLyKmkq28mTgtAhNNAXkiaosSezzqxLkyM4fxFznZ3+EnEiaTKKsN40APGFvboPH+oLL5t8OOk9e9+CBTKB2XisIusZDKRwiIj2ypE8CU/tgyA5+LPD6nOwsE3VvN2eHecnQ2VUzV6p0AVjHbsKqCrbYx1OFuJjNaRc9G1DsNyBRJiGt7Yjso8I3842Z7AmYXyPTREFs1O5iGgzxvHMafsrH+oCoSTC80ESwbRR+8bMGZUfxb2inAyOhBXgo0eifqwtYzbyXdXFBk9yMmA== 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=bsNYtub1M9TnvTsJJwmAsc5jCuGcxtvthQHVs1/NwM8UYwbpBJQZG9XL9OSTKSYGsO4yPcUwd0L4qVZX+P+At66KsLXnYqmzVmOxuWyJl5/JC9S0Hq/osL3AKVyeV98acFvUfkdk7hHMymuxki3qqsWVblImXBR1S1Gn8eB95aAoVMLwROM3TJCHe316DngXONCjxnN4OoDME8cKrO87Rds65QMBBIRyUMtUn4Xe7HQvEwaOKotS77V88uWrxX+91edaohCuqhOgHQGqsWSFVDKVY54L5VnDLBXUvJnrodzlCtRAukVsU8Zgp0Yq7PHQhPtl3GS3rwE9C5zq6Df5qA== 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=y0+0GrnPdd47h7iFb5nOMQvULeo/JfctjzQ1Y8JBcQfVBZt1qR/sT5w1DfCotc/t/H9JTVmtL7pj/5BVKhbaCCU2QGj0Ex+kUTnqiqvGNzQUhRTFUDHAzgTtiDZrFl6TZgmiD21yfrGBrq7tomw0Yl7HeDykGJaHz+hroMq2sqw= Received: from CY5PR17CA0042.namprd17.prod.outlook.com (2603:10b6:930:12::29) by BY5PR12MB4901.namprd12.prod.outlook.com (2603:10b6:a03:1c5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Thu, 19 Oct 2023 04:20:15 +0000 Received: from CY4PEPF0000EE36.namprd05.prod.outlook.com (2603:10b6:930:12:cafe::4f) by CY5PR17CA0042.outlook.office365.com (2603:10b6:930:12::29) 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:20:15 +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 CY4PEPF0000EE36.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Thu, 19 Oct 2023 04:20:15 +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:20:11 -0500 From: Vipin Varghese To: , , , , Subject: [PATCH v3] app/dma-perf: fix physical address seg-fault Date: Thu, 19 Oct 2023 09:49:56 +0530 Message-ID: <20231019041956.609-1-vipin.varghese@amd.com> X-Mailer: git-send-email 2.41.0.windows.3 In-Reply-To: <20230816094216.1847-1-vipin.varghese@amd.com> References: <20230816094216.1847-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: 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: CY4PEPF0000EE36:EE_|BY5PR12MB4901:EE_ X-MS-Office365-Filtering-Correlation-Id: 2820734f-3765-4ab3-d5c5-08dbd05ab1f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KV5ja/Weq3PJqSsDSFCwB5AyMoginIijJ1qLJRAeiwzm5NkVR3L+qdjlXDhDgNEpD/LZlLlBbIYfyzlg7w1u1t8iZMGQ2GrtNtjy8RUELauGpUKyQYA+qRsApnIUM2gR1tPoMjlVzuxbkJsX2IfnBtABeBM173tDgkkcE4K2XFhCRpOpCD0joyzZ4Dpv0IYEHf1sx/r37Hvl4PRLAteNEYrZHZ9/PhmxFF1XPjFqTIzLnwvN8B1x76YmT8Fx7ZvXnqBBD81IXpJlgANg+JBApluDdRwx1iWobdEu4ZglNDWIKWRnxD3EUtoG0MHQ0hdzTTJJAxEVnUMhmLYJpPS/XuGiWCb1LcHbpWi47bZtv+jaqXKAHP4LgcP3laOrZuOhU04wfCWjmKiRYD11sngAvAmJItQyM2dbbcQQGG9WK7UoEcPSoVbe3jtPMwsbFOMHGV1+i9FTwfRROzeqKriEUQWA3EcJfw3AcLj1K8B5jTtJ2SDsYlYnDJNW25bCo9es3Ij7NE1VHatO2HZh47iNw1YnMvZXwokHfiIwmlV2dmwwJ9gTFrlEj1p+HGbHJDRdr6tJoJu1rmWtV3cvq6rowUL1EtN2TWhbQlsmZZIKgg9jkJvYKZMmJUU0oEQg4ofsM+mHMYFh4BpCiMgxTpvH0+RbGMcgjF3Q7PkY4MD/t7tHo+l8RLzahkv0qV9FlWpgOBidWgPu+YWBj6DSU4nPqN2ulNgjw20fTJEgO4yO9pvzquLsUVheKHCbF79mE5kHtIdlq5v8CFFTG7HNp01nAg== 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)(396003)(39860400002)(346002)(136003)(376002)(230922051799003)(82310400011)(186009)(1800799009)(64100799003)(451199024)(36840700001)(46966006)(40470700004)(82740400003)(86362001)(40480700001)(36756003)(40460700003)(44832011)(81166007)(41300700001)(356005)(316002)(5660300002)(7696005)(47076005)(36860700001)(336012)(2616005)(1076003)(426003)(16526019)(6666004)(26005)(70586007)(110136005)(70206006)(83380400001)(8936002)(8676002)(2906002)(478600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 04:20:15.3366 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2820734f-3765-4ab3-d5c5-08dbd05ab1f4 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: CY4PEPF0000EE36.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4901 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