From patchwork Fri May 18 01:57:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 915941 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="cYYQIT5s"; 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 40nBJQ1J7Wz9s1w for ; Fri, 18 May 2018 12:02:30 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 14FFB1056; Fri, 18 May 2018 01:58:37 +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 43646FF1 for ; Fri, 18 May 2018 01:58:31 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id EE456196 for ; Fri, 18 May 2018 01:58:30 +0000 (UTC) Received: by mail-pl0-f65.google.com with SMTP id w19-v6so3630458plq.4 for ; Thu, 17 May 2018 18:58:30 -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=DAP8s1FTQPQd2Sl1OV9NRPCXD6MxrYhzc5r6pMbggc8=; b=cYYQIT5smG+0cQ2x8F+XXGMegAuws+BFJnZHe+qJ7dWMdbGWtJfeNGpUTuArW6m5Ci C27yV7McayiYJSs0nSmh/wQxBdRA7AzwNvRDl5ElGka+iMG/S9yFxqZ01tAhW6z1wcGn vLbeeVgYDNfMYDRZs8wfDfN9leUdc+ExpQSoa888P0a9IZCVT3Q4wNufVxk5HpM0yWNs ukk7V6aFRcJ/FXeutrh1sFYhNk6qLANVnhe6CBUCNn+CbReZ1nfjUuU7TMY4iUmoEm4H cOoNRwSCmPnJ1AfpnD6jybWzMMUbj9mJmmtwTprTK1hmZOxlLrl57eToQgVAHly7SRiD 7q3Q== 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=DAP8s1FTQPQd2Sl1OV9NRPCXD6MxrYhzc5r6pMbggc8=; b=LFsCQ8UzpLJPt1yC9bxo9TcCQ82hMkf0+3VGfs8h66a+AodRGeAIwYYP4MmM9HhpCd u7b42Mr6KKQ9UZtGZAYyPFspVY6x9PLqobt3UooYHcoCH06QdK7vTvm0u9nNySFl+9an O7a+/I7UgsiZGR5UW0fdVc8vOdEcJEOEcKR5qnGc8aM6KT8dF3a58Ad5gpNcjoPtDXih geW521iaVmIgJ15U5eI7gMK/yBEQ+9NuGImbynYV2l2iyGfhgU92wjodyo8DEfWliwbE 99zdPQyXdp+2nDlIwroF4qLtEwDIbdjSvwr1DMWIGOHaIqDlhHP0AlQb68UO8cyxG0cb bMaw== X-Gm-Message-State: ALKqPwf//724Td+3vn1n/xhpYVq0x/1PS9jwmcBAFHpclNri8fuBhEY4 PkM7BwTNUjw2LNXms+hzIMUirQ== X-Google-Smtp-Source: AB8JxZoQvvsyDnhFz5GpXSMP1Lubxbyk0U1fi+zVPFO7eutzJ5ur0eTHib3ylyujHxKZqyht/yyTsQ== X-Received: by 2002:a17:902:462:: with SMTP id 89-v6mr7403733ple.300.1526608710345; Thu, 17 May 2018 18:58:30 -0700 (PDT) Received: from gizo.domain (97-115-125-157.ptld.qwest.net. [97.115.125.157]) by smtp.gmail.com with ESMTPSA id d15-v6sm10564908pfh.97.2018.05.17.18.58.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 18:58:29 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 17 May 2018 18:57:21 -0700 Message-Id: <1526608674-12702-9-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526608674-12702-1-git-send-email-gvrose8192@gmail.com> References: <1526608674-12702-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 V2 08/41] 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 1a8dc76..70c6a9f 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;