eal: use define instead of raw option name
authorAnatoly Burakov <anatoly.burakov@intel.com>
Thu, 24 Oct 2019 15:17:57 +0000 (16:17 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 25 Oct 2019 09:35:10 +0000 (11:35 +0200)
We are using '--base-virtaddr' in a few places. We have a define for that,
so use it instead.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/librte_eal/freebsd/eal/eal.c
lib/librte_eal/freebsd/eal/eal_memory.c
lib/librte_eal/linux/eal/eal.c
lib/librte_eal/linux/eal/eal_memory.c

index c7e1264..14e1713 100644 (file)
@@ -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;
index cd31827..5e02044 100644 (file)
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
+
 #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");
index c0aac21..aae67b2 100644 (file)
@@ -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;
                }
index 28a78a5..226ac70 100644 (file)
@@ -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");