doc: fix spelling reported by aspell in comments
[dpdk.git] / lib / librte_eal / linux / eal / eal_memory.c
index 23fe441..416dad8 100644 (file)
@@ -50,6 +50,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "eal_options.h"
 
 #define PFN_MASK_SIZE  8
 
@@ -540,7 +541,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) {
@@ -1442,7 +1443,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())
@@ -2105,7 +2106,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
 
@@ -2286,7 +2288,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;
@@ -2445,6 +2448,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