From: Damjan Marion Date: Wed, 28 Nov 2018 09:46:03 +0000 (+0100) Subject: cmake: display warning and continue if dpdk not present X-Git-Tag: v19.04-rc0~299 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=8ebd7929bdfd3ce6e9648abb76b7289056ea5114 cmake: display warning and continue if dpdk not present Change-Id: I5cb2619444507a159c42ac8401800e90b6541a20 Signed-off-by: Damjan Marion --- diff --git a/src/plugins/dpdk/CMakeLists.txt b/src/plugins/dpdk/CMakeLists.txt index ed743ea6d9d..f6ccb0358d4 100644 --- a/src/plugins/dpdk/CMakeLists.txt +++ b/src/plugins/dpdk/CMakeLists.txt @@ -17,6 +17,11 @@ find_path(DPDK_INCLUDE_DIR PATH_SUFFIXES dpdk NAMES rte_config.h) find_library(DPDK_LIB NAMES libdpdk.a) +if (NOT DPDK_INCLUDE_DIR) + message(WARNING "-- DPDK not found - dpdk_plugin disabled") + return() +endif() + ############################################################################## # Find DPDK Version ############################################################################## diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c index e903511ab81..41309dd1d99 100644 --- a/src/vppinfra/pmalloc.c +++ b/src/vppinfra/pmalloc.c @@ -295,13 +295,10 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a, if ((pm->flags & CLIB_PMALLOC_F_NO_PAGEMAP) == 0) mmap_flags |= MAP_LOCKED; - if (a->log2_subpage_sz != pm->sys_log2_page_sz) - mmap_flags |= MAP_HUGETLB | MAP_LOCKED; - if (a->flags & CLIB_PMALLOC_ARENA_F_SHARED_MEM) { mmap_flags |= MAP_SHARED; - if (mmap_flags & MAP_HUGETLB) + if (a->log2_subpage_sz != pm->sys_log2_page_sz) pm->error = clib_mem_create_hugetlb_fd ((char *) a->name, &a->fd); else pm->error = clib_mem_create_fd ((char *) a->name, &a->fd); @@ -312,6 +309,9 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a, } else { + if (a->log2_subpage_sz != pm->sys_log2_page_sz) + mmap_flags |= MAP_HUGETLB; + mmap_flags |= MAP_PRIVATE | MAP_ANONYMOUS; a->fd = -1; }