]> git.droids-corp.org - dpdk.git/commitdiff
mem: check for contiguousness in external segments
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 14 Nov 2018 14:51:11 +0000 (14:51 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 18 Nov 2018 13:12:20 +0000 (14:12 +0100)
For IOVA as VA mode, we assume that memory is contiguous. However,
for external segments that assumption may not necessarily hold.
Fix the code to not assume that external memory segments are
contiguous even in IOVA as VA mode.

Fixes: 5282bb1c3695 ("mem: allow memseg lists to be marked as external")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/eal_common_memalloc.c

index 1d41ea1126eb59fbb320b70d02596d69c900c0da..3712719793623a20339f068eb430972f75338d3a 100644 (file)
@@ -77,7 +77,7 @@ eal_memalloc_is_contig(const struct rte_memseg_list *msl, void *start,
        const struct rte_memseg *ms;
 
        /* for IOVA_VA, it's always contiguous */
-       if (rte_eal_iova_mode() == RTE_IOVA_VA)
+       if (rte_eal_iova_mode() == RTE_IOVA_VA && !msl->external)
                return true;
 
        /* for legacy memory, it's always contiguous */