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 DC645A0350; Thu, 27 Jan 2022 07:56:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D4C14276B; Thu, 27 Jan 2022 07:56:07 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 0ECDF4067C for ; Thu, 27 Jan 2022 07:56:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643266566; x=1674802566; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=ldvZoSNhWaIUlzQaGPQyZwzoPtno8UzZRxvoTOvNOHw=; b=bk0Qr45CQpdWcVs6HlzjrCrIFBq1e8G0wJU77AqGzcr0vhy5j11I9+sX Ib4vAzTpAh3mpJhhXkFJzXRr+ZCisOf212tN+lee3SxCEL1hkkBDPmCZm hN0dRa3+q4+cu+BQQQZqW2jxar9B8sG1zIUoZHMjPGHU5ZbfZYo45sU0g MMIyjgq4vxYQwMPBQl3UbaXzEqWu5ZghxlsZ4h7APC3gzEpOsX/DTvvbq JbpXenfA23Od225uRLfNgMYXQv96Msb6ig7bp5I/rwVO4WFdnRJy36Kzf Q9NE9LD5znKQHCxp3xYUHn0MhXS3+sMQLeR/hCqPMmGnRPlUVgXEnWCaL A==; X-IronPort-AV: E=McAfee;i="6200,9189,10239"; a="230342513" X-IronPort-AV: E=Sophos;i="5.88,320,1635231600"; d="scan'208";a="230342513" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 22:56:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,320,1635231600"; d="scan'208";a="597725516" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 26 Jan 2022 22:56:04 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 26 Jan 2022 22:56:04 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 26 Jan 2022 22:56:04 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 26 Jan 2022 22:56:04 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 26 Jan 2022 22:56:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C7g3Q/M3oGzT3y0gdSPPwbaeRN0iL/4tlyv78nmMqZAhQNu0anyL5x1RbVfSV57kInWl0LvHdXHt2qveAIZ48myf/8jGCLne6PP3mQSMIbJ+C84uOBa6peN+Z+tnzjD37wenBXkbUZ5NYg6Lhi9YEagxyh6M0u9GRDrzf67N9r5VeVijSaQwkalJUvz4Q8cNQDB0KL5tYq8h4TiSu+H4QhNIyPk3MGsX/EHqeI8tG26/azmDujJ2MplkpvR3DrKlgCRtqc/laV17BkkBhAgriP/KClTJL4LZ1eeHHvjtItVEdDDjPi86ahLKiJgx4L44NmeuouRYDFnmhHOymEd/BA== 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=rVg36Lt2SwCX2Hkr/EF/DS9Iey9plTYcA2HxYlkODSo=; b=CgXe+vhLyW+7SJbY9YbWeQcValCjH8vVBF8+LjjQ5pz2qBeVnaUkhivaAHkn6WB0fLqdTUVnOgnvcFL8KczLSWL59+v1oCSkXwBcyL9hx1C89mjszJ3boKWu1iVILZ1TxtzF7cXnI8WS0PbFh23wgIqsl8TpFDCOwzYq+A/TMDFulk0Mf54E5J2/foMt7IZR1ZkK1dX7WVKTzUr8YBZdnxxfyiS5a2AKRD9OJN8k38sOJUNvxRViBepOxPv6hPiausDc8ng9p1eqwRFywu2N8UIc32DZwyMxG5xxONuIRV+O/Ft4QTyH65N1Y4JJQfjjWA5KsUkcgNNhBP7xUkV2JQ== 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 MN2PR11MB3869.namprd11.prod.outlook.com (2603:10b6:208:138::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Thu, 27 Jan 2022 06:55:59 +0000 Received: from BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::8b:8b64:1a16:859c]) by BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::8b:8b64:1a16:859c%3]) with mapi id 15.20.4909.017; Thu, 27 Jan 2022 06:55:59 +0000 From: "Wang, Haiyue" To: "eagostini@nvidia.com" , "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/Q Date: Thu, 27 Jan 2022 06:55:59 +0000 Message-ID: References: <20220104023408.13379-1-eagostini@nvidia.com> <20220127034716.12497-1-eagostini@nvidia.com> In-Reply-To: <20220127034716.12497-1-eagostini@nvidia.com> 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: 074a8349-f83f-4add-12a1-08d9e162135b x-ms-traffictypediagnostic: MN2PR11MB3869:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NaI1Hndpbbo1Bt48vxxZsPWiXCsBIRXoyQUpJtGDGVrUeVcL6Zxn2fXLh1F+twJJ+PRL2O8EIfbwRuqQTZJW8M9u1oYrYRfAQnKgbbkQRl7n6a4uLw0SvBiJgxyX/XTsORtW2X9rm/lGLrE5kYUQLehYfHe42aTfIFHhRDuzrWuQYij+o65NKonM/in0aHE8eYZwZBFvWtcUd9sp2Ck4yYsGlaS7itOiYVrHFpmjlTmrlzB10TokjNAq+4ROCiI4avSuAvVke3kt1AkeqCw0NigImbOGmxTHQf82uK0juOux48wtENYDHnDPZ2l7A+cZfUnvPW07uymT3GgVKUXCHJYuxV5xunj0UUdj9WZYdHBZ1kOfYbwi1yY2E3/4LoHkEDRoL8s8qZKWzTpB1hXN6Kv8CpFOOKDdqFEfP9y9WsrTPcxxJLw+PE1ttpmHTJO8R4iSZqEOWaLRtuxCsQY47XGrdacBGhkgqBgt4rZkiFkzjJKKsOug6VwswLCDduKm2iRiZF1e3ZFcEgRkZ7OWTUrHXiEXIQOlsLE/ICBEezi/sQryo9vOp6bnkDJygKeM1eKFtbMuTXlX2ZduwGSd0hhGs2/Cs1HvhOu5vkubCORHu6ENJmUrYvcVSBIb2GeXdYGzT2fAbF8Zi5olikcQhxLDsj+xfGjXB1axGMr+edQf+JInL7wadXJxEbOyQDH7Gw5EldDezTvTW4glTIOWNQ== 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:(366004)(52536014)(66446008)(7696005)(6506007)(76116006)(110136005)(186003)(5660300002)(2906002)(508600001)(55016003)(8936002)(53546011)(9686003)(66476007)(66946007)(66556008)(38070700005)(64756008)(86362001)(82960400001)(122000001)(71200400001)(33656002)(38100700002)(26005)(83380400001)(316002)(8676002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wqSK9sxoJy5+Plb7cwOsS3mmMw3KCAjiLM5G8c2v39QVwobj4YJF8ub3i2DV?= =?us-ascii?Q?Qi/QqSbFEU46DdzjJw8R/oJLbUNLuvXRhDSv6jx/jbwBvbb9jILn3BYCMatR?= =?us-ascii?Q?G4GEOCaEAa6n3lawUM6sk5PvjIYIi++FWc9dRaX/mM3aLq1u54SvPi03hdfC?= =?us-ascii?Q?RioVuxlfMHx2BSUMRBlKg744a0u6tMwQx18q1Gba8PH9e7Q5c213NmZwCEf5?= =?us-ascii?Q?wSZ/imdjffHyp9XXB0C2Dm/Tk5IfykfMm/xRfqGsIBM33oTbmJbHLOUvL35O?= =?us-ascii?Q?d1MbMcVmlY7Nwbjl+e4s4YSiA4zfXcN3yCoAIAuEQm9NrvSkDN2T0h38ttUw?= =?us-ascii?Q?07VcMOJCkYp5SKT+oUlSib/fI+R9YR6fWUaGJlKKVTjRqGTVCCNGWoGZpqUO?= =?us-ascii?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zPS?= =?us-ascii?Q?EA5x2m12bHue7U2hPPhzSXwOVOZb2PLX3VwkvMibXGp9T8IZAlHcnfyeDFcg?= =?us-ascii?Q?mMqUkvfhFbsUYL9L7HwCTDv7czzW4Qj5+vHFIycluV9vToi0xq+/83CUISc5?= =?us-ascii?Q?SvMkIoM0VyVm6dqMm46kWpmcQWwd7f5BSm6Qqdex67Qgwj9VmTkCSf0PXX7/?= =?us-ascii?Q?kIHXazBqI+hjHAUMo//oJ04PZni8wYhAnJbwytZvugac/7DDH522kTDxjxjD?= =?us-ascii?Q?va3LAXBu+exYBChhw9uEIUOGfG8iWFj73B8UpuT/gOXgoR1JWd3zEdLi/OMj?= =?us-ascii?Q?zg=3D=3D?= Content-Type: text/plain; charset="us-ascii" 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: 074a8349-f83f-4add-12a1-08d9e162135b X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jan 2022 06:55:59.6206 (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: mia4hybiulpu3veaE99NcAG2Fk3/1ynQyfR9LAN9TneXiuvErXXh6ERyitiCs/A9wcDFons95gj4xSFfGiwfNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3869 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 > -----Original Message----- > From: eagostini@nvidia.com > Sent: Thursday, January 27, 2022 11:47 > To: dev@dpdk.org > Cc: Elena Agostini > Subject: [PATCH v4 1/2] gpudev: expose GPU memory to CPU >=20 > From: Elena Agostini >=20 > Enable the possibility to expose a GPU memory area and make it > accessible from the CPU. >=20 > GPU memory has to be allocated via rte_gpu_mem_alloc(). >=20 > 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. >=20 > Signed-off-by: Elena Agostini > --- > doc/guides/prog_guide/gpudev.rst | 9 +++++ > drivers/gpu/cuda/cuda.c | 2 ++ > lib/gpudev/gpudev.c | 61 ++++++++++++++++++++++++++++++++ > lib/gpudev/gpudev_driver.h | 6 ++++ > lib/gpudev/rte_gpudev.h | 49 +++++++++++++++++++++++++ > lib/gpudev/version.map | 2 ++ > 6 files changed, 129 insertions(+) >=20 > +__rte_experimental > +void *rte_gpu_mem_cpu_map(int16_t dev_id, size_t size, void *ptr); How about add some direction words like "to/from" to make it straightforwar= d ? For this: rte_gpu_mem_map_to_cpu ? > +__rte_experimental > +int rte_gpu_mem_cpu_unmap(int16_t dev_id, void *ptr); > + And rte_gpu_mem_unmap_to_cpu ? > }; > -- > 2.17.1