From patchwork Tue Sep 30 03:22:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 394732 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 71C981400EA for ; Tue, 30 Sep 2014 13:23:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755336AbaI3DXI (ORCPT ); Mon, 29 Sep 2014 23:23:08 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:61171 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754565AbaI3DXG (ORCPT ); Mon, 29 Sep 2014 23:23:06 -0400 Received: by mail-pd0-f170.google.com with SMTP id ft15so2666990pdb.15 for ; Mon, 29 Sep 2014 20:23:05 -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=ZVTJ7Pq6HK6ksJ9yzueIrlhSCGZpwB5XbKAXsLR96VTy+lDk28j2dl/izJ3JqS38Zs ym6aNtbOODM2cGxu9bZU1xFm88I4CvKLPWZTNHmnZyZYT7XGBhpiqwgv7hHpnvfp38Rq ZE/hTDR2cFXmCFkZRkvYbOCu8NF7GQTh5HIJqgKJqyv27j4taOaxOHdIU7PdYCHd4kgv xatoP1RdERq0IqN+Cchk3W+CE+FeILnjIAOJqgHs2tU5RBTtxxlE6NUYCFBoFGXZ2Tt4 CT3KNF1C4iOvImpOfzvcU3Td4/5yyAADBM4dP/1RAFC+HR3Pcx6vXf1b6BkAqu66xkB+ hk7w== 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=AfNO9g+Ntqzrd3coCg4mYYClklrVkeUGgLCeCs+FEkq7yjlNNMoXxEUwhSIXhnSRdb a25BU/EUVyae1oMbh24J5LJky5QdBU3toc+CJ3afaQzoedwnZ7kv7zOElTdlEmp+Nurd XigKZ5ip0YAIeCrH1UgeWivA7htMfk6sdA7dlvQ3lspxYxlw8BfeR0vqAn3m5ftRoyBK kIj9DdMq9Xig9i4s/X77uVD/R1OTn8zNGkte83og3PSX2knEmSByLg0qqsJnPquTlKsN GzXEhbPWWxJ5gR9sUkFN4SWCEqGrZAL32AZDaOswB/3xbQWva/rlfy3Cd1AUeQt8lvJa V8rA== X-Gm-Message-State: ALoCoQlYNytJDj4SA2KapOzkph4WGO9zkewGaABEJ+4MzBG9M15/6wVqJWXMWoHuy2Gpv6D88wfM X-Received: by 10.70.103.145 with SMTP id fw17mr254586pdb.169.1412047385122; Mon, 29 Sep 2014 20:23:05 -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 gn6sm13664583pbc.40.2014.09.29.20.23.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 20:23:04 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH v2 net-next 4/5] gre: Set inner protocol in v4 and v6 GRE transmit Date: Mon, 29 Sep 2014 20:22:32 -0700 Message-Id: <1412047353-28502-5-git-send-email-therbert@google.com> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1412047353-28502-1-git-send-email-therbert@google.com> References: <1412047353-28502-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 --- 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);