From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E457D4F91 for ; Tue, 10 Jul 2018 13:31:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 04:31:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,334,1526367600"; d="scan'208";a="71081193" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.102]) ([10.237.220.102]) by fmsmga001.fm.intel.com with ESMTP; 10 Jul 2018 04:31:27 -0700 To: Alejandro Lucero Cc: dev , srinath.mannam@broadcom.com, scott.branden@broadcom.com, Ajit Khaparde References: From: "Burakov, Anatoly" Message-ID: <8f709746-0251-46a4-8823-dea3fb58cb69@intel.com> Date: Tue, 10 Jul 2018 12:31:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC 01/11] mem: allow memseg lists to be marked as external 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: Tue, 10 Jul 2018 11:31:31 -0000 On 10-Jul-18 12:18 PM, Alejandro Lucero wrote: > On Fri, Jul 6, 2018 at 2:17 PM, Anatoly Burakov > wrote: > >> When we allocate and use DPDK memory, we need to be able to >> differentiate between DPDK hugepage segments and segments that >> were made part of DPDK but are externally allocated. Add such >> a property to memseg lists. >> >> Signed-off-by: Anatoly Burakov >> --- >> lib/librte_eal/common/eal_common_memory.c | 51 ++++++++++++++++--- >> .../common/include/rte_eal_memconfig.h | 1 + >> lib/librte_eal/common/malloc_heap.c | 2 +- >> 3 files changed, 47 insertions(+), 7 deletions(-) >> >> diff --git a/lib/librte_eal/common/eal_common_memory.c >> b/lib/librte_eal/common/eal_common_memory.c >> index 4f0688f9d..835bbffb6 100644 >> --- a/lib/librte_eal/common/eal_common_memory.c >> +++ b/lib/librte_eal/common/eal_common_memory.c >> @@ -24,6 +24,21 @@ >> #include "eal_private.h" >> #include "eal_internal_cfg.h" >> >> +/* forward declarations for memseg walk functions. we support external >> segments, >> + * but for some functionality to work, we need to either skip or not skip >> + * external segments. for example, while we expect for virt2memseg to >> return a >> + * valid memseg even though it's an external memseg, for regular memseg >> walk we >> + * want to skip those because the expectation is that we will only walk >> the >> + * DPDK allocated memory. >> + */ >> > > I do not clear understand when external segments can be used along with > hugepages segments, but if this is a possibility, should not we support > memseg walk for just external segments and also to allow any walk type as > an API? If I'm right, it seems just memseg walk skipping external memsegs > can be invoked from other files. Well, now that i think of it, every walk function will receive a memseg list along with memseg itself, so user code can check to skip external memsegs. So yes, you're correct. I'll do that in the next iteration. Thanks for your feedback! -- Thanks, Anatoly