summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Leroy <maxime.leroy@6wind.com>2014-04-30 15:15:08 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-04-30 22:59:17 +0200
commit9ad0e24942cc61bd18860009ef6fa6f9c9ff6894 (patch)
tree5bf45b5b15bf884b5627897c583bb16f1d784fe1
parent5886ae07d211e4b5e49806dd183812beb31c67ad (diff)
downloaddpdk-9ad0e24942cc61bd18860009ef6fa6f9c9ff6894.zip
dpdk-9ad0e24942cc61bd18860009ef6fa6f9c9ff6894.tar.gz
dpdk-9ad0e24942cc61bd18860009ef6fa6f9c9ff6894.tar.xz
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>
-rw-r--r--lib/librte_eal/linuxapp/eal/eal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 04b2b32..39951fc 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -1058,12 +1058,14 @@ rte_eal_init(int argc, char **argv)
RTE_LOG(WARNING, EAL, "%s\n", dlerror());
}
- if (rte_eal_vdev_init() < 0)
- rte_panic("Cannot init virtual devices\n");
+ eal_thread_init_master(rte_config.master_lcore);
RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
rte_config.master_lcore, (int)thread_id);
+ if (rte_eal_vdev_init() < 0)
+ rte_panic("Cannot init virtual devices\n");
+
RTE_LCORE_FOREACH_SLAVE(i) {
/*
@@ -1084,8 +1086,6 @@ rte_eal_init(int argc, char **argv)
rte_panic("Cannot create thread\n");
}
- eal_thread_init_master(rte_config.master_lcore);
-
/*
* Launch a dummy function on all slave lcores, so that master lcore
* knows they are all ready when this function returns.