From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by dpdk.org (Postfix) with ESMTP id 0337F590E for ; Wed, 30 Apr 2014 15:15:21 +0200 (CEST) Received: by mail-wi0-f175.google.com with SMTP id cc10so9107789wib.8 for ; Wed, 30 Apr 2014 06:15:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QDHJ5I0mM0WYnU5J1RzszjRC2YoRNNrfDny70hWAT/o=; b=FzJ5/7BDmRiIuvOpw6mxt1+1yNwLKoIjROPjTRvla0qdZjpF/Qz+7IQOnLIwbfbweL JPEnM/ipvAypErivitTFRzMl41s1dl6IPgQeLWfUSzwj0jzNQi4g/EN3sYkto5h4lq6e lGlcH7P1IxGlTKoLXjyIoySSE7b4XoSPNfYPOgsT1BgPNje43KnuygRX5tggJaNIs+wO kS2PC5ZXR1wBuucq6ijKEQay8Q/8+F6aiPnULM8xbfFRub83lkVnr0VO5rbQCGKUcAtF IcsJLyWmBziFBQSstJnghDctJq3V2tPGQ8a11wvhd2W+9nQfv7x2KuPNISfe5xNQskfd E8vg== X-Gm-Message-State: ALoCoQnCYA32QEqsIBLgx90g1+ZhuPRoBplmxha6Cb+PZRq1RkoUV604ievUUayK7ykrJfnXaeXo X-Received: by 10.194.19.161 with SMTP id g1mr3934337wje.20.1398863725948; Wed, 30 Apr 2014 06:15:25 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id hm5sm36148321wjc.17.2014.04.30.06.15.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Apr 2014 06:15:25 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Wed, 30 Apr 2014 15:15:08 +0200 Message-Id: <1398863708-31078-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [PATCH] eal: fix vdev allocation on non-0 numa socket X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 13:15:22 -0000 From: Maxime Leroy 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 --- lib/librte_eal/linuxapp/eal/eal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index b7f5ffa..d7a59de 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -1056,12 +1056,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) { /* @@ -1082,8 +1084,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. -- 1.7.10.4