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

Function rte_eal_memzone_init

dpdk/lib/eal/common/eal_common_memzone.c:423–448  ·  view source on GitHub ↗

* Init the memzone subsystem */

Source from the content-addressed store, hash-verified

421 * Init the memzone subsystem
422 */
423int
424rte_eal_memzone_init(void)
425{
426 struct rte_mem_config *mcfg;
427 int ret = 0;
428
429 /* get pointer to global configuration */
430 mcfg = rte_eal_get_configuration()->mem_config;
431
432 rte_rwlock_write_lock(&mcfg->mlock);
433
434 if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
435 rte_fbarray_init(&mcfg->memzones, "memzone",
436 rte_memzone_max_get(), sizeof(struct rte_memzone))) {
437 RTE_LOG(ERR, EAL, "Cannot allocate memzone list\n");
438 ret = -1;
439 } else if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
440 rte_fbarray_attach(&mcfg->memzones)) {
441 RTE_LOG(ERR, EAL, "Cannot attach to memzone list\n");
442 ret = -1;
443 }
444
445 rte_rwlock_write_unlock(&mcfg->mlock);
446
447 return ret;
448}
449
450/* Walk all reserved memory zones */
451void rte_memzone_walk(void (*func)(const struct rte_memzone *, void *),

Callers 3

rte_eal_initFunction · 0.85
rte_eal_initFunction · 0.85
rte_eal_initFunction · 0.85

Calls 5

rte_eal_process_typeFunction · 0.85
rte_fbarray_initFunction · 0.85
rte_memzone_max_getFunction · 0.85
rte_fbarray_attachFunction · 0.85

Tested by

no test coverage detected