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

Function rte_config_init

dpdk/lib/eal/linux/eal.c:375–414  ·  view source on GitHub ↗

Sets up rte_config structure with the pointer to shared memory config.*/

Source from the content-addressed store, hash-verified

373
374/* Sets up rte_config structure with the pointer to shared memory config.*/
375static int
376rte_config_init(void)
377{
378 struct rte_config *config = rte_eal_get_configuration();
379 const struct internal_config *internal_conf =
380 eal_get_internal_configuration();
381
382 config->process_type = internal_conf->process_type;
383
384 switch (config->process_type) {
385 case RTE_PROC_PRIMARY:
386 if (rte_eal_config_create() < 0)
387 return -1;
388 eal_mcfg_update_from_internal();
389 break;
390 case RTE_PROC_SECONDARY:
391 if (rte_eal_config_attach() < 0)
392 return -1;
393 eal_mcfg_wait_complete();
394 if (eal_mcfg_check_version() < 0) {
395 RTE_LOG(ERR, EAL, "Primary and secondary process DPDK version mismatch\n");
396 return -1;
397 }
398 if (rte_eal_config_reattach() < 0)
399 return -1;
400 if (!__rte_mp_enable()) {
401 RTE_LOG(ERR, EAL, "Primary process refused secondary attachment\n");
402 return -1;
403 }
404 eal_mcfg_update_internal();
405 break;
406 case RTE_PROC_AUTO:
407 case RTE_PROC_INVALID:
408 RTE_LOG(ERR, EAL, "Invalid process type %d\n",
409 config->process_type);
410 return -1;
411 }
412
413 return 0;
414}
415
416/* Unlocks hugepage directories that were locked by eal_hugepage_info_init */
417static void

Callers 1

rte_eal_initFunction · 0.70

Calls 10

eal_mcfg_wait_completeFunction · 0.85
eal_mcfg_check_versionFunction · 0.85
__rte_mp_enableFunction · 0.85
eal_mcfg_update_internalFunction · 0.85
rte_eal_config_createFunction · 0.70
rte_eal_config_attachFunction · 0.70
rte_eal_config_reattachFunction · 0.70

Tested by

no test coverage detected