From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by dpdk.org (Postfix) with ESMTP id E24E2B3BA for ; Thu, 25 Sep 2014 09:56:12 +0200 (CEST) Received: by mail-vc0-f179.google.com with SMTP id la4so7173740vcb.38 for ; Thu, 25 Sep 2014 01:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Q/ZILOqchQsoyP1bWG8Sy8K8RTzwlKgBHs/uQwYXzt8=; b=rIEOq1rCnhpzoaFlsR5F24LrAFq3G7huCsFEMI5+PZOg5S/S4ZJBPrEFuMAlix/sMk QlkNYuZOP1yJYxelUZLJnH95RtfWg6otjZA97V+PHquvFGC3j03WC2G8rSO3z6fizivL CrLdX5FeTjZDzYhgQgZemc24F/5/CJAhVenLxyZQoENlcaMMWcVyfIRvC8qs/GMWVE3X Dp31d+L0206wCC3p+M8WN+indPV94RVu0kuKFnyGSoflo5Ne4OZImHS6TKeE2AA1Lu/L UwAjkN5cVyz0yy6+9CKBWZvS1vXFb5xs6Xqo2ftY24cnERMC7wQVHi1RMb6GeuFIbroq bzkA== MIME-Version: 1.0 X-Received: by 10.220.100.10 with SMTP id w10mr10311348vcn.2.1411632148988; Thu, 25 Sep 2014 01:02:28 -0700 (PDT) Received: by 10.52.181.197 with HTTP; Thu, 25 Sep 2014 01:02:28 -0700 (PDT) In-Reply-To: <20140923191213.GE12884@hmsreliant.think-freely.org> References: <12C2AAD9525203489F7B523D670129D91CA7579B@ex10-mbx-31007.ant.amazon.com> <20140923191213.GE12884@hmsreliant.think-freely.org> Date: Thu, 25 Sep 2014 17:02:28 +0900 Message-ID: From: Keunhong Lee To: Neil Horman Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Can not init NIC after merge to DPDK 1.7 problem 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: Thu, 25 Sep 2014 07:56:13 -0000 In DPDK1.7, PMDs are loaded by __constructor__ functions. As there is no direct reference to each PMD driver structures, linker may not link the PMD library. You should use -Wl,--whole-archive and -Wl,--no-whole-archive for linking DPDK applications. See http://dpdk.org/browse/dpdk/tree/mk/rte.app.mk for further information. Keunhong. 2014-09-24 4:12 GMT+09:00 Neil Horman : > On Tue, Sep 23, 2014 at 06:53:57PM +0000, Wang, Shawn wrote: > > Hi: > > > > We are using our own Makefile in building dpdk program. Recently we are > working on upgrading from DPDK 1.3 to DPDK 1.7. I found the > rte_ixgbe_pmd_init has been replaced by PMD_REGISTER_DRIVER. So I delete > rte_ixgbe_pmd_init calls. But after that, our dpdk program could not > correctly find the NIC anymore. After digging into it a little more, I > found the code dose not correctly register the driver type we are using, > which is ixgbe. > > To isolate the problem, I hacked a smal example l3fwd, and only have the > main.c file like this for my testing purpose. > > > > #include > > #include > > > > #include "main.h" > > > > int > > MAIN(int argc, char **argv) > > { > > /* init EAL */ > > int ret = rte_eal_init(argc, argv); > > printf("ret %d\n", ret); > > return 0; > > } > > > > I found if I use the Makefile provided in the example, the program will > find the ixgbe NIC. But if I just use these 2 commands to compile and link > it. It will not find the ixgbe NIC. > > > > gcc -I../../x86_64-native-linuxapp-gcc/include > -L../../x86_64-native-linuxapp-gcc/lib -lrte_eal -c main.c > > gcc -o l3fwd main.o -L../../x86_64-native-linuxapp-gcc/lib -lrte_eal > -lrte_distributor -lrte_pipeline -lrte_port -lrte_timer -lrte_hash > -lrte_acl -lm -lrt -lrte_mbuf -lethdev -lrte_malloc -lrte_mempool > -lrte_ring -lc -lm -lrte_cmdline -lrte_cfgfile -lrte_pmd_bond > -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring -lpthread -ldl -lrt > > > > Can someone share some light on what is magic of the dpdk Makefile to > correctly register the NIC type? > > > > Thank you so much. > > Xingbo Wang > > > > I'm not really sure why you would strip out the Makefiles to dpdk, but I > suppose > thats not the germaine question. > > First, how are you building the DPDK? As a set of shared libraries, or as > a set > of static archives? If you're building shared libraries, you need to pass > -shared to gcc, or the constructors will get stripped out using your > command > line above. There might be some other options that escape me, but you can > find > out for sure by using the packaged makefiles and running make V=1 to see > all the > passed options in the link stage > > Secondly, when you say register the NIC type, do you mean that you don't > see the > NIC get registered with dpdk, or you don't see an instance of the NIC > created? > If its the former, you need to confirm that by running a debugger and > looking at > what elements are on the device_list after your applications starts. If > its the > latter, that may well be a config error, as you may need to pass the > --whitelist > option on the command line to trigger a device probe. > > Neil > >