Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa310701 authored by Pravin B Shelar's avatar Pravin B Shelar Committed by David S. Miller
Browse files

openvswitch: Add gre tunnel support.



Add gre vport implementation.  Most of gre protocol processing
is pushed to gre module. It make use of gre demultiplexer
therefore it can co-exist with linux device based gre tunnels.

Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
Acked-by: default avatarJesse Gross <jesse@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a3e82996
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ enum ovs_vport_type {
	OVS_VPORT_TYPE_UNSPEC,
	OVS_VPORT_TYPE_NETDEV,   /* network device */
	OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
	OVS_VPORT_TYPE_GRE,      /* GRE tunnel. */
	__OVS_VPORT_TYPE_MAX
};

+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ config OPENVSWITCH
	  which is able to accept configuration from a variety of sources and
	  translate it into packet processing rules.

	  Open vSwitch GRE support depends on CONFIG_NET_IPGRE_DEMUX.

	  See http://openvswitch.org for more information and userspace
	  utilities.

+2 −1
Original line number Diff line number Diff line
@@ -10,5 +10,6 @@ openvswitch-y := \
	dp_notify.o \
	flow.o \
	vport.o \
	vport-gre.o \
	vport-internal_dev.o \
	vport-netdev.o \
	vport-netdev.o
+1 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ struct dp_upcall_info {
struct ovs_net {
	struct list_head dps;
	struct work_struct dp_notify_work;
	struct vport_net vport_net;
};

extern int ovs_net_id;
+17 −1
Original line number Diff line number Diff line
@@ -49,11 +49,27 @@ struct ovs_key_ipv4_tunnel {
	__be64 tun_id;
	__be32 ipv4_src;
	__be32 ipv4_dst;
	u16  tun_flags;
	__be16 tun_flags;
	u8   ipv4_tos;
	u8   ipv4_ttl;
};

static inline void ovs_flow_tun_key_init(struct ovs_key_ipv4_tunnel *tun_key,
					 const struct iphdr *iph, __be64 tun_id,
					 __be16 tun_flags)
{
	tun_key->tun_id = tun_id;
	tun_key->ipv4_src = iph->saddr;
	tun_key->ipv4_dst = iph->daddr;
	tun_key->ipv4_tos = iph->tos;
	tun_key->ipv4_ttl = iph->ttl;
	tun_key->tun_flags = tun_flags;

	/* clear struct padding. */
	memset((unsigned char *) tun_key + OVS_TUNNEL_KEY_SIZE, 0,
	       sizeof(*tun_key) - OVS_TUNNEL_KEY_SIZE);
}

struct sw_flow_key {
	struct ovs_key_ipv4_tunnel tun_key;  /* Encapsulating tunnel key. */
	struct {
Loading