From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0E8632C01 for ; Tue, 20 Mar 2018 13:24:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2018 05:24:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,335,1517904000"; d="scan'208";a="35329470" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.63]) ([10.237.221.63]) by FMSMGA003.fm.intel.com with ESMTP; 20 Mar 2018 05:24:21 -0700 To: Venkatesh N , dev@dpdk.org References: From: Ferruh Yigit Message-ID: <7a3e0ef8-7083-6546-b016-3403da102ed1@intel.com> Date: Tue, 20 Mar 2018 12:24:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] rte_eth_dev_count() returns 0 in shared library mode. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2018 12:24:24 -0000 On 3/19/2018 3:34 PM, Venkatesh N wrote: > Hi Everyone, > > Need urgent help over here. > > After cloning the latest git, when i compiled the dpdk > in shared library mode by modifying the common_base config file > and rebuild the examples the api rte_eth_dev_count() returns 0 > > However in the static library mode, rte_eth_dev_count() returns 2. > Can someone please let me know what iam missing over here. > > Here are details > > -- Code -- > > /* Check that there is an even number of ports to send/receive on. */ > nb_ports = rte_eth_dev_count(); > if (nb_ports < 2 || (nb_ports & 1)) > rte_exit(EXIT_FAILURE, "Error: number of ports must be even\n"); > > > #make config T=x86_64-native-linuxapp-gcc install examples > --------------------------------------- > Libraries built by changing the SHARED_LIB. > > config/common_base > +++ b/config/common_base > @@ -38,7 +38,7 @@ CONFIG_RTE_ARCH_STRICT_ALIGN=n > # > # Compile to share library > # > -CONFIG_RTE_BUILD_SHARED_LIB=n > +CONFIG_RTE_BUILD_SHARED_LIB=y > ---------------------------------------- > > > ------------------------------------------------------------------------------------------ > > [root@localhost dpdk_new]# > ./examples/skeleton/x86_64-native-linuxapp-gcc/basicfwd > EAL: Detected 72 lcore(s) > EAL: Multi-process socket /var/run/.rte_unix > EAL: Probing VFIO support... > EAL: Error - exiting with code: 1 > Cause: Error: number of ports must be even > ------------------------------------------------------------------------------------------ > [root@localhost dpdk_new]# ldd > ./examples/skeleton/x86_64-native-linuxapp-gcc/basicfwd > linux-vdso.so.1 => (0x00007fffa858a000) > librte_flow_classify.so.1.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_flow_classify.so.1.1 > (0x00007f7272f5f000) > librte_pipeline.so.3.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_pipeline.so.3.1 > (0x00007f7272d58000) > librte_table.so.3.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_table.so.3.1 > (0x00007f7272b3e000) > librte_port.so.3.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_port.so.3.1 > (0x00007f727291d000) > librte_pdump.so.2.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_pdump.so.2.1 > (0x00007f7272513000) > librte_distributor.so.1.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_distributor.so.1.1 > (0x00007f727230d000) > librte_ip_frag.so.1.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_ip_frag.so.1.1 > (0x00007f7272103000) > librte_gro.so.1.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_gro.so.1.1 > (0x00007f7271efc000) > librte_gso.so.1.1 => > /root/DPDK/dpdk_new/x86_64-native-linuxapp-gcc/lib/librte_gso.so.1.1 > (0x00007f7271cf7000) > --snip-- > > [root@localhost dpdk_new]# ./usertools/dpdk-devbind.py --status > > Network devices using DPDK-compatible driver > ============================================ > 0000:04:00.0 'I350 Gigabit Network Connection 1521' drv=igb_uio unused= > 0000:04:00.1 'I350 Gigabit Network Connection 1521' drv=igb_uio unused= > > ------------ Static Library Mode --------------------- > > [root@localhost dpdk_new]# > ./examples/skeleton/x86_64-native-linuxapp-gcc/basicfwd > EAL: Detected 72 lcore(s) > EAL: Multi-process socket /var/run/.rte_unix > EAL: Probing VFIO support... > EAL: PCI device 0000:04:00.0 on NUMA socket 0 > EAL: probe driver: 8086:1521 net_e1000_igb > EAL: PCI device 0000:04:00.1 on NUMA socket 0 > EAL: probe driver: 8086:1521 net_e1000_igb > EAL: PCI device 0000:04:00.2 on NUMA socket 0 > EAL: probe driver: 8086:1521 net_e1000_igb > EAL: PCI device 0000:04:00.3 on NUMA socket 0 > EAL: probe driver: 8086:1521 net_e1000_igb > EAL: PCI device 0000:05:00.0 on NUMA socket 0 > EAL: probe driver: 8086:1572 net_i40e > EAL: PCI device 0000:05:00.1 on NUMA socket 0 > EAL: probe driver: 8086:1572 net_i40e > Port 0 MAC: 14 02 ec 6b 36 10 > Port 1 MAC: 14 02 ec 6b 36 11 > > ----------------------------------- > > Git Log > ------- > commit 09e1e8d256b0832a64af6d13bf96fcb49e1e7ded > Author: Hemant Agrawal > Date: Fri Feb 23 15:28:03 2018 +0530 > > mk: fix dependencies of dpaaX drivers > > This patch fixes the build dependency of various > dpaaX components, when the dpaa or fslmc bus is disabled, > or VFIO is disabled. > > Regards, > Venky > Need to provide "-d" parameter for shared build [1], something like: "./examples/skeleton/x86_64-native-linuxapp-gcc/basicfwd -d ./x86_64-native-linuxapp-gcc/lib" [1] https://dpdk.org/doc/guides/linux_gsg/build_sample_apps.html#running-a-sample-application