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 3C157A0A0A; Thu, 3 Jun 2021 10:27:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D87DB4069F; Thu, 3 Jun 2021 10:27:01 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id BFDE340689 for ; Thu, 3 Jun 2021 10:27:00 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 319A95C0099; Thu, 3 Jun 2021 04:27:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 03 Jun 2021 04:27:00 -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= k9/WhMpTocWAfTplkWUT5iawfVVaOw6Xk6UzoKaIqpA=; b=t+9qGOas+xXbh7Rq fJYwSmCpf1ujsNjm2oca7gvm1rikcmYIqyw0KPbh1lNrv+g9FcCXepXqXULk4pOM kdZg2Utr6y1xphu344dy1VZgARHvSEflgTUmqnaSmy1CqpHDVGW5wWhjQeaBGQsj VPtl5PB6g1rCFM7keGAgMrYbON/s+NuLK6lSiKjTVDap0gIU/csSiZQxFAn52mHQ sGs1rUmcubEqnqtOTlUMPRXEGFYPTKOppjk3t8JKvyh0fxElaEnK8YOr3A5J+qe9 dckLnaXWTkhptCFtmBLn3udmCSqlK6GSD2SUzKCzxEZEUhiE/XliSyWW8NLFpAXL cbe9Dg== 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=k9/WhMpTocWAfTplkWUT5iawfVVaOw6Xk6UzoKaIq pA=; b=EWz5ib9/WBFABmxiyxXzX12kpEfBKz8hkIKW/2aD1HRZTEi2wra2jG33v 3DBqumGVQpU5UyhGxp+ypNsMx12v4ObhU1F0MwOOsyAdVJYtHJR7uDDexCHUD7Mb uubRlxP5ipAq+K470eVQGdDGk67xBW4b4yqVMVt7OKuumOb6b1z2/hqybh4oXFE3 6qulTD6lEE+7Vgr8eUJNk2ovJVnfyiJ3jrQ0Togz1DZ8Lf0EX/BgGhARILWVICGf 12mhjh0h5er914SFXRXuOldqLWbz3PiJ7tZ8beCebNw2lFDaJ6rHMQCnT86f5jew N9UoLBTds9aqppiXUENjFvUnXyGOA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdelledgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Jun 2021 04:26:58 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: dev@dpdk.org, Elena Agostini , david.marchand@redhat.com Date: Thu, 03 Jun 2021 10:26:57 +0200 Message-ID: <2734085.Iq8TftFMOa@thomas> In-Reply-To: <0f3bdf41-ce07-caa4-289a-b05f6727bf0d@oktetlabs.ru> References: <20210602203531.2288645-1-thomas@monjalon.net> <2561723.R1Na977jkj@thomas> <0f3bdf41-ce07-caa4-289a-b05f6727bf0d@oktetlabs.ru> 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" 03/06/2021 09:49, Andrew Rybchenko: > On 6/3/21 10:26 AM, Thomas Monjalon wrote: > > 03/06/2021 09:06, Andrew Rybchenko: > >> On 6/2/21 11:35 PM, Thomas Monjalon wrote: > >>> + * Allocate a chunk of memory on the GPU. > >> > >> Looking a below function it is required to clarify here if > >> the memory is visible or invisible to GPU (or both allowed). > > > > This function allocates on the GPU so it is visible by the GPU. > > I feel I misunderstand your question. > > Below function says rte_gpu_malloc_visible() and its > description highlights that allocated memory is visible to GPU. > My problem that I don't understand what's the difference > between these two functions. One function allocates in GPU mem, the other allows the GPU to use CPU mem. > >>> + */ > >>> +__rte_experimental > >>> +int rte_gpu_malloc(uint16_t gpu_id, size_t size, void **ptr); > >> > >> May be *malloc() should return a pointer and "negative" > >> values used to report various errnos? > > > > I don't understand what you mean by negative values if it is a pointer. > > We could return a pointer and use rte_errno. > > I was talking about something like (void *)(-ENOMEM), but it is > a bad idea. NULL + rte_errno is much better. > > However, may be I'd kept callback as is set rte_error in lib if > negative value is returned by the callback. This way we'll be > safe against lost rte_errno update in drivers. OK