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 772765681 for ; Fri, 14 Sep 2018 09:54:47 +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 AE0BF8666D; Fri, 14 Sep 2018 07:54:46 +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 263AF2010CBA; Fri, 14 Sep 2018 07:54:43 +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: <6a24b2f23baccc78b7bab7ecfee84d3ed477ab80.1536073997.git.anatoly.burakov@intel.com> From: Maxime Coquelin Message-ID: <52ef741c-3b94-295b-9ec0-dafe4cb63b3c@redhat.com> Date: Fri, 14 Sep 2018 09:54:41 +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: <6a24b2f23baccc78b7bab7ecfee84d3ed477ab80.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.26]); Fri, 14 Sep 2018 07:54:46 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 6/9] memalloc: add EAL-internal API to get and set segment fd's 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 07:54:47 -0000 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