1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
10 #include <sys/queue.h>
12 #include <rte_memory.h>
13 #include <rte_errno.h>
15 #include <rte_eal_memconfig.h>
16 #include <rte_launch.h>
17 #include <rte_per_lcore.h>
18 #include <rte_lcore.h>
19 #include <rte_common.h>
20 #include <rte_string_fns.h>
21 #include <rte_spinlock.h>
22 #include <rte_memcpy.h>
23 #include <rte_atomic.h>
24 #include <rte_fbarray.h>
26 #include "eal_internal_cfg.h"
27 #include "eal_memalloc.h"
28 #include "malloc_elem.h"
29 #include "malloc_heap.h"
30 #include "malloc_mp.h"
33 check_hugepage_sz(unsigned flags, uint64_t hugepage_sz)
35 unsigned check_flag = 0;
37 if (!(flags & ~RTE_MEMZONE_SIZE_HINT_ONLY))
40 switch (hugepage_sz) {
42 check_flag = RTE_MEMZONE_256KB;
45 check_flag = RTE_MEMZONE_2MB;
48 check_flag = RTE_MEMZONE_16MB;
51 check_flag = RTE_MEMZONE_256MB;
54 check_flag = RTE_MEMZONE_512MB;
57 check_flag = RTE_MEMZONE_1GB;
60 check_flag = RTE_MEMZONE_4GB;
63 check_flag = RTE_MEMZONE_16GB;
66 return check_flag & flags;
70 * Expand the heap with a memory area.
72 static struct malloc_elem *
73 malloc_heap_add_memory(struct malloc_heap *heap, struct rte_memseg_list *msl,
74 void *start, size_t len)
76 struct malloc_elem *elem = start;
78 malloc_elem_init(elem, heap, msl, len);
80 malloc_elem_insert(elem);
82 elem = malloc_elem_join_adjacent_free(elem);
84 malloc_elem_free_list_insert(elem);
90 malloc_add_seg(const struct rte_memseg_list *msl,
91 const struct rte_memseg *ms, size_t len, void *arg __rte_unused)
93 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
94 struct rte_memseg_list *found_msl;
95 struct malloc_heap *heap;
98 heap = &mcfg->malloc_heaps[msl->socket_id];
100 /* msl is const, so find it */
101 msl_idx = msl - mcfg->memsegs;
103 if (msl_idx < 0 || msl_idx >= RTE_MAX_MEMSEG_LISTS)
106 found_msl = &mcfg->memsegs[msl_idx];
108 malloc_heap_add_memory(heap, found_msl, ms->addr, len);
110 heap->total_size += len;
112 RTE_LOG(DEBUG, EAL, "Added %zuM to heap on socket %i\n", len >> 20,
118 * Iterates through the freelist for a heap to find a free element
119 * which can store data of the required size and with the requested alignment.
120 * If size is 0, find the biggest available elem.
121 * Returns null on failure, or pointer to element on success.
123 static struct malloc_elem *
124 find_suitable_element(struct malloc_heap *heap, size_t size,
125 unsigned int flags, size_t align, size_t bound, bool contig)
128 struct malloc_elem *elem, *alt_elem = NULL;
130 for (idx = malloc_elem_free_list_index(size);
131 idx < RTE_HEAP_NUM_FREELISTS; idx++) {
132 for (elem = LIST_FIRST(&heap->free_head[idx]);
133 !!elem; elem = LIST_NEXT(elem, free_list)) {
134 if (malloc_elem_can_hold(elem, size, align, bound,
136 if (check_hugepage_sz(flags,
139 if (alt_elem == NULL)
145 if ((alt_elem != NULL) && (flags & RTE_MEMZONE_SIZE_HINT_ONLY))
152 * Main function to allocate a block of memory from the heap.
153 * It locks the free list, scans it, and adds a new memseg if the
154 * scan fails. Once the new memseg is added, it re-scans and should return
155 * the new element after releasing the lock.
158 heap_alloc(struct malloc_heap *heap, const char *type __rte_unused, size_t size,
159 unsigned int flags, size_t align, size_t bound, bool contig)
161 struct malloc_elem *elem;
163 size = RTE_CACHE_LINE_ROUNDUP(size);
164 align = RTE_CACHE_LINE_ROUNDUP(align);
166 elem = find_suitable_element(heap, size, flags, align, bound, contig);
168 elem = malloc_elem_alloc(elem, size, align, bound, contig);
170 /* increase heap's count of allocated elements */
174 return elem == NULL ? NULL : (void *)(&elem[1]);
177 /* this function is exposed in malloc_mp.h */
179 rollback_expand_heap(struct rte_memseg **ms, int n_segs,
180 struct malloc_elem *elem, void *map_addr, size_t map_len)
183 malloc_elem_free_list_remove(elem);
184 malloc_elem_hide_region(elem, map_addr, map_len);
187 eal_memalloc_free_seg_bulk(ms, n_segs);
190 /* this function is exposed in malloc_mp.h */
192 alloc_pages_on_heap(struct malloc_heap *heap, uint64_t pg_sz, size_t elt_size,
193 int socket, unsigned int flags, size_t align, size_t bound,
194 bool contig, struct rte_memseg **ms, int n_segs)
196 struct rte_memseg_list *msl;
197 struct malloc_elem *elem = NULL;
200 void *ret, *map_addr;
202 alloc_sz = (size_t)pg_sz * n_segs;
204 /* first, check if we're allowed to allocate this memory */
205 if (eal_memalloc_mem_alloc_validate(socket,
206 heap->total_size + alloc_sz) < 0) {
207 RTE_LOG(DEBUG, EAL, "User has disallowed allocation\n");
211 allocd_pages = eal_memalloc_alloc_seg_bulk(ms, n_segs, pg_sz,
214 /* make sure we've allocated our pages... */
215 if (allocd_pages < 0)
218 map_addr = ms[0]->addr;
219 msl = rte_mem_virt2memseg_list(map_addr);
221 /* check if we wanted contiguous memory but didn't get it */
222 if (contig && !eal_memalloc_is_contig(msl, map_addr, alloc_sz)) {
223 RTE_LOG(DEBUG, EAL, "%s(): couldn't allocate physically contiguous space\n",
228 /* add newly minted memsegs to malloc heap */
229 elem = malloc_heap_add_memory(heap, msl, map_addr, alloc_sz);
231 /* try once more, as now we have allocated new memory */
232 ret = find_suitable_element(heap, elt_size, flags, align, bound,
241 rollback_expand_heap(ms, n_segs, elem, map_addr, alloc_sz);
246 try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz,
247 size_t elt_size, int socket, unsigned int flags, size_t align,
248 size_t bound, bool contig)
250 struct malloc_elem *elem;
251 struct rte_memseg **ms;
255 bool callback_triggered = false;
257 alloc_sz = RTE_ALIGN_CEIL(align + elt_size +
258 MALLOC_ELEM_TRAILER_LEN, pg_sz);
259 n_segs = alloc_sz / pg_sz;
261 /* we can't know in advance how many pages we'll need, so we malloc */
262 ms = malloc(sizeof(*ms) * n_segs);
264 memset(ms, 0, sizeof(*ms) * n_segs);
269 elem = alloc_pages_on_heap(heap, pg_sz, elt_size, socket, flags, align,
270 bound, contig, ms, n_segs);
275 map_addr = ms[0]->addr;
277 /* notify user about changes in memory map */
278 eal_memalloc_mem_event_notify(RTE_MEM_EVENT_ALLOC, map_addr, alloc_sz);
280 /* notify other processes that this has happened */
281 if (request_sync()) {
282 /* we couldn't ensure all processes have mapped memory,
283 * so free it back and notify everyone that it's been
286 * technically, we could've avoided adding memory addresses to
287 * the map, but that would've led to inconsistent behavior
288 * between primary and secondary processes, as those get
289 * callbacks during sync. therefore, force primary process to
290 * do alloc-and-rollback syncs as well.
292 callback_triggered = true;
295 heap->total_size += alloc_sz;
297 RTE_LOG(DEBUG, EAL, "Heap on socket %d was expanded by %zdMB\n",
298 socket, alloc_sz >> 20ULL);
305 if (callback_triggered)
306 eal_memalloc_mem_event_notify(RTE_MEM_EVENT_FREE,
309 rollback_expand_heap(ms, n_segs, elem, map_addr, alloc_sz);
319 try_expand_heap_secondary(struct malloc_heap *heap, uint64_t pg_sz,
320 size_t elt_size, int socket, unsigned int flags, size_t align,
321 size_t bound, bool contig)
323 struct malloc_mp_req req;
326 memset(&req, 0, sizeof(req));
328 req.t = REQ_TYPE_ALLOC;
329 req.alloc_req.align = align;
330 req.alloc_req.bound = bound;
331 req.alloc_req.contig = contig;
332 req.alloc_req.flags = flags;
333 req.alloc_req.elt_size = elt_size;
334 req.alloc_req.page_sz = pg_sz;
335 req.alloc_req.socket = socket;
336 req.alloc_req.heap = heap; /* it's in shared memory */
338 req_result = request_to_primary(&req);
343 if (req.result != REQ_RESULT_SUCCESS)
350 try_expand_heap(struct malloc_heap *heap, uint64_t pg_sz, size_t elt_size,
351 int socket, unsigned int flags, size_t align, size_t bound,
354 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
357 rte_rwlock_write_lock(&mcfg->memory_hotplug_lock);
359 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
360 ret = try_expand_heap_primary(heap, pg_sz, elt_size, socket,
361 flags, align, bound, contig);
363 ret = try_expand_heap_secondary(heap, pg_sz, elt_size, socket,
364 flags, align, bound, contig);
367 rte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);
372 compare_pagesz(const void *a, const void *b)
374 const struct rte_memseg_list * const*mpa = a;
375 const struct rte_memseg_list * const*mpb = b;
376 const struct rte_memseg_list *msla = *mpa;
377 const struct rte_memseg_list *mslb = *mpb;
378 uint64_t pg_sz_a = msla->page_sz;
379 uint64_t pg_sz_b = mslb->page_sz;
381 if (pg_sz_a < pg_sz_b)
383 if (pg_sz_a > pg_sz_b)
389 alloc_more_mem_on_socket(struct malloc_heap *heap, size_t size, int socket,
390 unsigned int flags, size_t align, size_t bound, bool contig)
392 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
393 struct rte_memseg_list *requested_msls[RTE_MAX_MEMSEG_LISTS];
394 struct rte_memseg_list *other_msls[RTE_MAX_MEMSEG_LISTS];
395 uint64_t requested_pg_sz[RTE_MAX_MEMSEG_LISTS];
396 uint64_t other_pg_sz[RTE_MAX_MEMSEG_LISTS];
398 int i, n_other_msls, n_other_pg_sz, n_requested_msls, n_requested_pg_sz;
399 bool size_hint = (flags & RTE_MEMZONE_SIZE_HINT_ONLY) > 0;
400 unsigned int size_flags = flags & ~RTE_MEMZONE_SIZE_HINT_ONLY;
403 memset(requested_msls, 0, sizeof(requested_msls));
404 memset(other_msls, 0, sizeof(other_msls));
405 memset(requested_pg_sz, 0, sizeof(requested_pg_sz));
406 memset(other_pg_sz, 0, sizeof(other_pg_sz));
409 * go through memseg list and take note of all the page sizes available,
410 * and if any of them were specifically requested by the user.
412 n_requested_msls = 0;
414 for (i = 0; i < RTE_MAX_MEMSEG_LISTS; i++) {
415 struct rte_memseg_list *msl = &mcfg->memsegs[i];
417 if (msl->socket_id != socket)
420 if (msl->base_va == NULL)
423 /* if pages of specific size were requested */
424 if (size_flags != 0 && check_hugepage_sz(size_flags,
426 requested_msls[n_requested_msls++] = msl;
427 else if (size_flags == 0 || size_hint)
428 other_msls[n_other_msls++] = msl;
431 /* sort the lists, smallest first */
432 qsort(requested_msls, n_requested_msls, sizeof(requested_msls[0]),
434 qsort(other_msls, n_other_msls, sizeof(other_msls[0]),
437 /* now, extract page sizes we are supposed to try */
439 n_requested_pg_sz = 0;
440 for (i = 0; i < n_requested_msls; i++) {
441 uint64_t pg_sz = requested_msls[i]->page_sz;
443 if (prev_pg_sz != pg_sz) {
444 requested_pg_sz[n_requested_pg_sz++] = pg_sz;
450 for (i = 0; i < n_other_msls; i++) {
451 uint64_t pg_sz = other_msls[i]->page_sz;
453 if (prev_pg_sz != pg_sz) {
454 other_pg_sz[n_other_pg_sz++] = pg_sz;
459 /* finally, try allocating memory of specified page sizes, starting from
462 for (i = 0; i < n_requested_pg_sz; i++) {
463 uint64_t pg_sz = requested_pg_sz[i];
466 * do not pass the size hint here, as user expects other page
467 * sizes first, before resorting to best effort allocation.
469 if (!try_expand_heap(heap, pg_sz, size, socket, size_flags,
470 align, bound, contig))
473 if (n_other_pg_sz == 0)
476 /* now, check if we can reserve anything with size hint */
477 ret = find_suitable_element(heap, size, flags, align, bound, contig);
482 * we still couldn't reserve memory, so try expanding heap with other
483 * page sizes, if there are any
485 for (i = 0; i < n_other_pg_sz; i++) {
486 uint64_t pg_sz = other_pg_sz[i];
488 if (!try_expand_heap(heap, pg_sz, size, socket, flags,
489 align, bound, contig))
495 /* this will try lower page sizes first */
497 heap_alloc_on_socket(const char *type, size_t size, int socket,
498 unsigned int flags, size_t align, size_t bound, bool contig)
500 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
501 struct malloc_heap *heap = &mcfg->malloc_heaps[socket];
502 unsigned int size_flags = flags & ~RTE_MEMZONE_SIZE_HINT_ONLY;
505 rte_spinlock_lock(&(heap->lock));
507 align = align == 0 ? 1 : align;
509 /* for legacy mode, try once and with all flags */
510 if (internal_config.legacy_mem) {
511 ret = heap_alloc(heap, type, size, flags, align, bound, contig);
516 * we do not pass the size hint here, because even if allocation fails,
517 * we may still be able to allocate memory from appropriate page sizes,
518 * we just need to request more memory first.
520 ret = heap_alloc(heap, type, size, size_flags, align, bound, contig);
524 if (!alloc_more_mem_on_socket(heap, size, socket, flags, align, bound,
526 ret = heap_alloc(heap, type, size, flags, align, bound, contig);
528 /* this should have succeeded */
530 RTE_LOG(ERR, EAL, "Error allocating from heap\n");
533 rte_spinlock_unlock(&(heap->lock));
538 malloc_heap_alloc(const char *type, size_t size, int socket_arg,
539 unsigned int flags, size_t align, size_t bound, bool contig)
541 int socket, i, cur_socket;
544 /* return NULL if size is 0 or alignment is not power-of-2 */
545 if (size == 0 || (align && !rte_is_power_of_2(align)))
548 if (!rte_eal_has_hugepages())
549 socket_arg = SOCKET_ID_ANY;
551 if (socket_arg == SOCKET_ID_ANY)
552 socket = malloc_get_numa_socket();
556 /* Check socket parameter */
557 if (socket >= RTE_MAX_NUMA_NODES)
560 ret = heap_alloc_on_socket(type, size, socket, flags, align, bound,
562 if (ret != NULL || socket_arg != SOCKET_ID_ANY)
565 /* try other heaps */
566 for (i = 0; i < (int) rte_socket_count(); i++) {
567 cur_socket = rte_socket_id_by_idx(i);
568 if (cur_socket == socket)
570 ret = heap_alloc_on_socket(type, size, cur_socket, flags,
571 align, bound, contig);
578 /* this function is exposed in malloc_mp.h */
580 malloc_heap_free_pages(void *aligned_start, size_t aligned_len)
582 int n_segs, seg_idx, max_seg_idx;
583 struct rte_memseg_list *msl;
586 msl = rte_mem_virt2memseg_list(aligned_start);
590 page_sz = (size_t)msl->page_sz;
591 n_segs = aligned_len / page_sz;
592 seg_idx = RTE_PTR_DIFF(aligned_start, msl->base_va) / page_sz;
593 max_seg_idx = seg_idx + n_segs;
595 for (; seg_idx < max_seg_idx; seg_idx++) {
596 struct rte_memseg *ms;
598 ms = rte_fbarray_get(&msl->memseg_arr, seg_idx);
599 eal_memalloc_free_seg(ms);
605 malloc_heap_free(struct malloc_elem *elem)
607 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
608 struct malloc_heap *heap;
609 void *start, *aligned_start, *end, *aligned_end;
610 size_t len, aligned_len, page_sz;
611 struct rte_memseg_list *msl;
612 unsigned int i, n_segs, before_space, after_space;
615 if (!malloc_elem_cookies_ok(elem) || elem->state != ELEM_BUSY)
618 /* elem may be merged with previous element, so keep heap address */
621 page_sz = (size_t)msl->page_sz;
623 rte_spinlock_lock(&(heap->lock));
625 /* mark element as free */
626 elem->state = ELEM_FREE;
628 elem = malloc_elem_free(elem);
630 /* anything after this is a bonus */
633 /* ...of which we can't avail if we are in legacy mode */
634 if (internal_config.legacy_mem)
637 /* check if we can free any memory back to the system */
638 if (elem->size < page_sz)
641 /* probably, but let's make sure, as we may not be using up full page */
644 aligned_start = RTE_PTR_ALIGN_CEIL(start, page_sz);
645 end = RTE_PTR_ADD(elem, len);
646 aligned_end = RTE_PTR_ALIGN_FLOOR(end, page_sz);
648 aligned_len = RTE_PTR_DIFF(aligned_end, aligned_start);
650 /* can't free anything */
651 if (aligned_len < page_sz)
654 /* we can free something. however, some of these pages may be marked as
655 * unfreeable, so also check that as well
657 n_segs = aligned_len / page_sz;
658 for (i = 0; i < n_segs; i++) {
659 const struct rte_memseg *tmp =
660 rte_mem_virt2memseg(aligned_start, msl);
662 if (tmp->flags & RTE_MEMSEG_FLAG_DO_NOT_FREE) {
663 /* this is an unfreeable segment, so move start */
664 aligned_start = RTE_PTR_ADD(tmp->addr, tmp->len);
668 /* recalculate length and number of segments */
669 aligned_len = RTE_PTR_DIFF(aligned_end, aligned_start);
670 n_segs = aligned_len / page_sz;
672 /* check if we can still free some pages */
676 /* We're not done yet. We also have to check if by freeing space we will
677 * be leaving free elements that are too small to store new elements.
678 * Check if we have enough space in the beginning and at the end, or if
679 * start/end are exactly page aligned.
681 before_space = RTE_PTR_DIFF(aligned_start, elem);
682 after_space = RTE_PTR_DIFF(end, aligned_end);
683 if (before_space != 0 &&
684 before_space < MALLOC_ELEM_OVERHEAD + MIN_DATA_SIZE) {
685 /* There is not enough space before start, but we may be able to
686 * move the start forward by one page.
692 aligned_start = RTE_PTR_ADD(aligned_start, page_sz);
693 aligned_len -= page_sz;
696 if (after_space != 0 && after_space <
697 MALLOC_ELEM_OVERHEAD + MIN_DATA_SIZE) {
698 /* There is not enough space after end, but we may be able to
699 * move the end backwards by one page.
705 aligned_end = RTE_PTR_SUB(aligned_end, page_sz);
706 aligned_len -= page_sz;
710 /* now we can finally free us some pages */
712 rte_rwlock_write_lock(&mcfg->memory_hotplug_lock);
715 * we allow secondary processes to clear the heap of this allocated
716 * memory because it is safe to do so, as even if notifications about
717 * unmapped pages don't make it to other processes, heap is shared
718 * across all processes, and will become empty of this memory anyway,
719 * and nothing can allocate it back unless primary process will be able
720 * to deliver allocation message to every single running process.
723 malloc_elem_free_list_remove(elem);
725 malloc_elem_hide_region(elem, (void *) aligned_start, aligned_len);
727 heap->total_size -= aligned_len;
729 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
730 /* notify user about changes in memory map */
731 eal_memalloc_mem_event_notify(RTE_MEM_EVENT_FREE,
732 aligned_start, aligned_len);
734 /* don't care if any of this fails */
735 malloc_heap_free_pages(aligned_start, aligned_len);
739 struct malloc_mp_req req;
741 memset(&req, 0, sizeof(req));
743 req.t = REQ_TYPE_FREE;
744 req.free_req.addr = aligned_start;
745 req.free_req.len = aligned_len;
748 * we request primary to deallocate pages, but we don't do it
749 * in this thread. instead, we notify primary that we would like
750 * to deallocate pages, and this process will receive another
751 * request (in parallel) that will do it for us on another
754 * we also don't really care if this succeeds - the data is
755 * already removed from the heap, so it is, for all intents and
756 * purposes, hidden from the rest of DPDK even if some other
757 * process (including this one) may have these pages mapped.
759 * notifications about deallocated memory happen during sync.
761 request_to_primary(&req);
764 RTE_LOG(DEBUG, EAL, "Heap on socket %d was shrunk by %zdMB\n",
765 msl->socket_id, aligned_len >> 20ULL);
767 rte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);
769 rte_spinlock_unlock(&(heap->lock));
774 malloc_heap_resize(struct malloc_elem *elem, size_t size)
778 if (!malloc_elem_cookies_ok(elem) || elem->state != ELEM_BUSY)
781 rte_spinlock_lock(&(elem->heap->lock));
783 ret = malloc_elem_resize(elem, size);
785 rte_spinlock_unlock(&(elem->heap->lock));
791 * Function to retrieve data for heap on given socket
794 malloc_heap_get_stats(struct malloc_heap *heap,
795 struct rte_malloc_socket_stats *socket_stats)
798 struct malloc_elem *elem;
800 rte_spinlock_lock(&heap->lock);
802 /* Initialise variables for heap */
803 socket_stats->free_count = 0;
804 socket_stats->heap_freesz_bytes = 0;
805 socket_stats->greatest_free_size = 0;
807 /* Iterate through free list */
808 for (idx = 0; idx < RTE_HEAP_NUM_FREELISTS; idx++) {
809 for (elem = LIST_FIRST(&heap->free_head[idx]);
810 !!elem; elem = LIST_NEXT(elem, free_list))
812 socket_stats->free_count++;
813 socket_stats->heap_freesz_bytes += elem->size;
814 if (elem->size > socket_stats->greatest_free_size)
815 socket_stats->greatest_free_size = elem->size;
818 /* Get stats on overall heap and allocated memory on this heap */
819 socket_stats->heap_totalsz_bytes = heap->total_size;
820 socket_stats->heap_allocsz_bytes = (socket_stats->heap_totalsz_bytes -
821 socket_stats->heap_freesz_bytes);
822 socket_stats->alloc_count = heap->alloc_count;
824 rte_spinlock_unlock(&heap->lock);
829 * Function to retrieve data for heap on given socket
832 malloc_heap_dump(struct malloc_heap *heap, FILE *f)
834 struct malloc_elem *elem;
836 rte_spinlock_lock(&heap->lock);
838 fprintf(f, "Heap size: 0x%zx\n", heap->total_size);
839 fprintf(f, "Heap alloc count: %u\n", heap->alloc_count);
843 malloc_elem_dump(elem, f);
847 rte_spinlock_unlock(&heap->lock);
851 rte_eal_malloc_heap_init(void)
853 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
855 if (register_mp_requests()) {
856 RTE_LOG(ERR, EAL, "Couldn't register malloc multiprocess actions\n");
857 rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
861 /* unlock mem hotplug here. it's safe for primary as no requests can
862 * even come before primary itself is fully initialized, and secondaries
863 * do not need to initialize the heap.
865 rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
867 /* secondary process does not need to initialize anything */
868 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
871 /* add all IOVA-contiguous areas to the heap */
872 return rte_memseg_contig_walk(malloc_add_seg, NULL);