From patchwork Wed Mar 11 08:43:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Liu X-Patchwork-Id: 3969 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7B5356A87; Wed, 11 Mar 2015 09:44:07 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4236E683D for ; Wed, 11 Mar 2015 09:44:05 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 11 Mar 2015 01:41:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,380,1422950400"; d="scan'208";a="697033075" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 11 Mar 2015 01:44:03 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t2B8i1gs018712; Wed, 11 Mar 2015 16:44:01 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t2B8hxnd015975; Wed, 11 Mar 2015 16:44:01 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t2B8hxd1015971; Wed, 11 Mar 2015 16:43:59 +0800 From: Yong Liu To: dev@dpdk.org Date: Wed, 11 Mar 2015 16:43:56 +0800 Message-Id: <1426063436-15939-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] app/test-pmd: fix rte_pci_tailq not initialized before used 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Function rte_eal_pci_init will cast pci resource list and used for insert probed device later. But all tailq initialized in function rte_eal_tailqs_init, so rte_eal_pci_init must be called after it. Signed-off-by: Marvin Liu diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index bd770cf..576f9f8 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -755,9 +755,6 @@ rte_eal_init(int argc, char **argv) rte_config_init(); - if (rte_eal_pci_init() < 0) - rte_panic("Cannot init PCI\n"); - #ifdef RTE_LIBRTE_IVSHMEM if (rte_eal_ivshmem_init() < 0) rte_panic("Cannot init IVSHMEM\n"); @@ -792,6 +789,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_timer_init() < 0) rte_panic("Cannot init HPET or TSC timers\n"); + if (rte_eal_pci_init() < 0) + rte_panic("Cannot init PCI\n"); + eal_check_mem_on_local_socket(); rte_eal_mcfg_complete();