ansyun / dpdk-ans

ANS(Accelerated Network Stack) on DPDK, DPDK native TCP/IP stack.
https://ansyun.com
BSD 3-Clause "New" or "Revised" License
1.16k stars 324 forks source link

Compile error with latest DPDK 18.05 #80

Closed sburn closed 6 years ago

sburn commented 6 years ago

root@debian9:/home/sburn/setup-4/dpdk-ans/ans# make CC ans_param.o CC ans_main.o /home/sburn/setup-4/dpdk-ans/ans/ans_main.c: In function ‘ans_main_loop’: /home/sburn/setup-4/dpdk-ans/ans/ans_main.c:763:5: warning: ‘rte_eth_dev_count’ is deprecated [-Wdeprecated-declarations] nb_ports = rte_eth_dev_count(); ^~~~ In file included from /home/sburn/setup-4/dpdk-ans/ans/ans_main.c:68:0: /home/sburn/setup-4/dpdk-18.05/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:1439:10: note: declared here uint16_t rte_eth_dev_count(void); ^~~~~ /home/sburn/setup-4/dpdk-ans/ans/ans_main.c: In function ‘main’: /home/sburn/setup-4/dpdk-ans/ans/ans_main.c:909:5: warning: ‘rte_eth_dev_count’ is deprecated [-Wdeprecated-declarations] nb_ports = rte_eth_dev_count(); ^~~~ In file included from /home/sburn/setup-4/dpdk-ans/ans/ans_main.c:68:0: /home/sburn/setup-4/dpdk-18.05/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:1439:10: note: declared here uint16_t rte_eth_dev_count(void); ^~~~~ CC ans_kni.o /home/sburn/setup-4/dpdk-ans/ans/ans_kni.c: In function ‘ans_kni_change_mtu’: /home/sburn/setup-4/dpdk-ans/ans/ans_kni.c:147:5: warning: ‘rte_eth_dev_count’ is deprecated [-Wdeprecated-declarations] if (port_id >= rte_eth_dev_count()) ^~ In file included from /home/sburn/setup-4/dpdk-ans/ans/ans_kni.c:69:0: /home/sburn/setup-4/dpdk-18.05/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:1439:10: note: declared here uint16_t rte_eth_dev_count(void); ^~~~~ /home/sburn/setup-4/dpdk-ans/ans/ans_kni.c: In function ‘ans_kni_alloc’: /home/sburn/setup-4/dpdk-ans/ans/ans_kni.c:245:25: error: ‘struct rte_eth_dev_info’ has no member named ‘pci_dev’ conf.addr = dev_info.pci_dev->addr; ^ /home/sburn/setup-4/dpdk-ans/ans/ans_kni.c:246:23: error: ‘struct rte_eth_dev_info’ has no member named ‘pci_dev’ conf.id = dev_info.pci_dev->id; ^ /home/sburn/setup-4/dpdk-18.05/mk/internal/rte.compile-pre.mk:114: recipe for target 'ans_kni.o' failed make[1]: [ans_kni.o] Error 1 /home/sburn/setup-4/dpdk-18.05/mk/rte.extapp.mk:14: recipe for target 'all' failed make: [all] Error 2

bluenet13 commented 6 years ago

You shall use dpdk-17.11.3 which ans used.

sburn commented 6 years ago

Already compiled and running ANS with latest stable DPDK-18.02.2

bluenet13 commented 6 years ago

ans is compiled with dpdk-17.11.3. Don't know if any other issue when you use dpdk-18.2.2.

sburn commented 6 years ago

Can't find how to set MTU 1460 instead of default 1500 for veth0 interface inside ANS. Help me, please.

bluenet13 commented 6 years ago

You can use ans_iface_set_mtu() to set mtu in ans_main.c after create veth0 interface. Refer to the API: https://github.com/ansyun/dpdk-ans/blob/master/librte_ans/include/ans_ip_intf.h

sburn commented 6 years ago

ans_iface_add(portid, kni_id, ifname, &eth_addr); ans_iface_set_mtu(ifname, 1460);

Got it, thanks!

harminds commented 5 years ago

@sburn I am using dpdk 18.05 and am getting the same error. Can you please elaborate how to fix this issue?

error: ‘rte_eth_dev_count’ is deprecated (declared at /root/dpdk/build/include/rte_ethdev.h:1439) [-Werror=de precated-declarations] if (port >= rte_eth_dev_count())