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

Joe Stringer joestringer at nicira.com
Fri Oct 30 20:44:47 UTC 2015

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

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:

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

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

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

More information about the dev mailing list