[dpdk-dev] initialization order in rte_eal_init()

Tetsuya Mukawa mukawa at igel.co.jp
Tue Sep 9 07:01:09 CEST 2014


Hi,

I have a question about initialization order in rte_eal_init()
It seems some lcore related functions are called between
rte_eal_dev_init(PMD_INIT_PRE_PCI_PROBE) and rte_eal_pci_probe().
Is there any reason to do so?

int
rte_eal_init(int argc, char **argv)
{

(snip)

if (rte_eal_dev_init(PMD_INIT_PRE_PCI_PROBE) < 0)
rte_panic("Cannot init pmd devices\n");

RTE_LCORE_FOREACH_SLAVE(i) {

/*
* create communication pipes between master thread
* and children
*/
if (pipe(lcore_config[i].pipe_master2slave) < 0)
rte_panic("Cannot create pipe\n");
if (pipe(lcore_config[i].pipe_slave2master) < 0)
rte_panic("Cannot create pipe\n");

lcore_config[i].state = WAIT;

/* create a thread for each lcore */
ret = pthread_create(&lcore_config[i].thread_id, NULL,
eal_thread_loop, NULL);
if (ret != 0)
rte_panic("Cannot create thread\n");
}

/*
* Launch a dummy function on all slave lcores, so that master lcore
* knows they are all ready when this function returns.
*/
rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
rte_eal_mp_wait_lcore();

/* Probe & Initialize PCI devices */
if (rte_eal_pci_probe())
rte_panic("Cannot probe PCI\n");

/* Initialize any outstanding devices */
if (rte_eal_dev_init(PMD_INIT_POST_PCI_PROBE) < 0)
rte_panic("Cannot init pmd devices\n");

return fctret;
}

Thanks,
Tetsuya


More information about the dev mailing list