eal: fix vdev allocation on non-0 numa socket
authorMaxime Leroy <maxime.leroy@6wind.com>
Wed, 30 Apr 2014 13:15:08 +0000 (15:15 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 30 Apr 2014 20:59:17 +0000 (22:59 +0200)
commit9ad0e24942cc61bd18860009ef6fa6f9c9ff6894
tree5bf45b5b15bf884b5627897c583bb16f1d784fe1
parent5886ae07d211e4b5e49806dd183812beb31c67ad
eal: fix vdev allocation on non-0 numa socket

vdev ethdev can not be allocated on a numa socket that is not socket 0.
The reason comes from rte_eth_dev_allocate() which uses rte_socket_id() to
identify the socket on which vdev driver data should be allocated.
However, at this initialization step, rte_socket_id() always returns 0.

Looking at rte_socket_id(), it needs rte_lcore_id() which uses the per-core
global _lcore_id variable. This variable is initialised by
eal_thread_init_master.

So eal_thread_init_master should be called before rte_eal_vdev_init().

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/eal/eal.c