| 1929 | } |
| 1930 | |
| 1931 | int |
| 1932 | rte_eal_memseg_init(void) |
| 1933 | { |
| 1934 | /* increase rlimit to maximum */ |
| 1935 | struct rlimit lim; |
| 1936 | |
| 1937 | #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES |
| 1938 | const struct internal_config *internal_conf = |
| 1939 | eal_get_internal_configuration(); |
| 1940 | #endif |
| 1941 | if (getrlimit(RLIMIT_NOFILE, &lim) == 0) { |
| 1942 | /* set limit to maximum */ |
| 1943 | lim.rlim_cur = lim.rlim_max; |
| 1944 | |
| 1945 | if (setrlimit(RLIMIT_NOFILE, &lim) < 0) { |
| 1946 | RTE_LOG(DEBUG, EAL, "Setting maximum number of open files failed: %s\n", |
| 1947 | strerror(errno)); |
| 1948 | } else { |
| 1949 | RTE_LOG(DEBUG, EAL, "Setting maximum number of open files to %" |
| 1950 | PRIu64 "\n", |
| 1951 | (uint64_t)lim.rlim_cur); |
| 1952 | } |
| 1953 | } else { |
| 1954 | RTE_LOG(ERR, EAL, "Cannot get current resource limits\n"); |
| 1955 | } |
| 1956 | #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES |
| 1957 | if (!internal_conf->legacy_mem && rte_socket_count() > 1) { |
| 1958 | RTE_LOG(WARNING, EAL, "DPDK is running on a NUMA system, but is compiled without NUMA support.\n"); |
| 1959 | RTE_LOG(WARNING, EAL, "This will have adverse consequences for performance and usability.\n"); |
| 1960 | RTE_LOG(WARNING, EAL, "Please use --"OPT_LEGACY_MEM" option, or recompile with NUMA support.\n"); |
| 1961 | } |
| 1962 | #endif |
| 1963 | |
| 1964 | return rte_eal_process_type() == RTE_PROC_PRIMARY ? |
| 1965 | #ifndef RTE_ARCH_64 |
| 1966 | memseg_primary_init_32() : |
| 1967 | #else |
| 1968 | memseg_primary_init() : |
| 1969 | #endif |
| 1970 | memseg_secondary_init(); |
| 1971 | } |
no test coverage detected