From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C21F6C047B6B; Fri, 14 Sep 2018 08:00:55 +0000 (UTC) Received: from [10.36.112.48] (ovpn-112-48.ams2.redhat.com [10.36.112.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C18D2010D00; Fri, 14 Sep 2018 08:00:52 +0000 (UTC) To: Anatoly Burakov , dev@dpdk.org Cc: Bruce Richardson , tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, kuralamudhan.ramakrishnan@intel.com References: <2d926d5508a98457acf7a4b2b004284bdbd22097.1536073997.git.anatoly.burakov@intel.com> From: Maxime Coquelin Message-ID: <8160be2f-df28-20e8-7385-37a8bd085d56@redhat.com> Date: Fri, 14 Sep 2018 10:00:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2d926d5508a98457acf7a4b2b004284bdbd22097.1536073997.git.anatoly.burakov@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 14 Sep 2018 08:00:55 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 7/9] mem: add external API to retrieve page fd from EAL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2018 08:00:56 -0000 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