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 6F729A034E; Mon, 21 Feb 2022 15:51:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05A9D4068C; Mon, 21 Feb 2022 15:51:28 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) by mails.dpdk.org (Postfix) with ESMTP id 232214013F for ; Mon, 21 Feb 2022 15:51:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=li/59Y3p2mJG2wWxAUfF89Irze07N0xvbQNN6lyVSpBh7dfxvFcfeuhJawzxHzqWDY7Gq3tpUDa0AQKheu2ZX8JCizXuPaRjFQxZgzQL8ku10EHb14JnEW8jKcMw9EeluPoWyd336+JpBTu5HNDnltF/VskiiDDXrr3ZwnTymNyuw9X0PdWhDHEpxjuQ+fcXmAr42UuUqC9Pck1OwlnWy8jHb1eBR0SY12+aE4SsdXEbsc3kYO7RZRjoFfngQ+LMTSzar6rkmSgyHs7NaAA9B241bLMvkTbMUvwU5YrkbnsWAhSWy6pWukJYFbLm1lApogyF6zyH73KYnCcnmjg81Q== 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=suqK1x4k9hNNmWHFZ2IbetbB/pPnMi3GZ61Vl/sU/RQ=; b=exlTxqELiAQ/XKSJVGUdyrB4i6uRATkOKEhloQXpPquKj2WARVnYW8Rt8ChMREsFszu+k3H/OSTq7Djx/bK2YlVCb+FXrfyuTIqFonrKbfxhgGwkMFPHeVNjmZiiHET5hbKp4wbqUj7t0ec6cJwAZFY0XQ3+UmlF4ic+IIJ9L4YQFrKQ/nYPn8V+WacPZOfZO8lgCoZT9xCWZE1+WqxojSnJFr6xB7bO5uBiU/hWU2BBC9AyGxsA4bxahPButf8okailmtrO+7RReswshML79L3fqVqcHDfnWQUuI1yRt3jfXK2BXn4zlb08XD+V3epTqy8grztdEUrRbmozl3RTCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=suqK1x4k9hNNmWHFZ2IbetbB/pPnMi3GZ61Vl/sU/RQ=; b=ELaQrf4t5cHgvBFZ/0AvItDkYuscULKI2sk/pX02zhNCLIfV266k6uH1L4mktkEwWRpCnh0d2uWD4zQL7NnbFYGJGuYfPMEQYjiRQTPojhYO9q664flPENwD6oxtVneTtSKBWq8joZJ77PH/19+rWR+3NLueHNQqKayWJPloNC1T8nJCpflHzCp0oOAJvH97PqWY6QhA46NTR2o7FaaHjFgN5PFU/WcWZmy2AeZR+6qwYHO5fBx92hJCVxzPOdfksJZ3TwHhYciVfoUVw5drFfnwyMaQLO2EKuxzMRh340g4d5Kmu9fw8dPl/x4p6V56X+V2cy8v3NRbjkUQqQJBYg== Received: from BN6PR11CA0054.namprd11.prod.outlook.com (2603:10b6:404:f7::16) by BYAPR12MB2646.namprd12.prod.outlook.com (2603:10b6:a03:65::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.22; Mon, 21 Feb 2022 14:51:24 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:404:f7:cafe::d1) by BN6PR11CA0054.outlook.office365.com (2603:10b6:404:f7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24 via Frontend Transport; Mon, 21 Feb 2022 14:51:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Mon, 21 Feb 2022 14:51:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 21 Feb 2022 14:51:05 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 21 Feb 2022 06:51:03 -0800 From: To: CC: Elena Agostini Subject: [PATCH] app/test-gpudev: use GPU ptr to CPU unmap Date: Mon, 21 Feb 2022 23:00:52 +0000 Message-ID: <20220221230052.17607-1-eagostini@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02a54a8f-efb2-4c02-656d-08d9f549a174 X-MS-TrafficTypeDiagnostic: BYAPR12MB2646:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UMww5SYBnlH6tT9Lv6p26mPlyUxJHRURF7eeUHLQy6D/hP2zu5E7p9CkIcZWUhBZFGMvBFmZ66N3Ag5nKT4Bkhf2pHxiY38Snqp1FguwtVbS2VXoCpczi/54WMGbt+IpGU/abV3TB8fRvC7/NTgDbcfyFjYuAr5ITSm//b8725MKFv9WUrqssyqrD8fNCkpSJ2eirevhZXOJoClBznrp/jsUNGARJtT+nMJnDeYfjeYc17zRHMSs0vYIFMWGZnIwe96UZgFxAop1LaJErI9TNug9f/C7nr9b4vYYWXLNZtdY6gRnpjmg84oK4OyN+EhbhiqKbrPRhHGExz6RDVYkBM/XMBsnJwewD/zbXGmCPQt1xJkzo8kqWrFb4SAMJ7qyWIrY7Io1ieIfSZMFiS46n9+1gnMVe6uOtWvitFEarz7Qw/D2FZAcyw3WZjyx7PEpnnzcTYKIpaZkWdWWU1wd6OX6rzHeUnrbOmHNbCHn+WG3bRZV5wPS20axKBEpq86wjvic+OPM6dTPga/TfdMuFT1Vlu819gKpBo2tw1gqGhyKH5ae3zHd+YNw/9Xng4XHO2hLAvoArti+/molvFrxpmzl+Ees4mFJFCKxidZl3jT4XZwk8RRLh2+o4Pe8N5OmjBWdWUK+Rdse5pvX6vzmt6PL4wjAMuE+rDg63NvxgMciP+Vngp0IwR3IJwerPaQQmF1kFhz91+5wkzqYf9C/Jw== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(336012)(6286002)(186003)(316002)(426003)(26005)(40460700003)(6666004)(47076005)(86362001)(6916009)(55016003)(7696005)(4326008)(36860700001)(82310400004)(8676002)(70206006)(36756003)(107886003)(356005)(70586007)(2906002)(5660300002)(2876002)(83380400001)(8936002)(2616005)(1076003)(81166007)(508600001)(16526019)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2022 14:51:23.8094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02a54a8f-efb2-4c02-656d-08d9f549a174 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2646 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 From: Elena Agostini Use rte_gpu_mem_cpu_map with the GPU memory pointer. Signed-off-by: Elena Agostini --- app/test-gpudev/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/test-gpudev/main.c b/app/test-gpudev/main.c index 417f2d78b7..d4b8b8971d 100644 --- a/app/test-gpudev/main.c +++ b/app/test-gpudev/main.c @@ -210,7 +210,7 @@ gpu_mem_cpu_map(uint16_t gpu_id) fprintf(stderr, "rte_gpu_mem_cpu_map returned error\n"); goto error; } - printf("GPU memory mapped for CPU access at 0x%p\n", ptr_cpu); + printf("GPU memory CPU mapped at 0x%p\n", ptr_cpu); ((uint8_t *)ptr_cpu)[0] = 0x4; ((uint8_t *)ptr_cpu)[1] = 0x5; @@ -221,12 +221,12 @@ gpu_mem_cpu_map(uint16_t gpu_id) ((uint8_t *)ptr_cpu)[1], ((uint8_t *)ptr_cpu)[2]); - ret = rte_gpu_mem_cpu_unmap(gpu_id, ptr_cpu); + ret = rte_gpu_mem_cpu_unmap(gpu_id, ptr_gpu); if (ret < 0) { fprintf(stderr, "rte_gpu_mem_cpu_unmap returned error %d\n", ret); goto error; } - printf("GPU memory mapped for CPU access at 0x%p\n", ptr_cpu); + printf("GPU memory CPU unmapped, 0x%p not valid anymore\n", ptr_cpu); ret = rte_gpu_mem_free(gpu_id, ptr_gpu); if (ret < 0) { @@ -240,7 +240,7 @@ gpu_mem_cpu_map(uint16_t gpu_id) error: - rte_gpu_mem_cpu_unmap(gpu_id, ptr_cpu); + rte_gpu_mem_cpu_unmap(gpu_id, ptr_gpu); rte_gpu_mem_free(gpu_id, ptr_gpu); printf("\n=======> TEST: FAILED\n"); -- 2.17.1