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 31417A0A0F; Sat, 5 Jun 2021 09:49:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8F7640147; Sat, 5 Jun 2021 09:49:09 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id EDFC44003E for ; Sat, 5 Jun 2021 09:49:07 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4A9D75C016A; Sat, 5 Jun 2021 03:49:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 05 Jun 2021 03:49:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= 5R1Qua91F1uDBjKIg/Fu4VqeGTvELRMe2uw00hbOzo8=; b=qPEkwBk2gwCC16+R pp66TdBJ3ntwWu6yWq+uu8W7yyPjvUM0HTI34TsK2c2x5j++NXd3HSC7I5dsChS0 9c9gbwu41VXzVCUcVfpNqtBHyA41buQfP6x6HvwcogYtYu5WEgf5JAkrq/nsJQVO KLve+7nGK7I4jyyh5AQcUfNMZGqkXUu29qyJb+J9mao6d+4DOlaPh4nLLfYWdnPY 3vNltSDQz0ia2tbyc+IssB8qpgbwy7POejCIATqcDhjGa3rAkrdLes8LiGlzDj/H JDR558VZFSM55DsRBkj2QMTm/53fG6Jl0hnIlCe9EsmJtRxTo580GOlROPHdcObT FhbO4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=5R1Qua91F1uDBjKIg/Fu4VqeGTvELRMe2uw00hbOz o8=; b=KMeczPHRUd2P2ONribJicQo5QA6aap0+Lc6ee3xP5DtHMipNwPoWCSF5a 7uovwmD0uJ93vtNwYgO/1CNDR3sR7DNPWKN7vczWQgfNbD2EmmNBBoxExDCz0fZe 6CNjgXpk670CXEif1mwwqqfurmIaBlBZalKCL+wu9wf4Nr3AINVBkWWFsVAXiu7T w0XCwZL7f3MKCCvPzrtrCpZsOetQG02+vwIy6amchsRcwmzydOfOJZGs6Key8DJl qcfBhFt0hFOaEssCOgMWWx9EH7QmIqc4AsscPmUrj3vDWSsVv2HE0jw5bio/jQrw Jm4axRYLuJ/b/I0Y5ntQy7/Dp5Djw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtvddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Jun 2021 03:49:05 -0400 (EDT) From: Thomas Monjalon To: "Wang, Haiyue" Cc: "dev@dpdk.org" , Elena Agostini , "andrew.rybchenko@oktetlabs.ru" , "Yigit, Ferruh" , "jerinj@marvell.com" Date: Sat, 05 Jun 2021 09:49:03 +0200 Message-ID: <3569019.DFCUuWcX1B@thomas> In-Reply-To: References: <20210602203531.2288645-1-thomas@monjalon.net> <1648109.dXcHqNedQ3@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] gpudev: introduce memory API 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 Sender: "dev" 04/06/2021 20:04, Wang, Haiyue: > From: Thomas Monjalon > > 04/06/2021 15:25, Wang, Haiyue: > > > From: Thomas Monjalon > > > > Another question is about the function rte_gpu_free(). > > > > How do we recognize that a memory chunk is from the CPU and GPU visible, > > > > or just from GPU? > > > > > > > > > > I didn't find the rte_gpu_free_visible definition, and the rte_gpu_free's > > > comment just says: deallocate a chunk of memory allocated with rte_gpu_malloc* > > > > > > Looks like the rte_gpu_free can handle this case ? > > > > This is the proposal, yes. > > > > > And from the definition "rte_gpu_free(uint16_t gpu_id, void *ptr)", the > > > free needs to check whether this memory belong to the GPU or not, so it > > > also can recognize the memory type, I think. > > > > Yes that's the idea behind having a single free function. > > We could have some metadata in front of the memory chunk. > > My question is to confirm whether it is a good design or not, > > and whether it should be driver specific or have a common struct in the lib. > > > > Opinions? > > > > Make the GPU memory to be registered into the common lib API with the metadata > like address, size etc, and also some GPU specific callbacks like to handle how > to make GPU memory visible to CPU ? > > And the memory register can be like the exist external memory function: > > int > rte_extmem_register(void *va_addr, size_t len, rte_iova_t iova_addrs[], > unsigned int n_pages, size_t page_sz) How do you specify the device ID? I may have missed something.