Ubuntu 22.04 编译 DPDK 19.11 igb_uio 和 kni 报错解决办法
由于 Ubuntu22.04 内核版本和gcc版本比较高,在编译dpdk时会报错。
我使用的编译命令是:
make install T=x86_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 [-Werror=implicit-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 [-Werror=implicit-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 [-Werror=implicit-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 [-Werror=incompatible-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’ [-Werror=implicit-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 *)’ [-Werror=incompatible-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-error=incompatible-pointer-types 编译选项
相关文章:
Ubuntu 22.04 编译 DPDK 19.11 igb_uio 和 kni 报错解决办法
由于 Ubuntu22.04 内核版本和gcc版本比较高,在编译dpdk时会报错。 我使用的编译命令是: make install Tx86_64-native-linuxapp-gcc主要有以下几个错误: 1.error: this statement may fall through Build kernel/linux/igb_uioCC [M] /roo…...
Android Studio.exe 下载 2023 最新更新,网盘下载
方便大家下载, 放到了网盘上,自己也保留一份。(最前面是最新版本的,慎用, 会有bug什么的) 个人使用4.2版本的,感觉够用稳定,其他版本有莫名奇妙的bug,让人头大࿰…...
element的el-select给下拉框添加背景
第一步 :popper-append-to-body"false" <el-selectv-model"value"placeholder"请选择":popper-append-to-body"false"><el-optionv-for"item in options":key"item.value":label"item.label&quo…...
正确理解党籍和党龄;入党和转正时间
总的来说党籍、党龄、入党时间、转正时间在性质和时间阶段上均有所区别。 党籍:是指党员资格。经支部党员大会讨论,被批准为预备党员之日起,就有了党籍。若被取消预备党员资格、劝退除名、自行脱党、开除党籍的,就失去了党籍。 …...
C语言基础:printf 函数介绍;以及常用四种常用的数据类型
printf 函数介绍 #include <stdio.h> int main() { /* * %c:字符 ; %d:带符号整数; %f: 浮点数; %s: 一串字符; */ int age21; printf(“hello %s,you are %d years old\n”,“Bob”,age); int i 10; double f96.20; printf(“student number%3d,score%f\n”…...
【LeetCode-中等题】209. 长度最小的子数组
文章目录 题目方法一:滑动窗口:方法二: 题目 方法一:滑动窗口: 参考图解动画:长度最小的子数组 class Solution { //方法一:滑动窗口public int minSubArrayLen(int target, int[] nums) {int n nums.l…...
比较聚合模型实战文本匹配
引言 本文我们采用比较聚合模型来实现文本匹配任务。 数据准备 数据准备包括 构建词表(Vocabulary)构建数据集(Dataset) 本次用的是LCQMC通用领域问题匹配数据集,它已经分好了训练、验证和测试集。 我们通过pandas来加载一下。 import pandas as pdtrain_df …...
LA@二次型@标准化相关原理和方法
文章目录 标准化方法正交变换法🎈求矩阵的特征值求各特征值对应的线性无关特征向量组正交化各个向量组 配方法步骤例例 初等变换法原理总结初等变换法的步骤例 标准化方法 正交变换法🎈 二次型可标准化定理的证明过程给出使用二次型标准化的步骤 该方法…...
Git与IDEA: 解决`dev`分支切换问题及其背后原因 为何在IDEA中无法切换到`dev`分支?全面解析!
🌷🍁 博主猫头虎(🐅🐾)带您 Go to New World✨🍁 🦄 博客首页——🐅🐾猫头虎的博客🎐 🐳 《面试题大全专栏》 🦕 文章图文…...
什么是JavaScript中的严格模式(strict mode)?应用场景是什么?
聚沙成塔每天进步一点点 ⭐ 专栏简介⭐ 严格模式(Strict Mode):⭐ 使用场景⭐ 写在最后 ⭐ 专栏简介 前端入门之旅:探索Web开发的奇妙世界 记得点击上方或者右侧链接订阅本专栏哦 几何带你启航前端之旅 欢迎来到前端入门之旅&…...
红外特征吸收峰特征总结(主要基团的红外特征吸收峰)
特此记录 anlog 2023年9月11日...
ChatGPT AIGC 完成关联分析散点图的应用
关联分析是数据分析中非常重要的一种技术手段,它能够帮助我们在大量数据中发现变量之间的关系和相互影响。在数据分析领域,关联分析被广泛应用于市场营销、销售预测、客户行为分析等领域。 关联分析的主要功能是通过挖掘数据中的关联规则,来发现数据集中事物之间的关联性。…...
CentOS7.6上实现Spring Boot(JAR包)开机自启
前言 Linux自启(或开机自启)指的是在Linux系统启动时自动运行特定的程序或脚本。当计算机启动时,操作系统会按照一定的顺序加载系统服务和配置,其中包括自动启动一些应用程序或服务。这些应用程序或服务会在系统启动后自动运行&a…...
Java开发之框架(spring、springmvc、springboot、mybatis)【面试篇 完结版】
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、框架知识分布二、Spring1. spring-单例bean① 问题引入② 单例bean是线程安全的吗③ 问题总结④ 实战面试 2. spring-AOP① 问题引入② AOP记录操作日志③ …...
QT人脸识别知识
机器学习的作用:根据提供的图片模型通过算法生成数据模型,从而在其它图片中查找相关的目 标。 级联分类器:是用来人脸识别。 在判断之前,我们要先进行学习,生成人脸的模型以便后续识别使用。 人脸识别器:…...
熟悉Redis6
NoSQL数据库简介 技术发展 技术的分类 1、解决功能性的问题:Java、Jsp、RDBMS、Tomcat、HTML、Linux、JDBC、SVN 2、解决扩展性的问题:Struts、Spring、SpringMVC、Hibernate、Mybatis 3、解决性能的问题:NoSQL、Java线程、Hadoop、Nginx…...
ip地址会随网络变化而变化吗
随着科技的飞速发展,互联网已深入我们生活的方方面面。在这庞大的网络世界中,IP地址作为网络通信的基础元素,引起了广泛关注。网络变化与IP地址之间存在着密切的关系。那么,IP地址是否会随着网络变化而变化呢?虎观代理…...
QT连接服务器通信,客户端以及服务器端
服务器端 .h文件 #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QTcpServer> //服务器头文件 #include <QTcpSocket> //客户端头文件 #include <QList> //链表头文件,用来存放客户端容器 #include <QDebug> #i…...
Vuex仓库的创建
vuex 的使用 - 创建仓库 文章目录 vuex 的使用 - 创建仓库1.安装 vuex2.新建 store/index.js 专门存放 vuex3.创建仓库 store/index.js4 在 main.js 中导入挂载到 Vue 实例上5.测试打印Vuex 1.安装 vuex 安装vuex与vue-router类似,vuex是一个独立存在的插件&#x…...
C++中的红黑树
红黑树 搜索二叉树搜索二叉树的模拟实现平衡搜索二叉树(AVL Tree)平衡搜索二叉树的模拟实现红黑树(Red Black Tree)红黑树的模拟实现 红黑树的应用(Map 和 Set)Map和Set的封装 搜索二叉树 搜索二叉树的概念:二叉搜索树又称二叉排序树,它或者是一棵空树&…...
基于算法竞赛的c++编程(28)结构体的进阶应用
结构体的嵌套与复杂数据组织 在C中,结构体可以嵌套使用,形成更复杂的数据结构。例如,可以通过嵌套结构体描述多层级数据关系: struct Address {string city;string street;int zipCode; };struct Employee {string name;int id;…...
HTML 语义化
目录 HTML 语义化HTML5 新特性HTML 语义化的好处语义化标签的使用场景最佳实践 HTML 语义化 HTML5 新特性 标准答案: 语义化标签: <header>:页头<nav>:导航<main>:主要内容<article>&#x…...
基于Flask实现的医疗保险欺诈识别监测模型
基于Flask实现的医疗保险欺诈识别监测模型 项目截图 项目简介 社会医疗保险是国家通过立法形式强制实施,由雇主和个人按一定比例缴纳保险费,建立社会医疗保险基金,支付雇员医疗费用的一种医疗保险制度, 它是促进社会文明和进步的…...
《用户共鸣指数(E)驱动品牌大模型种草:如何抢占大模型搜索结果情感高地》
在注意力分散、内容高度同质化的时代,情感连接已成为品牌破圈的关键通道。我们在服务大量品牌客户的过程中发现,消费者对内容的“有感”程度,正日益成为影响品牌传播效率与转化率的核心变量。在生成式AI驱动的内容生成与推荐环境中࿰…...
在四层代理中还原真实客户端ngx_stream_realip_module
一、模块原理与价值 PROXY Protocol 回溯 第三方负载均衡(如 HAProxy、AWS NLB、阿里 SLB)发起上游连接时,将真实客户端 IP/Port 写入 PROXY Protocol v1/v2 头。Stream 层接收到头部后,ngx_stream_realip_module 从中提取原始信息…...
【算法训练营Day07】字符串part1
文章目录 反转字符串反转字符串II替换数字 反转字符串 题目链接:344. 反转字符串 双指针法,两个指针的元素直接调转即可 class Solution {public void reverseString(char[] s) {int head 0;int end s.length - 1;while(head < end) {char temp …...
Python爬虫(二):爬虫完整流程
爬虫完整流程详解(7大核心步骤实战技巧) 一、爬虫完整工作流程 以下是爬虫开发的完整流程,我将结合具体技术点和实战经验展开说明: 1. 目标分析与前期准备 网站技术分析: 使用浏览器开发者工具(F12&…...
Mac软件卸载指南,简单易懂!
刚和Adobe分手,它却总在Library里给你写"回忆录"?卸载的Final Cut Pro像电子幽灵般阴魂不散?总是会有残留文件,别慌!这份Mac软件卸载指南,将用最硬核的方式教你"数字分手术"࿰…...
3403. 从盒子中找出字典序最大的字符串 I
3403. 从盒子中找出字典序最大的字符串 I 题目链接:3403. 从盒子中找出字典序最大的字符串 I 代码如下: class Solution { public:string answerString(string word, int numFriends) {if (numFriends 1) {return word;}string res;for (int i 0;i &…...
关键领域软件测试的突围之路:如何破解安全与效率的平衡难题
在数字化浪潮席卷全球的今天,软件系统已成为国家关键领域的核心战斗力。不同于普通商业软件,这些承载着国家安全使命的软件系统面临着前所未有的质量挑战——如何在确保绝对安全的前提下,实现高效测试与快速迭代?这一命题正考验着…...
