vipinpv85 / DPDK-Suricata_3.0

add dpdk interface and packet processing to suricata in worker mode
https://github.com/vipinpv85/DPDK-Suricata_3.0
GNU Lesser General Public License v3.0
62 stars 34 forks source link

Due to incorrect project and settings, failing to link the dpdk libraries #10

Closed tolunFdancer closed 5 years ago

tolunFdancer commented 5 years ago

Expected behaviour build successfully when passing configure with with_dpdkintel_libraries

Log

1. I already updated the g++, but when I run "make -j 8", it turns out "libtool: link: require no space between `-L' and `/opt/tolun/dpdk-stable-17.11.3/x86_64-native-linuxapp-gcc/lib/' 
2. make[3]: *** [suricata] Error 1 make[3]: Leaving directory `/opt/tolun/DPDK-Suricata_3.0-master/suricata-3.0/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/opt/tolun/DPDK-Suricata_3.0-master/suricata-3.0/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/opt/tolun/DPDK-Suricata_3.0-master/suricata-3.0' make: *** [all] Error 2", 

So can you help me ?  Thanks a lot!

Details (please complete the following information):

Additional context Add any other context about the problem here.

vipinpv85 commented 5 years ago

My Dev and test environment is Ubuntu. Ihave not faced these issues. If you feel you need to correct the Makefile edit 'src/Makefile'

tolunFdancer commented 5 years ago

Thanks! I found out the reason, /DPDK-Suricata_3.0-master/suricata-3.0/configure, there should not be existing an spcae between -L and ${with_libdpdkintel_libraries} at line 17164 . I hope you fixed it.

vipinpv85 commented 5 years ago

Thanks for the update. As mentioned many times you have not shared config.log for me to debug. Why have not shared you are using with-libdpdkintel-libraries? Hence I have no clue what to fix.

Going forward I hope you will share clear information with lofs

vipinpv85 commented 5 years ago

I have rechecked my commits, as mentioned earlier for Ubuntu 18.04 Dec and test environment following commit is been tested and validated

https://github.com/vipinpv85/DPDK-Suricata_3.0/commit/46540ef80e2926b622a83a779a6fb3c27ebfa731

If you have different environment or Linux release please do the needfuk

tolunFdancer commented 5 years ago

OK, 3Q. Now it shows "/usr/bin/ld: cannot find -lethdev collect2: error: ld returned 1 exit status" when I run "make -j 10", the config.log did not show something. I already build the dpdk by following your readme.

tolunFdancer commented 5 years ago

And when I run ifconfig, it shows only ens160 and lo, no other ens.

vipinpv85 commented 5 years ago

Share your config.log Dpdk does not use kernel interface. Lethdev might be -l rte_ethdev.

Looks like you have issues with build infrastructure.

vipinpv85 commented 5 years ago

hint 1: you have mentioned as I already build the dpdk by following your readme Solution: If this is the case you would not be using with_libdpdkintel_libraries. Instead as suggested in readme would be setting RTE_SDK and RTE_TARGET and run with configure script.

Hence easiest way to debug is to share your config.log.

hint 2: when I run ifconfig, it shows only ens160 and lo, no other ens Solution: in readme, it is clearly specified to run with compiled Suricata with '--list-dpdkintel-ports'

Note: DPDK ports are not listed under kernel interface, so I am not sure what are you trying with 'ifconfig -a'

tolunFdancer commented 5 years ago

Here is my steps:

  1. cd DPDK-Suircata_3.0/suricata-3.0
  2. ./configure --enable-dpdkintel (RTE_TARGET & RTE_SDK is ok)
  3. make -j 10 (when come here ,it turns out the error"/usr/bin/ld: cannot find -lethdev") config.log
vipinpv85 commented 5 years ago

There are couple of interesting leads from your config.log

  1. Unit looks like you are using fedora 14 or something similar to it. Which is not the platform I have Dev or test on.

'''' hostname = f14cp-kfx18 uname -m = x86_64 uname -r = 3.10.0-514.el7.x86_64 uname -s = Linux '''

  1. Dpdk LD flag is ''' DPDKINTEL_LDADD='-Wl,--no-as-needed -Wl,-export-dynamic -L/opt/tolun/dpdk-stable-17.11.3/x86_64-native-linuxapp-gcc/lib/ -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_kni -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_jobstats -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_af_packet -Wl,-lrt -Wl,-lm -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive, /opt/tolun/dpdk-stable-17.11.3/x86_64-native-linuxapp-gcc/lib/libdpdk.a -ldl ' '''

  2. The LD fix you mentioned is not reflected '''' -L/opt/tolun/dpdk-stable-17.11.3/x86_64-native-linuxapp-gcc/lib/ '''

  3. The ldflag is present '''' -lethdev '''

Hence we have 2 options

  1. '''ls ${RTE_SDK}/${RTE_TARGET}'''
  2. '''find ${RTE_SDK}/${RTE_TARGET} -name ethdev'''
  3. Share your telnet or SSH login details to the O's in email.
tolunFdancer commented 5 years ago

I found out my DPDK did not build and run successfully. First I fix the DPDK,if there still are some errors about suricata then I will ask for your help. Thanks your time ,you are very kind!

vipinpv85 commented 5 years ago

Once again I humbly request you follow the readme, which clearly had stated test with helloworld, l2fwd examples. If the steps were taken into account you could have saved time and effort of debug much less and faster.

Please do follow the steps mentioned in readme. It saves time.

Good lick

tolunFdancer commented 5 years ago

This time I assure the DPDK is build success, Then when I run "make -j 10" it turns out "collect2: error: ld returned 1 exit status Makefile:1224: recipe for target 'suricata' failed". And the DPDK version is 18.02.2 config.log

vipinpv85 commented 5 years ago

Please check dpdk version used and recommend in readme.

vipinpv85 commented 5 years ago

I checked the DPDKINTEL_LDADD from config.log. Mine and your results are different (excluding the $RTE_SDK path). Have you edited or added something of your own?

share your configure script

vipinpv85 commented 5 years ago

I think you have not read the README properly, if yes you would have done the following

***note: if there are build errors reporting for 'ld not found', please retry after running 'autoconf'

I assume the difference in configure script is due to this.

tolunFdancer commented 5 years ago

I did not edit the configure script. As I told you before,my steps is :

  1. cd DPDK-Suircata_3.0/suricata-3.0
  2. ./configure --enable-dpdkintel
  3. make -j 10 When I run "congifure --enable-dpdkintel", it worked successful and I can sell the follow info: Suricata Configuration: AF_PACKET support: no DPDK_INTEL support: yes PF_RING support: no The error info shows when I run "make -j 10", so I do not think "***note: if there are build errors reporting for 'ld not found', please retry after running 'autoconf'" could fix the error. The error shows in "make" not in "build". configure.txt I change the configure script to confiture.txt, Github do not allow upload the script.
vipinpv85 commented 5 years ago

you have not read the README, so please run autconf after step 1

***note: if there are build errors reporting for 'ld not found', please retry after running 'autoconf'

  1. cd DPDK-Suircata_3.0/suricata-3.0
  2. autoconf
  3. ./configure --enable-dpdkintel
  4. make -j 10

your earlier comment

Thanks! I found out the reason, /DPDK-Suricata_3.0-master/suricata-3.0/configure, there should not be existing an spcae between -L and ${with_libdpdkintel_libraries} at line 17164 . I hope you fixed it.
tolunFdancer commented 5 years ago

Thanks, my earlier comment is for 4.1.1, the 3.0 did not exist the space problem. This time I did not run "make -j 10", I run "make" and it run successfully, and When I run "./src/suricata --list-dpdkintel-ports" it shows the follow info: EAL: Detected 4 lcore(s) EAL: Multi-process socket /var/run/.rte_unix EAL: Probing VFIO support... EAL: PCI device 0000:00:19.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:15a3 net_e1000_em

  --- DPDK Intel Ports ---
     * Overall Ports: 1 

 -- Port: 0
 --- MTU: 1500
 --- MAX RX MTU: 9234 
 --- Driver: net_e1000_em
 --- Index: 0 
 --- Queues RX 1 & TX 1
 --- SRIOV VF: 0 
 --- Offload RX: f TX: f 
 --- CPU NUMA node: 0
 --- Status: Up
 Led for 5 sec.......
 ------------------------ 

So I think this time it worked right finally, what do you think?

vipinpv85 commented 5 years ago

@tolunFdancer I do not know, since you are mixing issues with 3.0 with 4.0. I can not support or help such scenarios. It consumes my time.

If the result is with regard to 3.0, looks like you are have 1G interface in DPDK with 1 RX and TX.

tolunFdancer commented 5 years ago

Thanks! When I run "./src/suricata -c suricata.yaml -s --dpdkintel" with my rule, it turn out the following info : 22/7/2019 -- 14:47:58 - - [ERRCODE: SC_ERR_LOGDIR_CONFIG(116)] - The logging directory "/usr/local/var/log/suricata/" supplied by suricata.yaml (default-log-dir) doesn't exist. Shutting down the engine

Why the default-log-dir did not build, just because I did not run "autoconf"? How I can fix thsi?

vipinpv85 commented 5 years ago

Current reported issue is not regard to build or link. Hence please use a new issue.

Hint: if are familiar with suricata and have used it before. You already know what to do.

If you are new to suricata, please try basic Linux CMD to navigate through the errors

tolunFdancer commented 5 years ago

Thanks a lot, I appreciate your help. Have a good day!

vipinpv85 commented 5 years ago

I will wait for your upcoming update and solution if you found how to fix the current issue. If not let me know if you need help.

tolunFdancer commented 5 years ago

I fixed the log path issue, then I run "./src/suricata -c suricata.yaml -s --dpdkintel" it shows the following info: 22/7/2019 -- 15:49:25 - - DPDK Version: DPDK 18.02.2 22/7/2019 -- 15:49:25 - - ----- Global DPDK-INTEL Config ----- 22/7/2019 -- 15:49:25 - - Number Of Ports : 2 22/7/2019 -- 15:49:25 - - Operation Mode : IPS 22/7/2019 -- 15:49:25 - - Port:0, Map:0 22/7/2019 -- 15:49:25 - - Port:0, Map:0 22/7/2019 -- 15:49:25 - - ------------------------------------ 22/7/2019 -- 15:49:25 - - [ERRCODE: SC_ERR_DPDKINTEL_CONFIG_FAILED(275)] -
PortsDPDK 1 Config-file 2 22/7/2019 -- 15:49:25 - - [ERRCODE: SC_ERR_MISSING_CONFIG_PARAM(118)] - DPDK devp!!!

I could not fix this problem ,I wanna know if you could give me some advices? 3Q!

vipinpv85 commented 5 years ago

open a ticket related to the error, I could not offer help on the ticket failing to link the dpdk libraries

vipinpv85 commented 5 years ago

I been waiting for the new ticket so I can update you what is going wrong for you

tolunFdancer commented 5 years ago

Sorry , I do not understand the meaning of new ticket, so I make a new issue.