]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/bsdapp/eal/eal_memory.c
mem: allow memseg lists to be marked as external
[dpdk.git] / lib / librte_eal / bsdapp / eal / eal_memory.c
index 65ea670f94fe3bdc0ef8da0f1e6b6b3c2131cf6f..4b092e1f21220a5f8cd7d2e9ce1e72d64dc4be0b 100644 (file)
@@ -236,12 +236,15 @@ struct attach_walk_args {
        int seg_idx;
 };
 static int
-attach_segment(const struct rte_memseg_list *msl __rte_unused,
-               const struct rte_memseg *ms, void *arg)
+attach_segment(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
+               void *arg)
 {
        struct attach_walk_args *wa = arg;
        void *addr;
 
+       if (msl->external)
+               return 0;
+
        addr = mmap(ms->addr, ms->len, PROT_READ | PROT_WRITE,
                        MAP_SHARED | MAP_FIXED, wa->fd_hugepage,
                        wa->seg_idx * EAL_PAGE_SIZE);