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 B14034307F for ; Wed, 16 Aug 2023 11:36:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8B1C4325B; Wed, 16 Aug 2023 11:36:01 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2066.outbound.protection.outlook.com [40.107.243.66]) by mails.dpdk.org (Postfix) with ESMTP id 1F2F640EF0; Wed, 16 Aug 2023 11:35:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ib7PIqdz1O+KWGtys6EAQvw6SiLszZV1nmW4v1gDcGMQ2fmsKa9CbmqAQPpCe+L2NUQuqX0U9+5/JkJ6JHo7JtPUkA3CrE+O4PlL9qgTwBFnXOc/NbL5mjkAT4KFmf7zzr9loJoRFM/hDtqX2BOLH3NxDudkTIdKVCKvpSURIkqVJVaDLRUcSfwdfTL99zANq18aOHuf+LrHcNsrLDAAT+9CtHgc0eRe/CuJGCbzTjisXYGtFlia/ScmhQP/lSJeNOuytQsSFvYOnKvxTGh9O+MUoL+X+j3mBboSOB0kQ491A8y241TtNav1SXnk1Ugz6mNG4XWhK9Gz2iMWMuRdzQ== 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=ajH7XcZ166pknryWJXqc5j6VGPIKTIDSRWywdszK1iyUHjlr+9W2OtAFy1LKKOGJ+yPtTP63N/LsGSpA3m2IqIRNnti0dCmBXEDQSHbC+9PQciy2LSm/nSVahimhNw1NtqQlYuF6TTBcBiRpZD7BLgnC8QtnRzdkFAAgjqVhTaYcWRJ7CLrBfjLwCdi+c0uX2AOadZEBjDTIcDLfPUCvBr0mzgeJWOSYh1yRbKbFINgGhjnkdHNMZMFHy1sX6tIwK1PKhmTdVFqJGflIpULeOQ9lcw2ZpcgTQNqHdoOhec9rkLRAnJKaMxlnYAxzLr/wuV7H3KfmUBlGTgkAoqVn/Q== 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=roWj8lW4YLmLSd9EOr1apHDayajNXFMnVMOmQ+uzfuHEcjE6NKVJjSWBDGQ8VBi8DWBuxGQcYUbth5SjHoHp20P+pz/RqdP9xI94kNXbuxoLYLqzTRnH5hLt4jKJC2wzh/aI7ucn4bwn+JeYurbVb61VhvFygnXA/z1BBxQ3bQ0= Received: from DS7PR03CA0047.namprd03.prod.outlook.com (2603:10b6:5:3b5::22) by SA0PR12MB4557.namprd12.prod.outlook.com (2603:10b6:806:9d::10) 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:35:54 +0000 Received: from CY4PEPF0000EE36.namprd05.prod.outlook.com (2603:10b6:5:3b5:cafe::e3) by DS7PR03CA0047.outlook.office365.com (2603:10b6:5:3b5::22) 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:35:54 +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.6699.15 via Frontend Transport; Wed, 16 Aug 2023 09:35:54 +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:35:39 -0500 From: Vipin Varghese To: , , CC: , , Subject: [PATCH v2] app/dma-perf: fix physical address seg-fault Date: Wed, 16 Aug 2023 15:05:21 +0530 Message-ID: <20230816093521.1829-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: CY4PEPF0000EE36:EE_|SA0PR12MB4557:EE_ X-MS-Office365-Filtering-Correlation-Id: 709086b5-071a-4662-cec4-08db9e3c2fe1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aucQ28FvTEw/FgB4S6mDvyKXOfqcgr0ZiKLNjwyur1T9SKjq9p0NWwv7gSrQ6eMRRCOmCFsvsvrgWD/oNd6CwdV7T+xg8D/REMHLc/sPjs4ovoOz0N1pc9ulHFbTVUaxU6alisNlUHaXewmWCEX4ZXWUvXVdcfMt0tt4J+2Fup1NAu6HiJKnfzDuzIBjnK7njd12fwUGPO3jcWy4QE4irh4bW+cyWXHHDMuFbLlZa47613eJVQ99xKim3A/9oPNLqfA1r4w92NqLF9VaM/X7+Z8PRcUBv6WBJ6NNnNAAiPCkd9FXyQvXSybDK7iWTAnKbBF8tSnFCvKhVIZ0k6/zdrxjIRL+N4ZxVfsgFplh/eDNOHSpcqv9hwKtalnBfPRzH1qLx5ekawTzNcCze6bQJD0v6VFpCqo1yaKBlV1QkbJ7NbZk8q50kBamCVBId/k3S3ZMi7NR1x4wnj8MMub4HT7tOuXEw5KSsyyQqlPFEJLGko+gD1MfNYBefMlS6nCAL9Iuw7GLCbetL3jjJsfTTDlwnn8xRwHX7UB0fcXa7yomNw0U76Cqe8dFpqYEX5/8v+Duby7jdCRgvSfALyYlU19tuF7bzVMy9wQO5pyDercNC95ECh4IC3td8rjkIbkrxU5xpIZaNg0VEKVgPaEthgH/7YRHRO69oV/Y3q17OSHBOt5u3JYur2FsGy/nGjaAVP9rEFeyGqiwwGHIgExpAB/x6IsI4iJ0ZMYhgwGB10O6lHiRveArNd1qTUCvEWcWV9hLFbFQ8wvyOTMfzer7dA== 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:35:54.0673 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 709086b5-071a-4662-cec4-08db9e3c2fe1 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: SA0PR12MB4557 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 --- 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