init memory subsystem */
| 1082 | |
| 1083 | /* init memory subsystem */ |
| 1084 | int |
| 1085 | rte_eal_memory_init(void) |
| 1086 | { |
| 1087 | const struct internal_config *internal_conf = |
| 1088 | eal_get_internal_configuration(); |
| 1089 | int retval; |
| 1090 | |
| 1091 | RTE_LOG(DEBUG, EAL, "Setting up physically contiguous memory...\n"); |
| 1092 | |
| 1093 | if (rte_eal_memseg_init() < 0) |
| 1094 | goto fail; |
| 1095 | |
| 1096 | if (eal_memalloc_init() < 0) |
| 1097 | goto fail; |
| 1098 | |
| 1099 | retval = rte_eal_process_type() == RTE_PROC_PRIMARY ? |
| 1100 | rte_eal_hugepage_init() : |
| 1101 | rte_eal_hugepage_attach(); |
| 1102 | if (retval < 0) |
| 1103 | goto fail; |
| 1104 | |
| 1105 | if (internal_conf->no_shconf == 0 && rte_eal_memdevice_init() < 0) |
| 1106 | goto fail; |
| 1107 | |
| 1108 | return 0; |
| 1109 | fail: |
| 1110 | return -1; |
| 1111 | } |
| 1112 | |
| 1113 | #ifndef RTE_EXEC_ENV_WINDOWS |
| 1114 | #define EAL_MEMZONE_LIST_REQ "/eal/memzone_list" |
no test coverage detected