[dpdk-users] Need help understanding rte_eth_dev_count

Andriy Berestovskyy aber at semihalf.com
Wed Oct 12 09:36:49 CEST 2016


Hey,
In 16.07 the PMDs drivers get register using the PMD_REGISTER_DRIVER():
http://dpdk.org/browse/dpdk/tree/lib/librte_eal/common/include/rte_dev.h?id=v16.07#n187

The macro uses constructor attribute, so the drivers get registered
during the application startup, prior the main() function.


Regarding the configuration, try to reproduce the steps listed in the
documentation:
http://dpdk.org/doc/guides/nics/i40e.html

Andriy


On Wed, Oct 12, 2016 at 6:44 AM, Aniraj Kesavan <anirajkesavan at gmail.com> wrote:
> Hi,
>
> I'm very new to dpdk and I'm trying to set it up on a cluster with the
> following configuration:
> DPDK - 16.07
> Intel X710 2x10G Nics
> Ubuntu 15.04
>
> I could compile it, but when running sample applications such as
> skeleton/basicfwd and testpmd, it fails saying the ports aren't detected.
>
> I have done the following:
> enabled 1G huge pages and mounted them under /dev/hugepages
> ran dpdk-devbind.py on the interfaces after which the status shows:
>
> Network devices using DPDK-compatible driver
> ============================================
> 0000:04:00.0 'Ethernet Controller X710 for 10GbE SFP+' drv=igb_uio unused=
> 0000:04:00.1 'Ethernet Controller X710 for 10GbE SFP+' drv=igb_uio unused=
>
> While running gdb over the basicfwd application (run as sudo as it seemed
> like a requirement), it seems like rte_eth_dev_count is returning 0. Even
> the testpmd application is reporting no ports available. I have tried the
> portmask option and tried to pass the interfaces as -w arguments too.
>
> When I looked at rte_eth_dev_count, it's returning an unsigned static int
> that is only updated by rte_eth_dev_allocate. Following the breadcrumbs, it
> seemed like someone needed to invoke rte_eth_dev_register. I didn't see
> that being called in the basicfwd example's codepath.
>
> Can anyone tell me what usually causes rte_eth_dev_register to run and
> update the port number? Or is there anything I might have missed in the
> configuration that's causing the device to not show up when the library is
> looking for it.
>
>
>
> Thanks,
> Aniraj
>
>
>
> --
> Aniraj Kesavan
>
> MS CS '15-'17,
> University Of Utah
> CS '08-'12,
> Govt. Model Engineering College
> alternate e-mail:anirajkalathel at gmail.com
> http://www.cs.utah.edu/~aniraj/



-- 
Andriy Berestovskyy


More information about the users mailing list