zigzag
zigzag

Reputation: 181

insmod: error when inserting DPDK igb_uio.ko module

I use centos 7.3. When I run insmod igb_uio.ko, I get this error in /var/logs/message:

This happens after I did some patches to OS and kernel. After patch, the kernel version is: 3.10.0.957.21.3.e17.x86_64

Before patch, it works well. The patch is for some TCP critical vulnerability. I prefer to run the patch.

I use DPDK 17.08.1, I also tried 18.11.2. Both get same error.

I try to rebuild from source, after patch. The rebuild get errors: (before patch, build is successfully.):

Upvotes: 5

Views: 11723

Answers (3)

iamcc
iamcc

Reputation: 11

As I know,

This error derives from mismatch or deficiency of kernel-devel packets with the current kernel.

If the current kernel version is not consistent with kernel-devel, /lib/modules/$(uname -r)/ could not generated properly. In my case, the kernel that I working on is 4.13.12-1.el7.elrepo.x86_64, but kernel-devel packets belong to 3.10.0-1160.31.1.el7.x86_64 .

My solution is installing kernel-devel that consistent with the current kernel by

yum update
yum install "kernel-devel-uname-r == $(uname -r)"

If packets could not found, manual installation using rpm may be required. In my case, I wget kernel-ml-devel-4.14.13-1.el7.elrepo.x86_64.rpm packet and remove old kernel-devel by

yum remove kernel-headers-3.10.0-1160.31.1.el7.x86_64
yum remove kernel-devel-3.10.0-1160.31.1.el7.x86_64

and I install correct devel packets by

sudo rpm -i kernel-ml-devel-4.13.12-1.el7.elrepo.x86_64.rpm

Finally, dpdk compiles with no error in my case.

Upvotes: 1

hero24
hero24

Reputation: 139

You need to build your igb_uio module against the right kernel headers. If you patched/updated the kernel then you should do the same for the headers. If your headers are patched but you still get the errors then try compiling it like this:

RTE_KERNELDIR=/path/to/headers make -j

Upvotes: 1

aburakov
aburakov

Reputation: 81

To insert igb_uio module, you have to insert the uio module first. Then, inserting igb_uio will work correctly.

In any case, i would suggest using VFIO rather than igb_uio unless you specifically require igb_uio.

Also, if you're building custom kernels, you should add the relevant header/module paths, to ensure that building modules against this custom kernel works. (meaning, when the compiler does /usr/src/linux-headers-$(uname -r)/, the path must exist)

Upvotes: 2

Related Questions