kohler / click

The Click modular router: fast modular packet processing and analysis
Other
740 stars 321 forks source link

Can not compile Click kernel module with Kernel 4.4.0-87 #401

Closed stevelorenz closed 5 years ago

stevelorenz commented 6 years ago

Hello, currently I need to perform latency measurements for Click kernel module(The user-level builds all work good). I try to compile it in a Vagrant virtual machine with Ubuntu 16.04.

When I run the $./configure --prefix=/usr/local --enable-linuxmodule --with-linux=/usr/src/linux-headers-"$LINUX_VERSION" --with-linux-map=/boot/System.map-"$LINUX_VERSION" , following error is thrown.

/home/vagrant/click/linuxmodule/../elements/linuxmodule/fromhost.cc:143:50: error: macro "alloc_netdev" requires 4 arguments, but only 3 given
     net_device *dev = alloc_netdev(0, name, setup);
                                                  ^
/home/vagrant/click/linuxmodule/../elements/linuxmodule/fromhost.cc: In member function ‘net_device* FromHost::new_device(const char*)’:
/home/vagrant/click/linuxmodule/../elements/linuxmodule/fromhost.cc:143:23: error: ‘alloc_netdev’ was not declared in this scope
     net_device *dev = alloc_netdev(0, name, setup);

I found this issue also in the list but without answers. Currently I have no experience for kernel module development. Can someone give me information about how to compile Click for Kernel 4.X. Thanks so much for your help in advance.

TummanapallyAnuraag commented 5 years ago

Hi, I also face a similar problem for installing kernelmodule However user-level click was easy to install

I am using Ubuntu 18

LINUX_VERSION=`uname -r`

The above command resulted in 4.15.0-39-generic

./configure --prefix=/usr/local --enable-linuxmodule --with-linux=/usr/src/linux-headers-"$LINUX_VERSION" --with-linux-map=/boot/System.map-"$LINUX_VERSION"

Following Error lines are reported by ./configure

=========================================

Your Linux kernel header files cause errors when included by a C++ program.

Click modifies the Linux kernel's header files to make them work with C++, using the program 'linuxmodule/click-linuxtool.pl'. It looks like your kernel header files have features that tool doesn't know how to fix. You can report this error to us on the Click mailing list, or, even better, try to fix the error. See the config.log file for more information on the error.

========================================= Does any one know how to fix this. Thanks in advance.

ppatel826 commented 5 years ago

Facing the Same issue on Ubuntu 16.04 with kernel version 4.4.0-146 Does anyone have a solution?

tbarbette commented 5 years ago

Click Kernel mode has not been updated for such recent kernels. You could update the code to support changes in structures. The error is probably only a renaming. But do you absolutely require Kernel mode ? DPDK or Netmap actually perform better...

ppatel826 commented 5 years ago

I'm evaluating multiple options to deploy a custom NFV solution in a lightweight container. I'll try DPDK and Netmap.

tbarbette commented 5 years ago

DPDK support is more maintained and is probably the best choice for rapid deployment.

stevelorenz commented 5 years ago

Thanks so much for your suggestion. I am currently using DPDK in my new project. Forget to close this issue earlier, sorry 😅