DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Venkatesh N <venkatesh.nagaraj@gmail.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] rte_eth_dev_count() returns 0 in shared library mode.
Date: Tue, 20 Mar 2018 12:24:21 +0000	[thread overview]
Message-ID: <7a3e0ef8-7083-6546-b016-3403da102ed1@intel.com> (raw)
In-Reply-To: <CAC8emX=4XnLM-c+J2e7Dg5tF_aSvjUS94RaOTHOy2NxMGFeewg@mail.gmail.com>

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 <hemant.agrawal@nxp.com>
> 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

  reply	other threads:[~2018-03-20 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 15:34 Venkatesh N
2018-03-20 12:24 ` Ferruh Yigit [this message]
2018-03-21 15:08   ` Venkatesh N

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a3e0ef8-7083-6546-b016-3403da102ed1@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=venkatesh.nagaraj@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).