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

Function sync_walk

dpdk/lib/eal/linux/eal_memalloc.c:1380–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1378}
1379
1380static int
1381sync_walk(const struct rte_memseg_list *msl, void *arg __rte_unused)
1382{
1383 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
1384 struct rte_memseg_list *primary_msl, *local_msl;
1385 struct hugepage_info *hi = NULL;
1386 unsigned int i;
1387 int msl_idx;
1388 struct internal_config *internal_conf =
1389 eal_get_internal_configuration();
1390
1391 if (msl->external)
1392 return 0;
1393
1394 msl_idx = msl - mcfg->memsegs;
1395 primary_msl = &mcfg->memsegs[msl_idx];
1396 local_msl = &local_memsegs[msl_idx];
1397
1398 for (i = 0; i < RTE_DIM(internal_conf->hugepage_info); i++) {
1399 uint64_t cur_sz =
1400 internal_conf->hugepage_info[i].hugepage_sz;
1401 uint64_t msl_sz = primary_msl->page_sz;
1402 if (msl_sz == cur_sz) {
1403 hi = &internal_conf->hugepage_info[i];
1404 break;
1405 }
1406 }
1407 if (!hi) {
1408 RTE_LOG(ERR, EAL, "Can't find relevant hugepage_info entry\n");
1409 return -1;
1410 }
1411
1412 /* if versions don't match, synchronize everything */
1413 if (local_msl->version != primary_msl->version &&
1414 sync_existing(primary_msl, local_msl, hi, msl_idx))
1415 return -1;
1416 return 0;
1417}
1418
1419
1420int

Callers

nothing calls this directly

Calls 3

sync_existingFunction · 0.85

Tested by

no test coverage detected