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 71C58A00BE; Fri, 11 Feb 2022 05:46:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BB55410E5; Fri, 11 Feb 2022 05:46:51 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1DF2240DF5 for ; Fri, 11 Feb 2022 05:46:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644554809; x=1676090809; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=opV3oUIP1HBUBIpuyFy6Ek2idPm765eZEWguddwv6oo=; b=MDRbaFH/RtD4kfcSt88sy65N3u7GGB9IAN+UOElZxLKmE633XxDW3e63 MmnDJpZGQcD0IzQsSYa5J0qInc+agyPRJvbdBVzuzpHixjKDNfvs1b3wH e76h+llRq7DiCYy90j8yWlrQTwxz59I/jpY5bsqMeBsHmjaqZj5P4Sf8r YqMdSz3j7BMEjmn5weVO/5sfbttgKLwmAOTl/D7NdwgNxaEOMCZV6jf6Y 6mG2EY/VV4by/xaMVd9yCL9EW3JQDj+GcygnqDdfe8Qwmp+y5DIiFr8qt gdwYZRl6Hh2IWDe9chHS6wS6mUF2S13WF8u2w9TZ8eaENiyBGHo4Su2q0 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="230302825" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="230302825" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 20:46:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="679401927" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga001.fm.intel.com with ESMTP; 10 Feb 2022 20:46:47 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 20:46:47 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 10 Feb 2022 20:46:47 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 10 Feb 2022 20:46:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQGx5iSQf5x0Brc1YAGYKObEbBLLqyt0IxlDF3+lxKQKHBJBQOevU+O9fx3DMWlyJd3RS3xh+gidc7KgMcz7cw1Mwa+fWFEuhj6QgQvcqGKfPyQagbuERyy/bowCXgNKhoQh33WrQUuL/Y1iUWSN7YD62phyw8funjwEfU0s/qVO686dlAaV4dbRct1m6mIyLR8C9MvBi1ANUHi2pphLOT5Fto8ZxufvX7IBscBwZE20t5DZydl4YdfcdUMXN01KCRKGQ+cAbYA5xlNFaplaf8KAqCpxXOtTrTrzZOeXgccSYcY+CKiPcrpqOrsgNIzCJQw7TIDsteWLVR61HsKfLg== 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=opV3oUIP1HBUBIpuyFy6Ek2idPm765eZEWguddwv6oo=; b=fQJ2EfaE8voS7vYwcU9+AHGZH8vyl+YDpx6ptHxMJluFxBhcuIFi+vPt2aFAV/BE1t6cjt5wISm0icuDU9p7AKAg+n+xgm6xKkdAOdmW0J57/qg/7Xo6t5stlxdWC93VY8g5MNHbiRc6YJjhYrG6emfy6yeqXPfpdjFN7XldOdg3ZElo7E5w1EPs/IKJITC3YriDnbYu018B0QfdX1mkuTB7r56L4doimd1dMM6vkg6M5ZEEH1Hujp5vr1Kv19AQi64H2ohIknbh74bcEdx7HGmMAJcGSGwhIhf9nXRP8uRbKbJFpIYlj4kDctbv6wIz1AM40FGJUHA6y1+KAsrKYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BYAPR11MB3495.namprd11.prod.outlook.com (2603:10b6:a03:8a::14) by DM6PR11MB4707.namprd11.prod.outlook.com (2603:10b6:5:2a6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 04:46:46 +0000 Received: from BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::714b:35f9:5767:b39b]) by BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::714b:35f9:5767:b39b%6]) with mapi id 15.20.4951.019; Fri, 11 Feb 2022 04:46:45 +0000 From: "Wang, Haiyue" To: Elena Agostini , "dev@dpdk.org" Subject: RE: [PATCH v4 1/2] gpudev: expose GPU memory to CPU Thread-Topic: [PATCH v4 1/2] gpudev: expose GPU memory to CPU Thread-Index: AQHYEuxMxlX7fYQ3+UCa3wuTvqe1Rax2b0/QgBY/e4CAAS+YQA== Date: Fri, 11 Feb 2022 04:46:45 +0000 Message-ID: References: <20220104023408.13379-1-eagostini@nvidia.com> <20220127034716.12497-1-eagostini@nvidia.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4da5d225-7b82-4a79-8a8e-08d9ed1981d3 x-ms-traffictypediagnostic: DM6PR11MB4707:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HR0zGGZV3oZdUbUBajZ+eat0bL0Dfi3yqKttcQwR4tlzP3yawylg6WXFNDY7E1mZ2Tl7i7aYBzLFfiTFZznV1dBaiYWVgvVBR9tHDxLG6ntma2Gdf5I955UxudClQjA13dbFwTMuc11y8doEndP4E8n3ycBE4Rjtrm8tSA76se7f2tUkcE6qFfMfNd3e6lue/2/Vf56Efi6v2z2pGaZgZlYb8sPP3kpeQnpKDscB93SScdzbVlcTopPZIngZUvGH+tqJXjdTwquas+0IbOuMb5fNz3MGbliJk5njqGaQEJ3Qd5x/vUvQ9vOSg1CLY8ovLA1TUR00X0gN3K8G5kUC+9Xuuy9+rCAMjMF7975w8Sw+rFqTYufEkQVq/uXwmfV/J5Q2O7boQ9KTxK/lXjXm4e6fETGD4cR088yiIvDqtn04KoLGkj7VWJQOygx7UxNH76t76O4xtp3mdaKE58x0XGryuX5GSsEwSadDDtf7NYm8lry8twnKz+BYcKCX8blb3R98qrE9L5v7r2SlvMrs4pTl1UX5TCacj4uijIISIeIwVaDsBj/J0Xxqpr0LF9Po9QMnq8FbTvegI6bdG+mUOlOTKkZmHeKWzJ+rurWmdSBxi0J4bmNnjFkn7OLdGlDmA8yRgcXSJ1mErdNHwLHtOMEplSL/2ba5TfrFdAi2PrTlhncFsZKQ+P00rTj/suMPIeH2TgxxdA+fdkjrBUDLKg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3495.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(7696005)(508600001)(52536014)(53546011)(122000001)(5660300002)(6506007)(9686003)(316002)(33656002)(82960400001)(76116006)(66946007)(8676002)(110136005)(38070700005)(64756008)(66476007)(66446008)(66556008)(2906002)(8936002)(186003)(55016003)(26005)(83380400001)(71200400001)(38100700002)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?tUz4gRejOOjXUoUWdRwD0lg992MDm6ACN66uqKjsJyVi4fU+EH3bTCDTai?= =?iso-8859-1?Q?XNcUjv3ZRb9ICVGDWf16UOc7ic2EKG2ZwkdjzWi2sNQ9ZnS57zsb8Rm6IR?= =?iso-8859-1?Q?cIdcCehQwNag5lhHbQLHLtovb8Esc2iTypKxvFdYlFkSfIAX0OlqksoUeC?= =?iso-8859-1?Q?Q63+mGBRYC/JLb2wH0dLK/GXAOLIa5oD1dCH5FQrQnav/EKdL01t0Z2H0U?= =?iso-8859-1?Q?wQmjSWkq/yKDrnygEZ4Ie7MwIJHZkdswvejQ+ftEIh0AEi1pcqZ77fs5Aw?= =?iso-8859-1?Q?Wjqc2NV6VqBECBiaD5ABMDnMdPAwDO1OBmwRflEDHcZWPQ7TJWAEffjlNe?= =?iso-8859-1?Q?1EpIr+tTWfHcVo6VV6RrvlcJzU3l6muo3F/OCH6+wQsxfftDVHUtGglBY2?= =?iso-8859-1?Q?9c6EJA3cPFrYEQcLINJTHzWl95qDoDxCL4UEtkhRygGRaDs1elLip8XKPs?= =?iso-8859-1?Q?lfM4Vq8SaoyltUC5xlhKYSyBh1V+ZTqzqgr/81oKw9A4nPJA8Hqd6+VNc9?= =?iso-8859-1?Q?8EtuMDEIAGgT2fV0by4sQw2sU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1?Q?YOaniXucVyEY+RsVah2jege0LY0mJ+gUgrhnRSGdmyOoCApbxgqhfbXoln?= =?iso-8859-1?Q?Gog+2wgnMDV4htMISW2Rz1UdBnl0X15YEXTN1kCQtq0qihoA/gD7P7PwM/?= =?iso-8859-1?Q?Y1kgVWmMHwxp9A9zeLaknmEW25dY6Yc/q+jr3lw7W1cEHCA+ocfy0/e2yA?= =?iso-8859-1?Q?fZjkZd7gKAZHBv627/Y0XZM/FMx62fgA/IyTzQnVLu4IFUai7EoG3Plw?= =?iso-8859-1?Q?=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3495.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4da5d225-7b82-4a79-8a8e-08d9ed1981d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2022 04:46:45.6631 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NOwlrMRtBZtGJJJaUEPoGGwyeMv0pELbzYK+l7ERM25GYuC2Yc0OL5f6w2s9RgYWG6mJC7AgWZjfP35OMV255Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4707 X-OriginatorOrg: intel.com 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 =20 Sent: Thursday, February 10, 2022 18:38 To: Wang, Haiyue ; dev@dpdk.org Subject: Re: [PATCH v4 1/2] gpudev: expose GPU memory to CPU > From: Wang, Haiyue > Date: Thursday, 27 January 2022 at 07:56 > To: Elena Agostini , mailto:dev@dpdk.org > Subject: RE: [PATCH v4 1/2] gpudev: expose GPU memory to CPU > External email: Use caution opening links or attachments >=20 >=20 > > -----Original Message----- > > From: mailto:eagostini@nvidia.com > > Sent: Thursday, January 27, 2022 11:47 > > To: mailto:dev@dpdk.org > > Cc: Elena Agostini > > Subject: [PATCH v4 1/2] gpudev: expose GPU memory to CPU > > > > From: Elena Agostini > > > > Enable the possibility to expose a GPU memory area and make it > > accessible from the CPU. > > > > GPU memory has to be allocated via rte_gpu_mem_alloc(). > > > > This patch allows the gpudev library to map (and unmap), > > through the GPU driver, a chunk of GPU memory and to return > > a memory pointer usable by the CPU to access the GPU memory area. > > > > Signed-off-by: Elena Agostini > > --- > >=A0 doc/guides/prog_guide/gpudev.rst |=A0 9 +++++ > >=A0 drivers/gpu/cuda/cuda.c=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 2 ++ > >=A0 lib/gpudev/gpudev.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | 61 ++++= ++++++++++++++++++++++++++++ > >=A0 lib/gpudev/gpudev_driver.h=A0=A0=A0=A0=A0=A0 |=A0 6 ++++ > >=A0 lib/gpudev/rte_gpudev.h=A0=A0=A0=A0=A0=A0=A0=A0=A0 | 49 ++++++++++++= +++++++++++++ > >=A0 lib/gpudev/version.map=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0 2 ++ > >=A0 6 files changed, 129 insertions(+) > > >=20 >=20 > > +__rte_experimental > > +void *rte_gpu_mem_cpu_map(int16_t dev_id, size_t size, void *ptr); >=20 > How about add some direction words like "to/from" to make it straightforw= ard ? >=20 > For this: rte_gpu_mem_map_to_cpu ? >=20 > > +__rte_experimental > > +int rte_gpu_mem_cpu_unmap(int16_t dev_id, void *ptr); > > + >=20 > And rte_gpu_mem_unmap_to_cpu ? >=20 > >=A0 }; > > -- > > 2.17.1 > Motivation behind the name is to be compliant with=20 > rte_*_dma_map/unmap() functions where the entity comes first > (DMA) and the action later (map/unmap). > I think your proposal is more readable but it's also too > verbose for an API (map_to_cpu/unmap_from_cpu). Then just ' rte_gpu_mem_map' & ' rte_gpu_mem_umap', since DPDK is running o= n CPU. ;-)