Closed Linerd closed 7 years ago
Just to understand, are you using the patch at "utils/switch-modules/ovs-datapath/0001-datapath-Add-support-for-netmap-VALE.patch" ?
@vmaffione yes, actually it is slightly modified by @micchie to support OVS 2.6.0, but I assume it shouldn't be that different
Hi, Attaching a linux interface to OVS works only if the interface has native netmap support. This means that VALE ports (e.g. interfaces created with vale-ctl -n) and ixgbe,e1000,veth,etc. (with patched drivers) can be attached to an OVS bridge with "ovs-vsctl add-port". This limitation is due to a confilct: both OVS and the emulated (generic) adapter use the same functionality to intercept packets, and so they cannot work together.
The patch for OVS 2.6.1 has been published here https://github.com/luigirizzo/netmap/blob/master/utils/switch-modules/ovs-2.6.1/0001-datapath-netmap-VALE-support.patch .
For the second question: yes, it is not possible to use two VALE switches with OVS on the same host, and it is a limitation of the current patch. This is actually more a problem of OVS, since afaik in the openvswitch kernel module there is no abstraction for the "bridge" object. This means that all the OVS bridges and ports you create share the same "datapath" object in kernelspace. As a consequence, there is no an easy way to tell (in kernel space) what OVS bridge a port is part of. Actually, I was trying to circumvent this problem (see https://github.com/vmaffione/ovs/tree/netmap-2.6.1-multi), but it may be not convenient.
@vmaffione when OVS is built with the new patch, the generated openvswitch.ko file in ovs/datapath/linux/ does not depend on netmap. Is it this expected? The old patch files used to build openvswitch.ko that depends on netmap
@vmaffione the build process says "netmap_attach, netmap_detach, netmap_bdg_ctl undefined", thus the built ovs module does not depend on netmap. When inserted, invalid parameter error is reported.
The patch fo 2.6.1 works fine to me. Are you using 2.4.0 or 2.6.1? Of course openvswitch.ko must depend on netmap.ko
I am using 2.6.1. Both OVS and netmap are the latest. What linux kernel and system are you using?
On Jan 9, 2017, 12:43 PM -0500, Vincenzo Maffione notifications@github.com, wrote:
The patch fo 2.6.1 works fine to me. Are you using 2.4.0 or 2.6.1? Of course openvswitch.ko must depend on netmap.ko — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I'm using linux 4.8.13 on archlinux. But this should not be important. Have you used the --with-netmap switch to point at the netmap sources? Are you sure you have applied the patch to the 2.6.1 tar.gz from the ovs website, or the v2.6.1 tag on the ovs github repo?
I used the —with-netmap option, along with the —with-linux option. I applied it to the v2.6.1 tag on the GitHub repo.
On Jan 9, 2017, 3:30 PM -0500, Vincenzo Maffione notifications@github.com, wrote:
I'm using linux 4.8.13 on archlinux. But this should not be important. Have you used the --with-netmap switch to point at the netmap sources? Are you sure you have applied the patch to the 2.6.1 tar.gz from the ovs website, or the v2.6.1 tag on the ovs github repo? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Have you installed netmap first and then installed openvswitch modules with
´´´´
´´´´
Yours may be a depmod problem. You can also try to run depmod -a manually.
Yes I installed netmap first. The problem occurred before installing openvswitch modules. The built openvswitch.ko modules does not depend on netmap. netmap_attach(), netmap_detach() methods are not found. Could it be that some netmap files are not installed properly on the system?
On Jan 9, 2017, 3:54 PM -0500, Vincenzo Maffione notifications@github.com, wrote:
Have you installed netmap first and then installed openvswitch modules with ´´´´ make modules_install ´´´´ Yours may be a depmod problem. You can also try to run depmod -a manually. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
No. Attach and detach functions are defined in netmap_kern.h, which is not exported for now. So if you get an undefined reference error it means that either your --with-netmap path is wrong or that you are compiling netmap and ovs against two different kernel build infrastructures (you typically wantto.use se /lib/modules/´uname -r´/build for noth)
@vmaffione I tried again, this time I make sure the same kernel build is used, but still can't generate the correct ovs module. The patch @micchie gave me months ago works, but his patch needs some fix for the latest netmap build. (I will email you his patch just for reference, maybe you could find his patch useful).
I think the problem is that you are running the netmap ./configure (and make) from inside the LINUX directory. Try to run them from the root of the netmap repository, I.e. a level up.
Il 10 gen 2017 5:22 AM, "Yikai" notifications@github.com ha scritto:
@vmaffione https://github.com/vmaffione I tried again, this time I make sure the same kernel build is used, but still can't generate the correct ovs module. The patch @micchie https://github.com/micchie gave me months ago works, but his patch needs some fix for the latest netmap build. (I will email you his patch just for reference, maybe you could find his patch useful).
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/luigirizzo/netmap/issues/266#issuecomment-271483002, or mute the thread https://github.com/notifications/unsubscribe-auth/AEsSwWvhQFdtVHWwEJTdiGWNMjscsKPCks5rQweWgaJpZM4LY0EY .
@vmaffione now it works!
I see that this patched version of OVS still can't work with mininet(it is stuck at starting switches stage), but I believe mininet is using veth pairs to connect hosts. Is there anything I can do to make mininet work? I have already loaded the netmap version of veth module.
For sure you need to fetch the latest code to get a bug-fix for veth that just went in. The support for veth has been recently reworked (Dec 22nd 2016), so that it does not suffer anymore from previous limitations (e.g. both ends of a veth pair needed to be in netmap mode), and race conditions (crashes were possible). Now veth in native netmap mode work exactly like netmap pipes.
You can attach veth interfaces to vale switches in general, this works ok. It works ok also in conjuction with OVS patched with netmap, you can use veth interfaces similarly to how you use persistent VALE ports.
I've no idea why mininet does not work, it can simply be that the OVS patch is very experimental and incomplete. One of the problems is that broadcast does not work properly if you create more OVS bridges. A single datapath (in this case a VALE switch) is used to implement all the bridges, so the bridges are not isolated.
@vmaffione
I built the latest netmap and loaded both netmap.ko and veth.ko, and I created a simple mininet topology with the command mn, and the process is stuck at creating the switches, dmesg gives me the following errors. If I don't load veth.ko, the topology can be created, but h1 cannot ping h2.
[12429.730416] (null): netmap queues/slots: TX 1/1024, RX 1/1024
[12429.730637] (null): netmap queues/slots: TX 1/1024, RX 1/1024
[12429.731912] IPv6: ADDRCONF(NETDEV_UP): h1-eth0: link is not ready
[12429.734490] IPv6: ADDRCONF(NETDEV_CHANGE): h1-eth0: link becomes ready
[12429.737168] (null): netmap queues/slots: TX 1/1024, RX 1/1024
[12429.737453] (null): netmap queues/slots: TX 1/1024, RX 1/1024
[12429.740032] IPv6: ADDRCONF(NETDEV_UP): h2-eth0: link is not ready
[12429.743699] IPv6: ADDRCONF(NETDEV_CHANGE): h2-eth0: link becomes ready
[12429.756165] device ovs-system entered promiscuous mode
[12429.756900] BUG: unable to handle kernel NULL pointer dereference at 000000000000001e
[12429.756914] IP: [
Yes, the OVS patch is experimental, you need to debug it.
Some pieces of advice:
&& vale_prefix(ovs_dp_name(parms->dp))
in datapath/vport.c::ovs_vport_add() to see if the crash goes away
D("before");
and D("after");
), to check that the crash happens in that block.
My patched OVS works great with ports created with vale-ctl, but when I tried to attach other ports to the OVS bridge(the physical interfaces or the interfaces within VM), it failed. I got the "failed to add port XX, invalid argument" error.
I am trying to figure out if this is my problem or the inner limitation of the current patch. When I switch back to the original OVS I can attach whatever interface I want.
PS. just try to make sure I understand correctly, it is impossible to run OVS on two vale switches on the same host right? Coz every bridge I create will automatically be attached to vale0.