netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] geneve: restore vlan bits in xmit path
@ 2015-09-17 17:18 John W. Linville
  2015-09-17 18:45 ` Pravin Shelar
  2015-09-18 20:20 ` [PATCH v2] geneve: remove vlan-related feature assignment John W. Linville
  0 siblings, 2 replies; 11+ messages in thread
From: John W. Linville @ 2015-09-17 17:18 UTC (permalink / raw)
  To: netdev; +Cc: davem, Pravin B Shelar, John W. Linville

These seem to have been accidentally dropped in commit 371bd1061d29
("geneve: Consolidate Geneve functionality in single module.").

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/geneve.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index a917ae1cfbf3..0aaf302cc31b 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -14,6 +14,7 @@
 #include <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/if_vlan.h>
 #include <linux/hash.h>
 #include <net/dst_metadata.h>
 #include <net/gro_cells.h>
@@ -532,13 +533,20 @@ static int geneve_build_skb(struct rtable *rt, struct sk_buff *skb,
 	int err;
 
 	min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len
-			+ GENEVE_BASE_HLEN + opt_len + sizeof(struct iphdr);
+			+ GENEVE_BASE_HLEN + opt_len + sizeof(struct iphdr)
+			+ (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 	err = skb_cow_head(skb, min_headroom);
 	if (unlikely(err)) {
 		kfree_skb(skb);
 		goto free_rt;
 	}
 
+	skb = vlan_hwaccel_push_inside(skb);
+	if (unlikely(!skb)) {
+		err = -ENOMEM;
+		goto free_rt;
+	}
+
 	skb = udp_tunnel_handle_offloads(skb, csum);
 	if (IS_ERR(skb)) {
 		err = PTR_ERR(skb);
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-09-21 23:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17 17:18 [PATCH] geneve: restore vlan bits in xmit path John W. Linville
2015-09-17 18:45 ` Pravin Shelar
2015-09-17 19:25   ` John W. Linville
2015-09-17 19:48     ` Jesse Gross
2015-09-17 20:00       ` Pravin Shelar
2015-09-17 20:15       ` John W. Linville
2015-09-17 22:02         ` Pravin Shelar
2015-09-18  0:42         ` Jesse Gross
2015-09-18 20:20 ` [PATCH v2] geneve: remove vlan-related feature assignment John W. Linville
2015-09-18 20:32   ` Jesse Gross
2015-09-21 23:24   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).