From 3fe4bced1ba1f586ce5407e91537151d4eb43061 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 24 Oct 2019 16:17:57 +0100 Subject: [PATCH] eal: use define instead of raw option name We are using '--base-virtaddr' in a few places. We have a define for that, so use it instead. Signed-off-by: Anatoly Burakov Reviewed-by: David Marchand --- lib/librte_eal/freebsd/eal/eal.c | 3 ++- lib/librte_eal/freebsd/eal/eal_memory.c | 5 ++++- lib/librte_eal/linux/eal/eal.c | 4 ++-- lib/librte_eal/linux/eal/eal_memory.c | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c index c7e1264205..14e1713294 100644 --- a/lib/librte_eal/freebsd/eal/eal.c +++ b/lib/librte_eal/freebsd/eal/eal.c @@ -345,7 +345,8 @@ rte_eal_config_reattach(void) if (mem_config != MAP_FAILED) { /* errno is stale, don't use */ RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]" - " - please use '--base-virtaddr' option\n", + " - please use '--" OPT_BASE_VIRTADDR + "' option\n", rte_mem_cfg_addr, mem_config); munmap(mem_config, sizeof(struct rte_mem_config)); return -1; diff --git a/lib/librte_eal/freebsd/eal/eal_memory.c b/lib/librte_eal/freebsd/eal/eal_memory.c index cd31827c2b..5e02044760 100644 --- a/lib/librte_eal/freebsd/eal/eal_memory.c +++ b/lib/librte_eal/freebsd/eal/eal_memory.c @@ -14,10 +14,12 @@ #include #include #include + #include "eal_private.h" #include "eal_internal_cfg.h" #include "eal_filesystem.h" #include "eal_memcfg.h" +#include "eal_options.h" #define EAL_PAGE_SIZE (sysconf(_SC_PAGESIZE)) @@ -367,7 +369,8 @@ alloc_va_space(struct rte_memseg_list *msl) addr = eal_get_virtual_area(msl->base_va, &mem_sz, page_sz, 0, flags); if (addr == NULL) { if (rte_errno == EADDRNOTAVAIL) - RTE_LOG(ERR, EAL, "Could not mmap %llu bytes at [%p] - please use '--base-virtaddr' option\n", + RTE_LOG(ERR, EAL, "Could not mmap %llu bytes at [%p] - " + "please use '--" OPT_BASE_VIRTADDR "' option\n", (unsigned long long)mem_sz, msl->base_va); else RTE_LOG(ERR, EAL, "Cannot reserve memory\n"); diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index c0aac215af..aae67b28f0 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -435,8 +435,8 @@ rte_eal_config_reattach(void) if (mem_config != MAP_FAILED) { /* errno is stale, don't use */ RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]" - " - please use '--base-virtaddr' option\n", - rte_mem_cfg_addr, mem_config); + " - please use '--" OPT_BASE_VIRTADDR + "' option\n", rte_mem_cfg_addr, mem_config); munmap(mem_config, sizeof(struct rte_mem_config)); return -1; } diff --git a/lib/librte_eal/linux/eal/eal_memory.c b/lib/librte_eal/linux/eal/eal_memory.c index 28a78a5d44..226ac7014f 100644 --- a/lib/librte_eal/linux/eal/eal_memory.c +++ b/lib/librte_eal/linux/eal/eal_memory.c @@ -832,7 +832,8 @@ alloc_va_space(struct rte_memseg_list *msl) addr = eal_get_virtual_area(msl->base_va, &mem_sz, page_sz, 0, flags); if (addr == NULL) { if (rte_errno == EADDRNOTAVAIL) - RTE_LOG(ERR, EAL, "Could not mmap %llu bytes at [%p] - please use '--base-virtaddr' option\n", + RTE_LOG(ERR, EAL, "Could not mmap %llu bytes at [%p] - " + "please use '--" OPT_BASE_VIRTADDR "' option\n", (unsigned long long)mem_sz, msl->base_va); else RTE_LOG(ERR, EAL, "Cannot reserve memory\n"); -- 2.20.1