Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rte_eth_dev_count() #1

Open
spand009 opened this issue Jul 3, 2018 · 3 comments
Open

rte_eth_dev_count() #1

spand009 opened this issue Jul 3, 2018 · 3 comments
Assignees

Comments

@spand009
Copy link

spand009 commented Jul 3, 2018

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.

@mlilja01 mlilja01 assigned mlilja01 and napafc and unassigned mlilja01 Jul 3, 2018
@spand009
Copy link
Author

spand009 commented Jul 3, 2018

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
Copy link

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

@talsaiag
Copy link

talsaiag commented Jun 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants