[ovs-dev] [PATCH v2] datapath: Add support for lwtunnel

Pravin Shelar pshelar at nicira.com
Sat Oct 31 11:04:38 UTC 2015

On Fri, Oct 30, 2015 at 1:44 PM, Joe Stringer <joestringer at nicira.com> wrote:
> On 19 October 2015 at 23:01, Pravin B Shelar <pshelar at nicira.com> wrote:
>> Following patch adds support for lwtunnel to OVS datapath.
>> With this change OVS datapath detect lwtunnel support and
>> make use of new APIs if available. On older kernel where the
>> support is not there the backported tunnel modules are used.
>> These backported tunnel devices acts as lwtunnel devices.
>> I tried to keep backported module same as upstream for easier
>> bug-fix backport. Since STT and LISP are not upstream OVS
>> always needs to use respective modules from tunnel compat layer.
>> To make it work on kernel 4.3 I have converted STT and LISP
>> modules to lwtunnel API model.
>> lwtunnel make use of skb-dst to pass tunnel information to the
>> tunnel module. On older kernel this is not possible. So the
>> metadata ref is stored in OVS_CB. Direct call to tunnel transmit
>> function is made by respective tunnel vport modules. Similarly
>> on receive side tunnel recv directly call netdev-vport-receive
>> to pass the skb to OVS.
>> Major backported components include:
>> Geneve, GRE, VXLAN, ip_tunnel, udp-tunnels GRO.
>> Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
> Wow, this is a lot of work! Thanks for contributing this.
> I guess you tested with a RHEL 2.6.32 kernel? Travis reported build
> failures on vanilla v3.4 and v2.6.32. I fixed a few of the issues
> here:
> https://github.com/joestringer/openvswitch/commits/review/lwtunnel
> However, I'm not sure how much additional effort it would be to
> actually get it compiling on v2.6.32; Here's a sample set of errors
> for where this branch gets to:
> https://travis-ci.org/joestringer/openvswitch/jobs/88403997
I have tested the patch with latest stable from these branches, so the
patch works with vanilla I do not think we should support
vanilla 2.6.32, Most of vanilla users should move to latest stable
release anyways. I will send patch to fix travis target kernels. Same
for 3.4, it works with latest stable release of 3.4.

> Missing things reported right now in geneve:
> - No kfree_rcu()
> - inet_sport rename in struct inet_sock
> - dst in struct rtable is hidden inside a union
> - flowi4 definition isn't complete
> - netdev_dbg() undefined
> - No hw_features in net_device
> - Link ops prototypes have changed
> - pernet ops backport isn't working quite right on that kernel

I do not see any of these problems with latest vanilla stable release.

> There's a TODO left in datapath/linux/compat/include/net/ip6_tunnel.h
> about GSO with IPv6 tunnels, I guess that will be part of a subsequent
> patch?
I will do it once we add support for IPv6 tunnel support in OVS.

> There is some #if 0 code in  datapath/linux/compat/ip_gre.c, is it
> unnecessary or not-yet-backported?

It is unnecessary, I will remove it.

Thanks for review.

More information about the dev mailing list