珠海网站建设哪个好薇,东莞房价排名,如何k掉别人的网站,嘉祥网站建设由于 Ubuntu22.04 内核版本和gcc版本比较高#xff0c;在编译dpdk时会报错。 我使用的编译命令是#xff1a;
make install Tx86_64-native-linuxapp-gcc主要有以下几个错误#xff1a;
1.error: this statement may fall through Build kernel/linux/igb_uioCC [M] /roo…由于 Ubuntu22.04 内核版本和gcc版本比较高在编译dpdk时会报错。 我使用的编译命令是
make install Tx86_64-native-linuxapp-gcc主要有以下几个错误
1.error: this statement may fall through Build kernel/linux/igb_uioCC [M] /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.o
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c: In function ‘igbuio_pci_enable_interrupts’:
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:230:20: error: this statement may fall through [-Werrorimplicit-fallthrough]230 | if (pci_alloc_irq_vectors(udev-pdev, 1, 1, PCI_IRQ_MSIX) 1) {| ^
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:240:9: note: here240 | case RTE_INTR_MODE_MSI:| ^~~~
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:250:20: error: this statement may fall through [-Werrorimplicit-fallthrough]250 | if (pci_alloc_irq_vectors(udev-pdev, 1, 1, PCI_IRQ_MSI) 1) {| ^
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:259:9: note: here259 | case RTE_INTR_MODE_LEGACY:| ^~~~
In file included from ./include/linux/device.h:15,from /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:8:
./include/linux/dev_printk.h:148:31: error: this statement may fall through [-Werrorimplicit-fallthrough]148 | dev_printk_index_wrap(_dev_notice, KERN_NOTICE, dev, dev_fmt(fmt), ##__VA_ARGS__)| ^
./include/linux/dev_printk.h:110:17: note: in definition of macro ‘dev_printk_index_wrap’110 | _p_func(dev, fmt, ##__VA_ARGS__); \| ^~~~~~~
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:267:17: note: in expansion of macro ‘dev_notice’267 | dev_notice(udev-pdev-dev, PCI INTX mask not supported\n);| ^~~~~~~~~~
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.c:269:9: note: here269 | case RTE_INTR_MODE_NONE:| ^~~~
cc1: all warnings being treated as errors解决办法
修改 x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/Makefile 文件去掉“MODULE_CFLAGS -Winline -Wall -Werror” -行的 -Werror 编译选项。
2. error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type Build kernel/linux/kniCC [M] /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.o
In file included from /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c:22:
/root/dpdk-19.11/kernel/linux/kni/kni_dev.h: In function ‘iova_to_phys’:
/root/dpdk-19.11/kernel/linux/kni/kni_dev.h:104:37: error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type [-Werrorincompatible-pointer-types]104 | ret get_user_pages_remote(tsk, tsk-mm, iova, 1,| ^~~| || struct task_struct *
In file included from ./arch/x86/include/asm/cacheflush.h:5,from ./include/linux/cacheflush.h:5,from ./include/linux/highmem.h:8,from ./include/linux/bvec.h:10,from ./include/linux/skbuff.h:17,from ./include/net/net_namespace.h:39,from ./include/linux/netdevice.h:37,from /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c:9:
./include/linux/mm.h:1943:46: note: expected ‘struct mm_struct *’ but argument is of type ‘struct task_struct *’1943 | long get_user_pages_remote(struct mm_struct *mm,| ~~~~~~~~~~~~~~~~~~^~解决办法 修改 kernel/linux/kni/kni_dev.h 文件104行改成
#if LINUX_VERSION_CODE KERNEL_VERSION(5, 9, 0)ret get_user_pages_remote(tsk-mm, iova, 1,FOLL_TOUCH, page, NULL, NULL);
#elseret get_user_pages_remote(tsk, tsk-mm, iova, 1,FOLL_TOUCH, page, NULL, NULL);
#endif /* 5.9.0 */error: implicit declaration of function ‘random_ether_addr’ Build kernel/linux/kniCC [M] /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.o
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c: In function ‘kni_ioctl_create’:
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c:406:17: error: implicit declaration of function ‘random_ether_addr’ [-Werrorimplicit-function-declaration]406 | random_ether_addr(net_dev-dev_addr);| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors解决办法 修改 x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c 文件 406行 将 random_ether_addr 函数修改为 eth_random_addr。
error: initialization of ‘void (*)(struct net_device , unsigned int)’ from incompatible pointer type ‘void ()(struct net_device *) Build kernel/linux/kniCC [M] /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.oCC [M] /root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_net.o
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_net.c:786:27: error: initialization of ‘void (*)(struct net_device *, unsigned int)’ from incompatible pointer type ‘void (*)(struct net_device *)’ [-Werrorincompatible-pointer-types]786 | .ndo_tx_timeout kni_net_tx_timeout,| ^~~~~~~~~~~~~~~~~~
/root/dpdk-19.11/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_net.c:786:27: note: (near initialization for ‘kni_net_netdev_ops.ndo_tx_timeout’)
cc1: all warnings being treated as errors解决办法
修改 x86_64-native-linuxapp-gcc/build/kernel/linux/kni/Makefile 文件MODULE_CFLAGS -Wall -Werror 这一行追加 -Wno-errorincompatible-pointer-types 编译选项