Skip to contentSkip to conversation

openvswitch: Add erspan tunnel support.

PATCH Superseded William Tu 2 participants 3 messages Oct 4, 2017

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

William Tu

author
#0 lore raw

PATCH 1/1 openvswitch: Add erspan tunnel support.

Add type II erspan vport implementation. Since erspan protocol is on top of the GRE header, the implementation is extended from the existing gre implementation.

Cc Pravin B Shelar <[email protected]>
---
 include/net/gre.h                |  2 ++
 include/uapi/linux/openvswitch.h |  2 ++
 net/ipv4/ip_gre.c                | 45 ++++++++++++++++++++++++++
 net/openvswitch/flow_netlink.c   | 55 +++++++++++++++++++++++++++++++-
 net/openvswitch/vport-gre.c      | 68 ++++++++++++++++++++++++++++++++++++++--
 5 files changed, 169 insertions(+), 3 deletions(-)
include/net/gre.h +2 -0
index d25d836c129b..6aa213a5502b 100644
@@ -33,6 +33,8 @@ int gre_del_protocol(const struct gre_protocol *proto, u8 version);
 
 struct net_device *gretap_fb_dev_create(struct net *net, const char *name,
 				       u8 name_assign_type);
+struct net_device *erspan_fb_dev_create(struct net *net, const char *name,
+					u8 name_assign_type);
 int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
 		     bool *csum_err, __be16 proto, int nhs);
 
include/uapi/linux/openvswitch.h +2 -0
index 156ee4cab82e..2ebe0013ecfb 100644
@@ -213,6 +213,7 @@ enum ovs_vport_type {
 	OVS_VPORT_TYPE_GRE,      /* GRE tunnel. */
 	OVS_VPORT_TYPE_VXLAN,	 /* VXLAN tunnel. */
 	OVS_VPORT_TYPE_GENEVE,	 /* Geneve tunnel. */
+	OVS_VPORT_TYPE_ERSPAN,   /* ERSPAN tunnel. */
 	__OVS_VPORT_TYPE_MAX
 };
 
@@ -359,6 +360,7 @@ enum ovs_tunnel_key_attr {
 	OVS_TUNNEL_KEY_ATTR_IPV6_SRC,		/* struct in6_addr src IPv6 address. */
 	OVS_TUNNEL_KEY_ATTR_IPV6_DST,		/* struct in6_addr dst IPv6 address. */
 	OVS_TUNNEL_KEY_ATTR_PAD,
+	OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,	/* be32 ERSPAN index. */
 	__OVS_TUNNEL_KEY_ATTR_MAX
 };
 
net/ipv4/ip_gre.c +45 -0

51 lines not on this page · raw message

net/openvswitch/flow_netlink.c +54 -1

97 lines not on this page · raw message

net/openvswitch/vport-gre.c +66 -2

91 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · William Tu

Add type II erspan vport implementation. Since erspan protocol is on top of the GRE header, the implementation is extended from the existing gre implementation.

Cc Pravin B Shelar <[email protected]>

Why are you adding ERSPAN support to compat code. Isn't this supported over OVS netlink-rtnl (dpif-netlink-rtnl)?

author
#2 lore raw
Quoted 10 lines · Pravin Shelar
Quoted 6 lines · William Tu

Add type II erspan vport implementation. Since erspan protocol is on top of the GRE header, the implementation is extended from the existing gre implementation.

Cc Pravin B Shelar <[email protected]>

Why are you adding ERSPAN support to compat code. Isn't this supported over OVS netlink-rtnl (dpif-netlink-rtnl)?

You're right. I will remove it and submit v2. Thanks for the review.

William