[dpdk-dev] [RFC 01/11] mem: allow memseg lists to be marked as external
Burakov, Anatoly
anatoly.burakov at intel.com
Tue Jul 10 13:31:26 CEST 2018
On 10-Jul-18 12:18 PM, Alejandro Lucero wrote:
> On Fri, Jul 6, 2018 at 2:17 PM, Anatoly Burakov <anatoly.burakov at intel.com>
> 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 <anatoly.burakov at intel.com>
>> ---
>> 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
More information about the dev
mailing list