napatech / daq_dpdk_multiqueue

Snort DPDK DAQ module with multiqueue support - Primarily for Napatech NICs
GNU General Public License v2.0
28 stars 16 forks source link

rte_eth_dev_count() #1

Open spand009 opened 6 years ago

spand009 commented 6 years ago

rte_eth_dev_count() (daq_dpdk.c) returns 0 despite of the same function returning 2 in $RTE_SDK/examples/ethtool's test. Likewise, rte_eth_dev_info_get(port, &inf) also return 0 in the attributes of the structure returned.

I am using: dpdk-stable-16.07.2

Here are the dpdk-binds:

Network devices using DPDK-compatible driver

0000:01:00.2 'Ethernet Controller X710 for 10GbE SFP+' drv=vfio-pci unused= 0000:01:00.3 'Ethernet Controller X710 for 10GbE SFP+' drv=vfio-pci unused=

Network devices using kernel driver

0000:01:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=em1 drv=i40e unused=vfio-pci Active 0000:01:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=em2 drv=i40e unused=vfio-pci 0000:04:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=p7p1 drv=i40e unused=vfio-pci 0000:04:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=p7p2 drv=i40e unused=vfio-pci 0000:04:00.2 'Ethernet Controller X710 for 10GbE SFP+' if=p7p3 drv=i40e unused=vfio-pci 0000:04:00.3 'Ethernet Controller X710 for 10GbE SFP+' if=p7p4 drv=i40e unused=vfio-pci 0000:05:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=p5p1 drv=i40e unused=vfio-pci 0000:05:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=p5p2 drv=i40e unused=vfio-pci 0000:05:00.2 'Ethernet Controller X710 for 10GbE SFP+' if=p5p3 drv=i40e unused=vfio-pci 0000:05:00.3 'Ethernet Controller X710 for 10GbE SFP+' if=p5p4 drv=i40e unused=vfio-pci

The Snort version I am running: ,,_ -> Snort++ <- o" )~ Version 3.0.0 (Build 243) from 2.9.11 '''' By Martin Roesch & The Snort Team http://snort.org/contact#team Copyright (C) 2014-2018 Cisco and/or its affiliates. All rights reserved. Copyright (C) 1998-2013 Sourcefire, Inc., et al. Using DAQ version 2.2.1 Using LuaJIT version 2.0.5 Using OpenSSL 1.0.1f 6 Jan 2014 Using libpcap version 1.5.3 Using PCRE version 8.31 2012-07-06 Using ZLIB version 1.2.8 Using LZMA version 5.1.0alpha

Lastly, I also tried building dpdk with -fPIC, which did not fix it.

spand009 commented 6 years ago

The snort version I have uses cmake, so I am not sure how to patch it to reflect this; if this were indeed the problem. `diff --git a/src/Makefile b/src/Makefile index bc947ba..54985aa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -507,7 +507,7 @@ clean-binPROGRAMS:

snort$(EXEEXT): $(snort_OBJECTS) $(snort_DEPENDENCIES) $(EXTRA_snort_DEPENDENCIES) @rm -f snort$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(snort_OBJECTS) $(snort_LDADD) $(LIBS) +$(AM_V_CCLD)$(LINK) $(snort_OBJECTS) $(snort_LDADD) $(LIBS) -Wl,--whole-archive,-ldpdk,--no-whole-archive`

dotanalon commented 5 years ago

Im facing this issue also.. the problem is that project structure changed and this make file dont exists any more...

talsaiag commented 5 years ago

I had a similar issue in another project, turns out, as @spand009 mentioned - DPDK requires a couple of libraries to be linked even if not used by the code (specifically the PWDs that are registered automatically on library load - which causes rte_eth_dev_count to return 0) use the -Wl,--whole-archive,-ldpdk,--no-whole-archive during the linking stage to link with the whole dpdk library to fix the issue.