当前位置:网站首页>Eal:Error reading from file descriptor 33: Input/output error
Eal:Error reading from file descriptor 33: Input/output error
2022-04-21 07:26:00 【longyu_ wlz】
Problem description
VMWARE In the virtual machine ,82545EM Virtual network card binding igb_uio after , function dpdk Program ,dpdk The program always has the following alarm information :
Eal:Error reading from file descriptor 33: Input/output error
The use of dpdk Version is 16.04, The procedure is l2fwd.
Problem analysis
1. dpdk Internal code
Code related to error reporting :
bytes_read = read(events[n].data.fd, &buf, bytes_read);
if (bytes_read < 0) {
if (errno == EINTR || errno == EWOULDBLOCK)
continue;
RTE_LOG(ERR, EAL, "Error reading from file "
"descriptor %d: %s\n",
events[n].data.fd,
strerror(errno));
strerror The result of printing is Input/output error, Inquire about Standard error value table , The relevant return values are defined as follows :
#define EIO 5 /* I/O error */
Show that the problem is from uio File reading returned EIO Wrong value , So here comes the question EIO Where does this return value come from ?
2. uio The code in the module
uio In the module uio File registration read The code of the callback function is as follows :
static ssize_t uio_read(struct file *filep, char __user *buf,
size_t count, loff_t *ppos)
{
struct uio_listener *listener = filep->private_data;
struct uio_device *idev = listener->dev;
DECLARE_WAITQUEUE(wait, current);
ssize_t retval;
s32 event_count;
if (!idev->info->irq)
return -EIO;
In the above code uio_read It's reading /dev/uioX File is the function finally called in the kernel . As can be seen from the above function logic , When idev->info->irq The value of is 0 Will return to -EIO error .
that idev->info->irq Where was it initialized ?
Research confirms that it is in igb_uio.c Is initialized in .
3. igb_uio.c In the initialization uio_info In structure irq Location of field
The relevant code is as follows :
switch (igbuio_intr_mode_preferred) {
case RTE_INTR_MODE_MSIX:
/* Only 1 msi-x vector needed */
msix_entry.entry = 0;
if (pci_enable_msix(dev, &msix_entry, 1) == 0) {
dev_dbg(&dev->dev, "using MSI-X");
udev->info.irq = msix_entry.vector;
udev->mode = RTE_INTR_MODE_MSIX;
break;
}
/* fall back to INTX */
case RTE_INTR_MODE_LEGACY:
if (pci_intx_mask_supported(dev)) {
dev_dbg(&dev->dev, "using INTX");
udev->info.irq_flags = IRQF_SHARED;
udev->info.irq = dev->irq;
udev->mode = RTE_INTR_MODE_LEGACY;
break;
}
dev_notice(&dev->dev, "PCI INTX mask not supported\n");
/* fall back to no IRQ */
case RTE_INTR_MODE_NONE:
udev->mode = RTE_INTR_MODE_NONE;
udev->info.irq = 0;
break;
default:
dev_err(&dev->dev, "invalid IRQ mode %u",
igbuio_intr_mode_preferred);
err = -EINVAL;
goto fail_release_iomem;
}
The above process is based on igb_uio Match the interrupt mode set when the module is loaded , The default value is RTE_INTR_MODE_MSIX, because VMWARE In the environment ,82545EM Network card does not support msic And intx interrupt , The process goes to RTE_INTR_MODE_NONE case in ,irq The value of is set to 0, This leads to dpdk adopt read Read uio There are always errors in the file .
resolvent
Even though VMWARE In the environment 82545EM Virtual network card does not support msix、intx interrupt , however dpdk The program still works , To some extent, it indicates that the function of interrupt part is not used .
At the same time, analyze the code to determine that only lsc interrupt , And we're not right about 82545EM Network card enable lsc interrupt .
Based on the fact that , modify igb_uio Code , It is judged that the network card model is 82545EM execute RTE_INTR_MODE_LEGACY In the process .
The test confirmed that the modified problem was solved .
Another alternative modification is in dpdk pmd Drive for 82545EM The network card does not register to listen uio Interruptions .
The specific modification method is as follows :
stay eth_em_dev_init Judge the network card model , If 82545EM, The interface pci_dev in intr_handle Of fd Field set to -1.
版权声明
本文为[longyu_ wlz]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210618507581.html
边栏推荐
猜你喜欢

《21天实战caffe》1-7天学习笔记一

从 systemd-udevd 运行 log 中研究其自动加载内核模块的过程

UCOSIII移植到UCOSII—任务挂起/恢复/钩子/(保姆级教程)

Study the process of automatically loading kernel modules from SYSTEMd udevd running log

Fundamentals of graphics anti aliasing

图形学基础|PBR回顾

WordPress address siteurl error, unable to log in solution

Fundamentals of graphics | PBR review

如何使用u深度启动u盘清除系统登录密码

C语言版:二叉树叶子结点和非叶子结点求法
随机推荐
顺序表的建立和增删改查
view-source 解析
使用 mtrace 追踪内存泄露问题
Eal:Error reading from file descriptor 33: Input/output error
彩虹(状压dp)
虚幻引擎之多线程渲染机制
推荐系统笔记(杂)
虚幻引擎之使用LoadClass加载蓝图类
从 systemd-udevd 运行 log 中研究其自动加载内核模块的过程
获取进程最后一次执行的 cpu 核的方法及原理
Substring Inversion (Easy Version)
Shader tool for 3d-max (stroke)
图形学基础|泛光(Bloom)
读书笔记-思维的精进
Data heterogeneity scheme
The difference between on and where followed by conditions in the left join association table
Remember a MySQL slow SQL optimization
Micro Service -- service splitting strategy and principle
dpdk程序启动顺序引发的血案
如何使用Keil5开发MSP430及Tiva系列开发板