diff options
author | 2019-07-04 10:40:06 +0200 | |
---|---|---|
committer | 2019-07-04 11:08:12 +0200 | |
commit | ce2f72a24eaa89ff08fd64742c9425f17f42345c (patch) | |
tree | f43498577f515e5d25d21345459c00414eb1d985 /lib/librte_eal/linuxapp | |
parent | 5edab9b0e790c4e369c46998a9e56206a044297b (diff) |
New upstream version 18.11.2
Change-Id: Ifc37f95b203b872a3f4b5b5b4755a3bb561aa515
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_eal/linuxapp')
-rw-r--r-- | lib/librte_eal/linuxapp/eal/eal.c | 19 | ||||
-rw-r--r-- | lib/librte_eal/linuxapp/eal/eal_dev.c | 4 | ||||
-rw-r--r-- | lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 2 | ||||
-rw-r--r-- | lib/librte_eal/linuxapp/eal/eal_memalloc.c | 4 | ||||
-rw-r--r-- | lib/librte_eal/linuxapp/eal/eal_memory.c | 26 | ||||
-rw-r--r-- | lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 2 |
6 files changed, 37 insertions, 20 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 30138b63..7a08cf1e 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -320,7 +320,7 @@ rte_eal_config_create(void) rte_mem_cfg_addr = NULL; if (mem_cfg_fd < 0){ - mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0660); + mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0600); if (mem_cfg_fd < 0) rte_panic("Cannot open '%s' for rte_mem_config\n", pathname); } @@ -1000,6 +1000,12 @@ rte_eal_init(int argc, char **argv) return -1; } + if (rte_eal_alarm_init() < 0) { + rte_eal_init_alert("Cannot init interrupt-handling thread"); + /* rte_eal_alarm_init sets rte_errno on failure. */ + return -1; + } + /* Put mp channel init before bus scan so that we can init the vdev * bus through mp channel in the secondary process before the bus scan. */ @@ -1120,12 +1126,6 @@ rte_eal_init(int argc, char **argv) return -1; } - if (rte_eal_alarm_init() < 0) { - rte_eal_init_alert("Cannot init interrupt-handling thread"); - /* rte_eal_alarm_init sets rte_errno on failure. */ - return -1; - } - if (rte_eal_timer_init() < 0) { rte_eal_init_alert("Cannot init HPET or TSC timers"); rte_errno = ENOTSUP; @@ -1214,8 +1214,11 @@ rte_eal_init(int argc, char **argv) * whether we are primary or secondary process, but we cannot remove * primary process' files because secondary should be able to run even * if primary process is dead. + * + * In no_shconf mode, no runtime directory is created in the first + * place, so no cleanup needed. */ - if (eal_clean_runtime_dir() < 0) { + if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) { rte_eal_init_alert("Cannot clear runtime directory\n"); return -1; } diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c b/lib/librte_eal/linuxapp/eal/eal_dev.c index 2830c868..c4180938 100644 --- a/lib/librte_eal/linuxapp/eal/eal_dev.c +++ b/lib/librte_eal/linuxapp/eal/eal_dev.c @@ -66,8 +66,8 @@ static void sigbus_handler(int signum, siginfo_t *info, { int ret; - RTE_LOG(DEBUG, EAL, "Thread[%d] catch SIGBUS, fault address:%p\n", - (int)pthread_self(), info->si_addr); + RTE_LOG(DEBUG, EAL, "Thread catch SIGBUS, fault address:%p\n", + info->si_addr); rte_spinlock_lock(&failure_handle_lock); ret = rte_bus_sigbus_handler(info->si_addr); diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c index 0eab1cf7..6e898c24 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -45,7 +45,7 @@ static void * map_shared_memory(const char *filename, const size_t mem_size, int flags) { void *retval; - int fd = open(filename, flags, 0666); + int fd = open(filename, flags, 0600); if (fd < 0) return NULL; if (ftruncate(fd, mem_size) < 0) { diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c index f63d9ca6..81b441a9 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c @@ -740,6 +740,10 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id, __func__, socket_id, cur_socket_id); goto mapped; } +#else + if (rte_socket_count() > 1) + RTE_LOG(DEBUG, EAL, "%s(): not checking hugepage NUMA node.\n", + __func__); #endif ms->addr = addr; diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index e05da74c..898bdb77 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -46,6 +46,7 @@ #include "eal_internal_cfg.h" #include "eal_filesystem.h" #include "eal_hugepages.h" +#include "eal_options.h" #define PFN_MASK_SIZE 8 @@ -110,7 +111,7 @@ rte_mem_virt2phy(const void *virtaddr) fd = open("/proc/self/pagemap", O_RDONLY); if (fd < 0) { - RTE_LOG(ERR, EAL, "%s(): cannot open /proc/self/pagemap: %s\n", + RTE_LOG(INFO, EAL, "%s(): cannot open /proc/self/pagemap: %s\n", __func__, strerror(errno)); return RTE_BAD_IOVA; } @@ -118,7 +119,7 @@ rte_mem_virt2phy(const void *virtaddr) virt_pfn = (unsigned long)virtaddr / page_size; offset = sizeof(uint64_t) * virt_pfn; if (lseek(fd, offset, SEEK_SET) == (off_t) -1) { - RTE_LOG(ERR, EAL, "%s(): seek error in /proc/self/pagemap: %s\n", + RTE_LOG(INFO, EAL, "%s(): seek error in /proc/self/pagemap: %s\n", __func__, strerror(errno)); close(fd); return RTE_BAD_IOVA; @@ -127,11 +128,11 @@ rte_mem_virt2phy(const void *virtaddr) retval = read(fd, &page, PFN_MASK_SIZE); close(fd); if (retval < 0) { - RTE_LOG(ERR, EAL, "%s(): cannot read /proc/self/pagemap: %s\n", + RTE_LOG(INFO, EAL, "%s(): cannot read /proc/self/pagemap: %s\n", __func__, strerror(errno)); return RTE_BAD_IOVA; } else if (retval != PFN_MASK_SIZE) { - RTE_LOG(ERR, EAL, "%s(): read %d bytes from /proc/self/pagemap " + RTE_LOG(INFO, EAL, "%s(): read %d bytes from /proc/self/pagemap " "but expected %d:\n", __func__, retval, PFN_MASK_SIZE); return RTE_BAD_IOVA; @@ -536,7 +537,7 @@ create_shared_memory(const char *filename, const size_t mem_size) return retval; } - fd = open(filename, O_CREAT | O_RDWR, 0666); + fd = open(filename, O_CREAT | O_RDWR, 0600); if (fd < 0) return NULL; if (ftruncate(fd, mem_size) < 0) { @@ -1392,7 +1393,7 @@ eal_legacy_hugepage_init(void) if (mcfg->dma_maskbits && rte_mem_check_dma_mask_thread_unsafe(mcfg->dma_maskbits)) { RTE_LOG(ERR, EAL, - "%s(): couldnt allocate memory due to IOVA exceeding limits of current DMA mask.\n", + "%s(): couldn't allocate memory due to IOVA exceeding limits of current DMA mask.\n", __func__); if (rte_eal_iova_mode() == RTE_IOVA_VA && rte_eal_using_phys_addrs()) @@ -2038,7 +2039,8 @@ memseg_primary_init_32(void) socket_id = rte_socket_id_by_idx(i); #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES - if (socket_id > 0) + /* we can still sort pages by socket in legacy mode */ + if (!internal_config.legacy_mem && socket_id > 0) break; #endif @@ -2219,7 +2221,8 @@ memseg_primary_init(void) int socket_id = rte_socket_id_by_idx(i); #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES - if (socket_id > 0) + /* we can still sort pages by socket in legacy mode */ + if (!internal_config.legacy_mem && socket_id > 0) break; #endif memtypes[cur_type].page_sz = hugepage_sz; @@ -2378,6 +2381,13 @@ rte_eal_memseg_init(void) } else { RTE_LOG(ERR, EAL, "Cannot get current resource limits\n"); } +#ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES + if (!internal_config.legacy_mem && rte_socket_count() > 1) { + RTE_LOG(WARNING, EAL, "DPDK is running on a NUMA system, but is compiled without NUMA support.\n"); + RTE_LOG(WARNING, EAL, "This will have adverse consequences for performance and usability.\n"); + RTE_LOG(WARNING, EAL, "Please use --"OPT_LEGACY_MEM" option, or recompile with NUMA support.\n"); + } +#endif return rte_eal_process_type() == RTE_PROC_PRIMARY ? #ifndef RTE_ARCH_64 diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h index 5afa0871..5db5a133 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h @@ -127,7 +127,7 @@ struct rte_kni_device_info { /* mbuf size */ unsigned mbuf_size; unsigned int mtu; - char mac_addr[6]; + uint8_t mac_addr[6]; }; #define KNI_DEVICE "kni" |