| 1899 | } |
| 1900 | |
| 1901 | static int |
| 1902 | memseg_secondary_init(void) |
| 1903 | { |
| 1904 | struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; |
| 1905 | int msl_idx = 0; |
| 1906 | struct rte_memseg_list *msl; |
| 1907 | |
| 1908 | for (msl_idx = 0; msl_idx < RTE_MAX_MEMSEG_LISTS; msl_idx++) { |
| 1909 | |
| 1910 | msl = &mcfg->memsegs[msl_idx]; |
| 1911 | |
| 1912 | /* skip empty and external memseg lists */ |
| 1913 | if (msl->memseg_arr.len == 0 || msl->external) |
| 1914 | continue; |
| 1915 | |
| 1916 | if (rte_fbarray_attach(&msl->memseg_arr)) { |
| 1917 | RTE_LOG(ERR, EAL, "Cannot attach to primary process memseg lists\n"); |
| 1918 | return -1; |
| 1919 | } |
| 1920 | |
| 1921 | /* preallocate VA space */ |
| 1922 | if (eal_memseg_list_alloc(msl, 0)) { |
| 1923 | RTE_LOG(ERR, EAL, "Cannot preallocate VA space for hugepage memory\n"); |
| 1924 | return -1; |
| 1925 | } |
| 1926 | } |
| 1927 | |
| 1928 | return 0; |
| 1929 | } |
| 1930 | |
| 1931 | int |
| 1932 | rte_eal_memseg_init(void) |
no test coverage detected