From patchwork Tue Sep 5 09:26:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 810043 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="q0ednacr"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xmhDj4g1sz9s0g for ; Tue, 5 Sep 2017 19:26:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbdIEJ0n (ORCPT ); Tue, 5 Sep 2017 05:26:43 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37036 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbdIEJ0m (ORCPT ); Tue, 5 Sep 2017 05:26:42 -0400 Received: by mail-pg0-f65.google.com with SMTP id j6so1639693pgc.4 for ; Tue, 05 Sep 2017 02:26:42 -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; bh=hRJ/fnLbFhUKp5JmJSPoIKb37ufoiRp4c3t5WFd8z4k=; b=q0ednacr2JpwFTWa2tvIepXcfB4F62xNOUEaJAJm7NSpjtvNzKfkZvVZDT0pduRTIs Sf4yN4WMKzB0MvDK/5ue4lysoEDN+HUSAhnzQkUyN9xt7XiNxGvWhEIu/7T1VW1VGRcd cs3IICz5yBT7Wjtezlw6nNXXA8QfT0wvTzppphjbTLXTUchOGyyrrlbBKRXshekhrcRb 6swxyo4KpMc1iW6J3l3Q7iSCydHnr2Qqq7IRSDyNA/DnR2ZZQspohoXXtamIoBgu1qEA lNynHMGluMPJY6Rlfg5a6bQ3U1xmGB0sKpDpTg/G4Xm+Y4FN5W0ikXP0G12Vh0LCigYx 8/UQ== 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; bh=hRJ/fnLbFhUKp5JmJSPoIKb37ufoiRp4c3t5WFd8z4k=; b=ZuQQdpgVEwS1g0PcXSZ3gb1SnHMH2SyCeoCQ6HsSP7hc03lXVkdVopVMnzriGTb2mv 8cagssuvbeJjo5FeZGHnZ5ltbmMqvZ1ftnjBPThuxaHiyFzxoVu2e2om5oV2OVkMoB8s iKmxoW6UHbu4bQqYjiq/ds46d7gFfXAJk8xh9EV9cUMXPi9wlVE2OgqaPvPNV1UszsZ8 HYCUEBmQP1gSr+N8g7Bg68jhRuwfPlMuSW7+1xc6c0c71Ldu/GlsPKMkB609tpOl+hj8 nQlSb2miWoggGBwxVGZCIJaGoOxoxakiNfvFEAKNI6aWhhZQrPtF99PxE8Frtg7j8zJl 6nSw== X-Gm-Message-State: AHPjjUiomcFNeCkipnR2X5yi+a8NGKnuzkkFmrVDRG43ogUQwUEpSv1W BGcMgPrcs9oJtxR32+o= X-Google-Smtp-Source: ADKCNb6Qr+6wAvb51ttNbRXyegVOaaXgV1HX3WK+fyCTF40j2N35w8nTORwG4L7h54kenNSYnf+lkA== X-Received: by 10.98.137.203 with SMTP id n72mr3205283pfk.4.1504603601941; Tue, 05 Sep 2017 02:26:41 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id y23sm565502pfa.38.2017.09.05.02.26.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 02:26:41 -0700 (PDT) From: Xin Long To: network dev Cc: davem@davemloft.net Subject: [PATCH net] ip6_gre: update mtu properly in ip6gre_err Date: Tue, 5 Sep 2017 17:26:33 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now when probessing ICMPV6_PKT_TOOBIG, ip6gre_err only subtracts the offset of gre header from mtu info. The expected mtu of gre device should also subtract gre header. Otherwise, the next packets still can't be sent out. Jianlin found this issue when using the topo: client(ip6gre)<---->(nic1)route(nic2)<----->(ip6gre)server and reducing nic2's mtu, then both tcp and sctp's performance with big size data became 0. This patch is to fix it by also subtracting grehdr (tun->tun_hlen) from mtu info when updating gre device's mtu in ip6gre_err(). It also needs to subtract ETH_HLEN if gre dev'type is ARPHRD_ETHER. Reported-by: Jianlin Shi Signed-off-by: Xin Long --- net/ipv6/ip6_gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 67ff2aa..b7a72d4 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -432,7 +432,9 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt, } break; case ICMPV6_PKT_TOOBIG: - mtu = be32_to_cpu(info) - offset; + mtu = be32_to_cpu(info) - offset - t->tun_hlen; + if (t->dev->type == ARPHRD_ETHER) + mtu -= ETH_HLEN; if (mtu < IPV6_MIN_MTU) mtu = IPV6_MIN_MTU; t->dev->mtu = mtu;