From patchwork Fri Sep 26 16:22:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 393858 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0E88E140085 for ; Sat, 27 Sep 2014 02:23:12 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755278AbaIZQXF (ORCPT ); Fri, 26 Sep 2014 12:23:05 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:51161 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755253AbaIZQXC (ORCPT ); Fri, 26 Sep 2014 12:23:02 -0400 Received: by mail-pa0-f52.google.com with SMTP id fb1so1386608pad.11 for ; Fri, 26 Sep 2014 09:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=J7vrxdSQg+c0F9cXp+QoJOojr0aNc3I1QpfGxa+61kY=; b=mebHEU0mq0+oE89G0dxnQ8COYq5HiIPGdXOCTLJl5+6ruqXbQxQYhF6m0NVX33bVo9 Hly5CcT/DY4jv7OCTGfk5aLvWJkG2tT+FQgQ5QD0+5R+hcY8Cwy9orsPvzV7/go5EFm2 lexOgyugWSj360fOFUoEKt6GwLuMVBCiLLXHR65ttfwhW4NzJzqbsFy29FxZLRwXRzU/ c+j6C2VeW5QGD21E2SiixC3PDnlSvfTsYKE6h3gAiVG99Cwr1U6x9hBeShfWDEHRre2f PdFLn0099hj8Jt0+Ckv2fF37jCMQG65JrJ0z+VVmvwTzwoZ+Jfs8Csvxfw6+Zbin24/t v9Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=J7vrxdSQg+c0F9cXp+QoJOojr0aNc3I1QpfGxa+61kY=; b=LVKGSTmGho9sk5FEI2KvN/Foq36TmJ0lVRSKdrn+4SvAC9EOHsk+/NX0mGKArGlVdB DGg2nWQINesTx35x0Uqyw+eHAWDnp+89gemLzJq6PjJaUhnvNhAS2Cu7JoKwj8NY/OXT 49TfHTE++blbJ8hiIiRJVtQQWzNpquboXmVxW4k0I/BW1I9/neXBi3aU3HQu1An6k1kJ DLezB2MHCVU8EyjYQklIS83WfOxfo9IJ4orCEbt0DSlNsE2z/l9aJvO9LbSyrBrlVsvo gn2v242QbV1KrU4hbFXBzoWkAdFmlkTDhu/7JAPUeVGXQvy2BXg0Ogn7ZrYYAI47rp+S yLRg== X-Gm-Message-State: ALoCoQm546a+huYda4mYByyRrXxB8jqt5cH3GpbsKsZ+Pibrsl+TPMssDhxY5mV1GtWt2grzVz2B X-Received: by 10.70.96.237 with SMTP id dv13mr39048246pdb.66.1411748581601; Fri, 26 Sep 2014 09:23:01 -0700 (PDT) Received: from tomh.mtv.corp.google.com (tomh.mtv.corp.google.com [172.18.117.126]) by mx.google.com with ESMTPSA id kw10sm5398757pab.0.2014.09.26.09.23.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 09:23:01 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH net-next 4/5] gre: Set inner protocol in v4 and v6 GRE transmit Date: Fri, 26 Sep 2014 09:22:33 -0700 Message-Id: <1411748554-7346-5-git-send-email-therbert@google.com> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1411748554-7346-1-git-send-email-therbert@google.com> References: <1411748554-7346-1-git-send-email-therbert@google.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Call skb_set_inner_protocol to set inner Ethernet protocol to protocol being encapsulation by GRE before tunnel_xmit. This is needed for GSO if UDP encapsulation (fou) is being done. Signed-off-by: Tom Herbert Reviewed-by: Simon Horman --- net/ipv4/ip_gre.c | 2 ++ net/ipv6/ip6_gre.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 829aff8b..0485ef1 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -241,6 +241,8 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, /* Push GRE header. */ gre_build_header(skb, &tpi, tunnel->tun_hlen); + skb_set_inner_protocol(skb, tpi.proto); + ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol); } diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 5f19dfb..9a0a1aa 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -616,6 +616,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb, int err = -1; u8 proto; struct sk_buff *new_skb; + __be16 protocol; if (dev->type == ARPHRD_ETHER) IPCB(skb)->flags = 0; @@ -732,8 +733,9 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb, ipv6h->daddr = fl6->daddr; ((__be16 *)(ipv6h + 1))[0] = tunnel->parms.o_flags; - ((__be16 *)(ipv6h + 1))[1] = (dev->type == ARPHRD_ETHER) ? - htons(ETH_P_TEB) : skb->protocol; + protocol = (dev->type == ARPHRD_ETHER) ? + htons(ETH_P_TEB) : skb->protocol; + ((__be16 *)(ipv6h + 1))[1] = protocol; if (tunnel->parms.o_flags&(GRE_KEY|GRE_CSUM|GRE_SEQ)) { __be32 *ptr = (__be32 *)(((u8 *)ipv6h) + tunnel->hlen - 4); @@ -754,6 +756,8 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb, } } + skb_set_inner_protocol(skb, protocol); + ip6tunnel_xmit(skb, dev); if (ndst) ip6_tnl_dst_store(tunnel, ndst);