From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by dpdk.org (Postfix) with ESMTP id DCD695F2A for ; Wed, 21 Mar 2018 16:08:39 +0100 (CET) Received: by mail-lf0-f67.google.com with SMTP id j68-v6so8348717lfg.13 for ; Wed, 21 Mar 2018 08:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pnZCFQ6nD8W7dQFKQfVs9ZuwDH05ErB8cZ6H452nw8A=; b=L6scRJ+aOxLkM5MpkcIBhRDmhQ1wzcBHEPWqlpoPzWVhtryFGEMXYCDmcq/PxCSPDh lU95LgtlcPwjl34c6KNLjdXGqSMjndaa1AMLeQL+bhV62EI/mx2X55rMIoGfYgGg+3wi 55tZTwGKIHK5kWgZlRsrn7IBr7Eej1EVcx/u17R1cxrsFJMYcfjk+p2HQPuNg/7xha3V QvQ8vLXFuqHVok8YeqmAPRRno2eL0fkWqYnBjqRGXlWZGQNuxbAuNNrhbkSxDTEsmFEn CxE3YltWrCXEd7Qc1+e9zszWUGWg5o03k0gwYxdyaqkxGvsVKIuOzcTFOalWjSjHCUc4 3+aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pnZCFQ6nD8W7dQFKQfVs9ZuwDH05ErB8cZ6H452nw8A=; b=oT35q1tt0JvDh+ArjLU5hnc36L06HUQ7fxayvtMDFVtHyqx5sFFZtq+56GJOVMswC4 ApQgy327YSh6r7BZAGHfNP7HvPE5m/fSM9dY/6BbEpERmRESKUHupHX9345/zQL12VRn UqPZF1mhA/84IRbd36KfkBj+4o3vxtnT0Jgh2sOIRS71xTmODyt962zDi/eCs610tBXm vxFUce/N1YO4LchNP8v/NhaoVrBMLaUigz75qFgee1OZGkGcmfFryAu1yRqoruzvJWMU 8Gltswo7dgYhEUtuwd2bRRJW0FKdp/HPpCn/nSqBzfXaBoj8G5gb9PQ079P32i50snYJ lv3g== X-Gm-Message-State: AElRT7GYnfg/cFoZL7ifPEHzIf8Orar2AoBU1Df+cnQEJ+akA+66R4p7 EFJU5zv7gLFrKrgzO6zSHpjo1MKT5Fpkf7j35aA= X-Google-Smtp-Source: AG47ELubtKpYW/dhIkilvGq7Xdq+yYK94UPOFTDCO8tNWLNe+lt7a37Bhj+OJUhUvVtlhyw9fBHQoOIT3YIhk/BdnvU= X-Received: by 10.46.34.70 with SMTP id i67mr13862153lji.143.1521644919191; Wed, 21 Mar 2018 08:08:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:e494:0:0:0:0:0 with HTTP; Wed, 21 Mar 2018 08:08:38 -0700 (PDT) In-Reply-To: <7a3e0ef8-7083-6546-b016-3403da102ed1@intel.com> References: <7a3e0ef8-7083-6546-b016-3403da102ed1@intel.com> From: Venkatesh N Date: Wed, 21 Mar 2018 20:38:38 +0530 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" 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: Wed, 21 Mar 2018 15:08:40 -0000 Thank Yigit. It worked for me. I think if the same information is provided in the doc folder then it can avoid confusion. Many blogs said to build it as static library. Regards, Venky On Tue, Mar 20, 2018 at 5:54 PM, Ferruh Yigit wrote: > 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