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

Commit 5e0aa597 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'geneve-consolidation'



Pravin B Shelar says:

====================
Geneve: Add support for tunnel metadata mode

Following patches adds support for Geneve tunnel metadata
mode. OVS can make use of Geneve net-device with tunnel
metadata API from kernel.

This also allows us to consolidate Geneve implementation
from two kernel modules geneve_core and geneve to single
geneve module. geneve_core module was targeted to share
Geneve encap and decap code between Geneve netdevice and
OVS Geneve tunnel implementation, Since OVS no longer
needs these API, Geneve code can be consolidated into
single geneve module.

v3-v4:
- Drop NETIF_F_NETNS_LOCAL feature.
- Fix geneve device newlink check

v2-v3:
- make tunnel medata device and regular device mutually exclusive.
- Fix Kconfig dependency for Geneve.
- Fix dst-port netlink encoding.
- drop changelink patch.

v1-v2:
- Replaced per hash table tunnel pointer (metadata enabled) with flag.
- Added support for changelink.
- Improve geneve device route lookup with more parameters.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d2d427b3 66d47003
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -180,8 +180,8 @@ config VXLAN
	  will be called vxlan.

config GENEVE
       tristate "Generic Network Virtualization Encapsulation netdev"
       depends on INET && GENEVE_CORE
       tristate "Generic Network Virtualization Encapsulation"
       depends on INET && NET_UDP_TUNNEL
       select NET_IP_TUNNEL
       ---help---
	  This allows one to create geneve virtual interfaces that provide
+631 −105

File changed.

Preview size limit exceeded, changes collapsed.

+3 −26
Original line number Diff line number Diff line
@@ -1264,36 +1264,13 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
	}

	if (vxlan_collect_metadata(vs)) {
		tun_dst = metadata_dst_alloc(sizeof(*md), GFP_ATOMIC);
		tun_dst = udp_tun_rx_dst(skb, vxlan_get_sk_family(vs), TUNNEL_KEY,
					 cpu_to_be64(vni >> 8), sizeof(*md));

		if (!tun_dst)
			goto drop;

		info = &tun_dst->u.tun_info;
		if (vxlan_get_sk_family(vs) == AF_INET) {
			const struct iphdr *iph = ip_hdr(skb);

			info->key.u.ipv4.src = iph->saddr;
			info->key.u.ipv4.dst = iph->daddr;
			info->key.tos = iph->tos;
			info->key.ttl = iph->ttl;
		} else {
			const struct ipv6hdr *ip6h = ipv6_hdr(skb);

			info->key.u.ipv6.src = ip6h->saddr;
			info->key.u.ipv6.dst = ip6h->daddr;
			info->key.tos = ipv6_get_dsfield(ip6h);
			info->key.ttl = ip6h->hop_limit;
		}

		info->key.tp_src = udp_hdr(skb)->source;
		info->key.tp_dst = udp_hdr(skb)->dest;

		info->mode = IP_TUNNEL_INFO_RX;
		info->key.tun_flags = TUNNEL_KEY;
		info->key.tun_id = cpu_to_be64(vni >> 8);
		if (udp_hdr(skb)->check != 0)
			info->key.tun_flags |= TUNNEL_CSUM;

		md = ip_tunnel_info_opts(info, sizeof(*md));
	} else {
		memset(md, 0, sizeof(*md));
+61 −0

File changed.

Preview size limit exceeded, changes collapsed.

+2 −33

File changed.

Preview size limit exceeded, changes collapsed.

Loading