From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3 6/9] memalloc: add EAL-internal API to get and set segment fd's Date: Fri, 14 Sep 2018 09:54:41 +0200 Message-ID: <52ef741c-3b94-295b-9ec0-dafe4cb63b3c@redhat.com> References: <6a24b2f23baccc78b7bab7ecfee84d3ed477ab80.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 772765681 for ; Fri, 14 Sep 2018 09:54:47 +0200 (CEST) In-Reply-To: <6a24b2f23baccc78b7bab7ecfee84d3ed477ab80.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: > Enable setting and retrieving segment fd's internally. > > For now, retrieving fd's will not be used anywhere until we > get an external API, but it will be useful for things like > virtio, where we wish to share segment fd's. > > Setting segment fd's will not be available as a public API > at this time, but internally it is needed for legacy mode, > because we're not allocating our hugepages in memalloc in > legacy mode case, and we still need to store the fd. > > Another user of get segment fd API is memseg info dump, to > show which pages use which fd's. > > Not supported on FreeBSD. > > Signed-off-by: Anatoly Burakov > --- > lib/librte_eal/bsdapp/eal/eal_memalloc.c | 12 +++++ > lib/librte_eal/common/eal_common_memory.c | 8 +-- > lib/librte_eal/common/eal_memalloc.h | 6 +++ > lib/librte_eal/linuxapp/eal/eal_memalloc.c | 60 +++++++++++++++++----- > lib/librte_eal/linuxapp/eal/eal_memory.c | 44 +++++++++++++--- > 5 files changed, 109 insertions(+), 21 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal_memalloc.c b/lib/librte_eal/bsdapp/eal/eal_memalloc.c > index f7f07abd6..a5fb09f71 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_memalloc.c > +++ b/lib/librte_eal/bsdapp/eal/eal_memalloc.c > @@ -47,6 +47,18 @@ eal_memalloc_sync_with_primary(void) > return -1; > } > > +int > +eal_memalloc_get_seg_fd(int list_idx, int seg_idx) > +{ > + return -1; Why not returning -ENOTSUPP directly here? (see patch 7). > +} > + > +int > +eal_memalloc_set_seg_fd(int list_idx, int seg_idx, int fd) > +{ > + return -1; Ditto. > +} > + Other than that, the patch looks good to me. Maxime