cnplab / xennet

Xen optimizations for fast packet I/O
Other
11 stars 7 forks source link

Cannot load xen-netback.ko - Wrong netmap version in xennet #5

Closed gkatsikas closed 9 years ago

gkatsikas commented 9 years ago

I downloaded and installed netmap (with vale) following your guidelines here: http://cnp.neclab.eu/getting-started#installing-a-switch

Then I moved to xennet and managed to compile everything properly but when it comes to load netmap and xen-netback there is an issue. Specifically, it seems that the netmap submodule that you have in xennet is not compatible with the netmap-release above. If I have my netmap module loaded from the step above, I get the following error when trying to load xen-netback:

dmesg | tail -f [ 1277.303719] xen_netback: disagrees about version of symbol netmap_disable_all_rings [ 1277.303721] xen_netback: Unknown symbol netmap_disable_all_rings (err -22) [ 1277.303730] xen_netback: disagrees about version of symbol netmap_detach [ 1277.303733] xen_netback: Unknown symbol netmap_detach (err -22) [ 1277.303764] xen_netback: disagrees about version of symbol netmap_ring_reinit [ 1277.303766] xen_netback: Unknown symbol netmap_ring_reinit (err -22) [ 1277.303786] xen_netback: disagrees about version of symbol nm_txsync_prologue [ 1277.303788] xen_netback: Unknown symbol nm_txsync_prologue (err -22) [ 1277.303830] xen_netback: disagrees about version of symbol netmap_attach [ 1277.303832] xen_netback: Unknown symbol netmap_attach (err -22)

Do you have an idea of what is going wrong?

Thanks in advance, Georgios

jpemartins commented 9 years ago

Hi, xennet uses a specific commit in netmap-release. This is handled when you do git submodule update --init on top-level directory of xennet, so that people have less trouble with it. But the issue above is indeed weird in case you following the instructions on README.md.

Which kernel version are you using and what commit hash you have on netmap-release?

gkatsikas commented 9 years ago

Hi,

Thanks for the reply! I perfectly understand your points. I can run everything properly, besides this. I load ClickOS using OVS and linux bridges without any problem, only xenback is missing to have VALE instead of OVS.

The commit hash of my netmap-release is: 32e06f9d18bf82e40a7c5b6e769c0ca7607913fc (32e06f9 in short). I have built everything on linux-image and headers: 3.13.0-37-generic. I have used Xen sources 4.2, 4.4 and 4.6 with the same results.

Is there a well-tested linux kernel that you highly recommend?

Thanks in advance, Georgios

jpemartins commented 9 years ago

All the versions supported in xennet were tested (at the time 3.13, 3.14 and 3.15 were the ones that I use). Since you might be using just the headers, it might lead to this tricky behaviour. So to make it work you might need to grab a tarball of your 3.13 which is needed to patch the drivers:

git clone https://github.com/cnplab/xennet.git cd xennet git submodule update --init make prepare KSRC=/path/to/source # Need path pointing to source make

The build process builds both netmap and xennet with the same symbols.

Also in the meantime I will align with latest kernels (hopefully up to 4.0) and aligned with netmap-release, now that netmap has IOMMU support which should make ixgbe/igb/e1000 work under Xen.

Btw, Thanks for your time testing it! :+1:

I will also try on my end as it appears to have people with (other) issues with 3.11.

gkatsikas commented 9 years ago

I didn't use only headers. I got a fresh tarball with 3-13.0 sources and followed the steps from README.md. I managed to generate netmap_lin.ko and xen_netback/front.ko modules but I cannot load them. Anyway, I will try again a fresh installation, maybe using 3.14 or 3.15 sources. I hope to have a better luck! Thanks for your time and support!

gkatsikas commented 9 years ago

Hi,

I repeated the process from scratch using: Source: apt-get source linux-image-3.13.0-37-generic Headers: apt-get install linux-headers-3.13.0-37-generic

I successfully compiled netmap_lin and xen_back/front drivers but I still get the same error message when trying to load them.

Could you please point me to the links you used for downloading linux-source and linux-headers?

Thanks in advance and best regards, Georgios

jpemartins commented 9 years ago

I normally dont rely on using different packages source and headers. I get my kernels built from git/tarballs (in kernel.org) and I build and install them. After that I build and install netmap/xennet. May be doing that you could avoid those issues.

It really sounds like you are compiling with two different kernel builds.

Could you paste here the sequence of commands you are running?

gkatsikas commented 9 years ago

This is what I did but I didn't generate the headers after compiling the kernel. I was relying on the generic headers of 3.13.0.37 that are not 100% compatible. Now it works perfectly, thanks a lot! You can close this issue :)

Best regards, Georgios

jpemartins commented 9 years ago

Nice, Glad to hear that!

I will still reopen this issue to let you know after giving support for more recent kernels.

Cheers, Joao

wenhuizhang commented 8 years ago

Hi, I am using "/usr/src/linux-headers-3.16.0-62 " , and got

In file included from /home/wenhui/xennet/netmap/LINUX/../sys/dev/netmap/netmap.c:187:0:
/home/wenhui/xennet/netmap/LINUX/../sys/dev/netmap/netmap_kern.h: In function ‘nm_set_native_flags’:
/home/wenhui/xennet/netmap/LINUX/../sys/dev/netmap/netmap_kern.h:792:2: error: implicit declaration of function ‘SET_ETHTOOL_OPS’ [-Werror=implicit-function-declaration]
  SET_ETHTOOL_OPS(ifp, &((struct netmap_hw_adapter*)na)->nm_eto);
  ^
cc1: some warnings being treated as errors
make[3]: *** [/home/wenhui/xennet/netmap/LINUX/netmap.o] Error 1
make[2]: *** [_module_/home/wenhui/xennet/netmap/LINUX] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.16.0-62-generic'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/home/wenhui/xennet/netmap/LINUX'
make: *** [/home/wenhui/xennet/netmap/LINUX/Module.symvers] Error 2