Skip to contentSkip to conversation

geneve: fix needed_headroom and max_mtu for collect_metadata

PATCH In review Eric Garver 3 participants 3 messages Jun 2, 2017 – Jun 5, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 geneve: fix needed_headroom and max_mtu for collect_metadata

Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") when using COLLECT_METADATA geneve devices are created with too small of a needed_headroom and too large of a max_mtu. This is because ip_tunnel_info_af() is not valid with the device level info when using COLLECT_METADATA and we mistakenly fall into the IPv4 case.

For COLLECT_METADATA, always use the worst case of ipv6 since both sockets are created.

Fixes 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
---
 drivers/net/geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/geneve.c +1 -1
index 959fd12d2e67..6ebb0f559a42 100644
@@ -1133,7 +1133,7 @@ static int geneve_configure(struct net *net, struct net_device *dev,
 
 	/* make enough headroom for basic scenario */
 	encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
-	if (ip_tunnel_info_af(info) == AF_INET) {
+	if (!metadata && ip_tunnel_info_af(info) == AF_INET) {
 		encap_len += sizeof(struct iphdr);
 		dev->max_mtu -= sizeof(struct iphdr);
 	} else {
Signature · 1 line
2.12.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Garver

Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") when using COLLECT_METADATA geneve devices are created with too small of a needed_headroom and too large of a max_mtu. This is because ip_tunnel_info_af() is not valid with the device level info when using COLLECT_METADATA and we mistakenly fall into the IPv4 case.

For COLLECT_METADATA, always use the worst case of ipv6 since both sockets are created.

Fixes 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")

Thanks.

maintainer
#2 lore raw
In reply to Eric Garver

From: Eric Garver <[email protected]>
Date: Fri, 2 Jun 2017 14:54:10 -0400

Quoted 11 lines

Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") when using COLLECT_METADATA geneve devices are created with too small of a needed_headroom and too large of a max_mtu. This is because ip_tunnel_info_af() is not valid with the device level info when using COLLECT_METADATA and we mistakenly fall into the IPv4 case.

For COLLECT_METADATA, always use the worst case of ipv6 since both sockets are created.

Fixes 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")

Applied and queued up for -stable, thanks.