MCPcopy Create free account
hub / github.com/F-Stack/f-stack / memseg_secondary_init

Function memseg_secondary_init

dpdk/lib/eal/linux/eal_memory.c:1901–1929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1899}
1900
1901static int
1902memseg_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
1931int
1932rte_eal_memseg_init(void)

Callers 1

rte_eal_memseg_initFunction · 0.70

Calls 3

rte_fbarray_attachFunction · 0.85
eal_memseg_list_allocFunction · 0.85

Tested by

no test coverage detected