From patchwork Wed Apr 25 16:21:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 904615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tMuZgrND"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40WQt567jrz9rxx for ; Thu, 26 Apr 2018 02:40:29 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 84101D34; Wed, 25 Apr 2018 16:22:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E266AD13 for ; Wed, 25 Apr 2018 16:22:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A410142D for ; Wed, 25 Apr 2018 16:22:03 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id o16so15647249pfk.9 for ; Wed, 25 Apr 2018 09:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W74VEz7oOiEpY0icdc4YAhGxcz5T1MZcv06JWaW+L5A=; b=tMuZgrNDoJ4KlcLMfFdhsYBac3imhHZQ0RkAWvF6V/nu2Alk6TPxZX6er3yryR0nqE sXmO9KScd6QBDjCyceEKvgOFb+LFL7tk/iWGuuRh6lbuLi63p5z8lOyzrzJQEO9wrja8 sdqREGks0xCBR0pRR3V6EQ+rjmYmlSPBNDYoyghJar3iDoWT+W71aN7wup5u8B0lrpLG 7z2HZgTIMBxgiLOsqVnG2Qce6OgENkbNMhW/VnN5taC0V7su8d1YrN0LCS4I5xvmThDz 9+2vxr52W2ClITEsg119pLTMobxhdJU2KGyBue0/1dlxj0Y3Rw+gX4XihHyG5Y29RxNP XW+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W74VEz7oOiEpY0icdc4YAhGxcz5T1MZcv06JWaW+L5A=; b=ge+MlGL7aWnNsVsqwKzuq102MbCOSiM4JRL698WIUvrM6WIITd52MtNuCYbQM7JZlr 6RtOUJ/W+2m0ePTV9eycZq2uKvXZ/FUbcJtuM2F4GQ+vfPqzqT82i6OxtGzwcqDHp4ww zo2tEjK6tr52EZ7FrFr1nSoWMpUnVnUvaboQKAil2gNSNW+MC5YYqSeQghK5oTwCePCP ZNrz30wYnLQzHQnXFrBkNlKTQT9QiyBE7se7jWcEotdw/MMaWBhF7PBI1RvL0V/aDEos ay+KILW0f/rK5+NptLUv8s/1rYEJnNZXCidEQp6IconiJxrVa4qlp9wSILo4QHUiuscg MNWw== X-Gm-Message-State: ALQs6tAcii8eD5W7rT3x6t7mMXIJoVcAUtkpikD0nABeQTByOhXava2m j2L7c26ZZLNDdonHik66VROZTw== X-Google-Smtp-Source: AIpwx48PSzDiuYMH6Ny5SWViTORIVdnguF4VUrwb9NO9Q6Zogr0CmgmACN8sZCN+DvtINtD6SPVF4Q== X-Received: by 10.99.125.19 with SMTP id y19mr24213838pgc.160.1524673323003; Wed, 25 Apr 2018 09:22:03 -0700 (PDT) Received: from gizo.domain (67-5-146-204.ptld.qwest.net. [67.5.146.204]) by smtp.gmail.com with ESMTPSA id o64sm32800694pfb.62.2018.04.25.09.22.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 09:22:02 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org, pshelar@ovn.org Date: Wed, 25 Apr 2018 09:21:46 -0700 Message-Id: <1524673309-30044-9-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1524673309-30044-1-git-send-email-gvrose8192@gmail.com> References: <1524673309-30044-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Xin Long Subject: [ovs-dev] [PATCH 08/11] ip_gre: set tunnel hlen properly in erspan_tunnel_init X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Xin Long Upstream commit: commit c122fda271717f4fc618e0a31e833941fd5f1efd Author: Xin Long Date: Sun Oct 1 22:00:55 2017 +0800 ip_gre: set tunnel hlen properly in erspan_tunnel_init According to __gre_tunnel_init, tunnel->hlen should be set as the headers' length between inner packet and outer iphdr. It would be used especially to calculate a proper mtu when updating mtu in tnl_update_pmtu. Now without setting it, a bigger mtu value than expected would be updated, which hurts performance a lot. This patch is to fix it by setting tunnel->hlen with: tunnel->tun_hlen + tunnel->encap_hlen + sizeof(struct erspanhdr) Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Signed-off-by: Xin Long Signed-off-by: David S. Miller Cc: Xin Long Signed-off-by: Greg Rose --- datapath/linux/compat/ip_gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index caa6e6c..7a4b5af 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -1044,7 +1044,9 @@ static int erspan_tunnel_init(struct net_device *dev) tunnel->tun_hlen = 8; tunnel->parms.iph.protocol = IPPROTO_GRE; - t_hlen = tunnel->hlen + sizeof(struct iphdr) + sizeof(struct erspanhdr); + tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen + + sizeof(struct erspanhdr); + t_hlen = tunnel->hlen + sizeof(struct iphdr); dev->needed_headroom = LL_MAX_HEADER + t_hlen + 4; dev->mtu = ETH_DATA_LEN - t_hlen - 4;