From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3 7/9] mem: add external API to retrieve page fd from EAL Date: Fri, 14 Sep 2018 10:00:50 +0200 Message-ID: <8160be2f-df28-20e8-7385-37a8bd085d56@redhat.com> References: <2d926d5508a98457acf7a4b2b004284bdbd22097.1536073997.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Richardson , tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, kuralamudhan.ramakrishnan@intel.com To: Anatoly Burakov , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 794B95F0D for ; Fri, 14 Sep 2018 10:00:56 +0200 (CEST) In-Reply-To: <2d926d5508a98457acf7a4b2b004284bdbd22097.1536073997.git.anatoly.burakov@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 09/04/2018 05:15 PM, Anatoly Burakov wrote: > Now that we can retrieve page fd's internally, we can expose it > as an external API. This will add two flavors of API - thread-safe > and non-thread-safe. Fix up internal API's to return values we need > without modifying rte_errno internally if called from within EAL. > > We do not want calling code to accidentally close an internal fd, so > we make a duplicate of it before we return it to the user. Caller is > therefore responsible for closing this fd. > > Signed-off-by: Anatoly Burakov > --- > lib/librte_eal/bsdapp/eal/eal_memalloc.c | 5 ++- > lib/librte_eal/common/eal_common_memory.c | 49 ++++++++++++++++++++++ > lib/librte_eal/common/eal_memalloc.h | 2 + > lib/librte_eal/common/include/rte_memory.h | 48 +++++++++++++++++++++ > lib/librte_eal/linuxapp/eal/eal_memalloc.c | 21 ++++++---- > lib/librte_eal/rte_eal_version.map | 2 + > 6 files changed, 118 insertions(+), 9 deletions(-) > Reviewed-by: Maxime Coquelin