[ovs-dev] [PATCH V3 18/40] compat: Add ipv6 GRE and IPV6 Tunneling

William Tu u9012063 at gmail.com
Mon May 21 22:41:29 UTC 2018


On Fri, May 18, 2018 at 5:49 PM, Greg Rose <gvrose8192 at gmail.com> wrote:
> This patch backports upstream ipv6 GRE and tunneling into the OVS
> OOT (Out of Tree) datapath drivers.  The primary reason for this
> is to support the ERSPAN feature.
>
> Because there is no previous history of ipv6 GRE and tunneling it is
> not possible to exactly reproduce the history of all the files in
> the patch.  The two newly added files - ip6_gre.c and ip6_tunnel.c -
> are cut from whole cloth out of the upstream Linux 4.15 kernel and
> then modified as necessary with compatibility layer fixups.
> These two files already included parts of several other upstream
> commits that also touched other upstream files.  As such, this
> patch may incorporate parts or all of the following commits:
>
> d350a82 net: erspan: create erspan metadata uapi header
> c69de58 net: erspan: use bitfield instead of mask and offset
> b423d13 net: erspan: fix use-after-free
> 214bb1c net: erspan: remove md NULL check
> afb4c97 ip6_gre: fix potential memory leak in ip6erspan_rcv
> 50670b6 ip_gre: fix potential memory leak in erspan_rcv
> a734321 ip6_gre: fix error path when ip6erspan_rcv failed
> dd8d5b8 ip_gre: fix error path when erspan_rcv failed
> 293a199 ip6_gre: fix a pontential issue in ip6erspan_rcv
> d91e8db5 net: erspan: reload pointer after pskb_may_pull
> ae3e133 net: erspan: fix wrong return value
> c05fad5 ip_gre: fix wrong return value of erspan_rcv
> 94d7d8f ip6_gre: add erspan v2 support
> f551c91 net: erspan: introduce erspan v2 for ip_gre
> 1d7e2ed net: erspan: refactor existing erspan code
> ef7baf5 ip6_gre: add ip6 erspan collect_md mode
> 5a963eb ip6_gre: Add ERSPAN native tunnel support
> ceaa001 openvswitch: Add erspan tunnel support.
> f192970 ip_gre: check packet length and mtu correctly in erspan tx
> c84bed4 ip_gre: erspan device should keep dst
> c122fda ip_gre: set tunnel hlen properly in erspan_tunnel_init
> 5513d08 ip_gre: check packet length and mtu correctly in erspan_xmit
> 935a974 ip_gre: get key from session_id correctly in erspan_rcv
> 1a66a83 gre: add collect_md mode to ERSPAN tunnel
> 84e54fe gre: introduce native tunnel support for ERSPAN
>
> In cases where the listed commits also touched other source code
> files then the patches are also listed separately within this
> patch series.
>
> Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
> ---

Thanks for backporting such a large set of erspan patches.
I don't see any better way but just pull the entire code in.
I reviewed the erspan and gre code and looks good.

Acked-by: William Tu <u9012063 at gmail.com>

>  datapath/linux/Modules.mk                         |    2 +
>  datapath/linux/compat/include/linux/compiler.h    |    4 +
>  datapath/linux/compat/include/linux/if_ether.h    |    4 +
>  datapath/linux/compat/include/linux/netdevice.h   |    7 +
>  datapath/linux/compat/include/linux/openvswitch.h |    3 +
>  datapath/linux/compat/include/linux/skbuff.h      |   11 +
>  datapath/linux/compat/include/net/erspan.h        |  254 +-
>  datapath/linux/compat/include/net/gre.h           |   25 +
>  datapath/linux/compat/include/net/ip6_tunnel.h    |  206 +-
>  datapath/linux/compat/include/net/ipv6.h          |   29 +
>  datapath/linux/compat/ip6_gre.c                   | 2578 +++++++++++++++++++++
>  datapath/linux/compat/ip6_tunnel.c                | 2199 ++++++++++++++++++

nit: as a bonus, we also add the ip-in-ip tunnel code into ovs.
Although userspace OVS doesn't support it, this makes future
support for ip-in-ip tunneling easier.

>  datapath/linux/compat/ip_gre.c                    |    1 +
>  datapath/vport.c                                  |   12 +
>  lib/dpif-netlink-rtnl.c                           |   12 +
>  lib/dpif-netlink.c                                |    5 +
>  ofproto/ofproto-dpif-xlate.c                      |    3 +
>  17 files changed, 5321 insertions(+), 34 deletions(-)
>  create mode 100644 datapath/linux/compat/ip6_gre.c
>  create mode 100644 datapath/linux/compat/ip6_tunnel.c
>

<snip>


More information about the dev mailing list