Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3851443pxb; Tue, 17 Nov 2020 05:23:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaEQ1BF0ZiCOmxqh1WOtM7zRoDoDhlaQZeIMRN++P5S5bGkSZcyqTGcHGrloVNpBY+3L2P X-Received: by 2002:aa7:cb02:: with SMTP id s2mr20264686edt.211.1605619422645; Tue, 17 Nov 2020 05:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619422; cv=none; d=google.com; s=arc-20160816; b=iXH9CjFdfXELHjGB0xhDIP9s3MH/oycDN7fSPUI78vuEVLMFYOc4DRB4gELzvfnUaV PiBpDFUI1hrWXzoJVqWm+ZpUG1ivr4KJZdvXJteyOd/FT0Tl31YLtzcE89Gj0U9/fWK1 2QzWxb+Jhheo+j7gD7b5cVAzGx/0mrstY/AmWx7moFd3nojC9uis0O2EvYM6jJBV3d/S RMV8GHaIwJdlxVGpWb+RAmBygkvU4KRcrFv0sKXqIKTLsoRjQnbctZlGmgGu6GsI+LPc ey0Mjp/0/6f+3ZHlo8t7JZQo+eCERhWkthDFaZOrmTWErFII1PnyUK7KkC/TvnYfIk3+ 2chQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Eq0PSR+VkuuJw323Lk/huO8imjQ0BRlMJ57uaJ0UNFI=; b=K4IaOkvfOrIkjFPNnIHgbfbwzddZeo9GKx0HYsIhex0m3dSLqkjqS/uOsmgd9ealvL 4CveIynFgVJnwV/4AyNWt0dT5Wyh4oXTT3v3IyP9cXea7NPBBDYWEkwM2CmPHuFKKf16 Cf8zx9NeRmANSu2mXedT9sYLt3OylLUYvEx8WG/J4QS3RvNdOWPvTZNibn3GJ/12mLaF qsVuE9HjRuYhij3rCi2vsFqw5lAR8lOmfGr+i+MgfjWplR9vAm4wkRgcQ7q8pWLyslJb 8jH/+Xo71GXzzKsEREVaZDlgdBQ0kZ38f+zsc/NZRKAm0brRb72iV0S+xdvZ2DaSYP8K SdEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CiarzUpk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si1249624ejk.164.2020.11.17.05.23.19; Tue, 17 Nov 2020 05:23:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CiarzUpk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730675AbgKQNVS (ORCPT + 99 others); Tue, 17 Nov 2020 08:21:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:54852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbgKQNVO (ORCPT ); Tue, 17 Nov 2020 08:21:14 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 526B12464E; Tue, 17 Nov 2020 13:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619274; bh=FzkOdRW074rezyjYXQChK2BcxggfyWFQoUxukawEFjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CiarzUpk7LJhq+v+7El4+dERJcU2KVGlHQHBNjPemEbbWi8wp3juGRA3/DN5wNk90 hnktZFB/Xl1USvVwXR875MSocor3gn1F/Nwq8cjWz0MWUW7awRL5+nzRuy+f+HRci5 OvVbrN/mzpchgBI4nofurjreRX6ANTtklwI7P1S4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Herms , Willem de Bruijn , Jakub Kicinski Subject: [PATCH 4.19 087/101] IPv6: Set SIT tunnel hard_header_len to zero Date: Tue, 17 Nov 2020 14:05:54 +0100 Message-Id: <20201117122117.368413165@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Herms [ Upstream commit 8ef9ba4d666614497a057d09b0a6eafc1e34eadf ] Due to the legacy usage of hard_header_len for SIT tunnels while already using infrastructure from net/ipv4/ip_tunnel.c the calculation of the path MTU in tnl_update_pmtu is incorrect. This leads to unnecessary creation of MTU exceptions for any flow going over a SIT tunnel. As SIT tunnels do not have a header themsevles other than their transport (L3, L2) headers we're leaving hard_header_len set to zero as tnl_update_pmtu is already taking care of the transport headers sizes. This will also help avoiding unnecessary IPv6 GC runs and spinlock contention seen when using SIT tunnels and for more than net.ipv6.route.gc_thresh flows. Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.") Signed-off-by: Oliver Herms Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/20201103104133.GA1573211@tws Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv6/sit.c | 2 -- 1 file changed, 2 deletions(-) --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -1087,7 +1087,6 @@ static void ipip6_tunnel_bind_dev(struct if (tdev && !netif_is_l3_master(tdev)) { int t_hlen = tunnel->hlen + sizeof(struct iphdr); - dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr); dev->mtu = tdev->mtu - t_hlen; if (dev->mtu < IPV6_MIN_MTU) dev->mtu = IPV6_MIN_MTU; @@ -1377,7 +1376,6 @@ static void ipip6_tunnel_setup(struct ne dev->priv_destructor = ipip6_dev_free; dev->type = ARPHRD_SIT; - dev->hard_header_len = LL_MAX_HEADER + t_hlen; dev->mtu = ETH_DATA_LEN - t_hlen; dev->min_mtu = IPV6_MIN_MTU; dev->max_mtu = IP6_MAX_MTU - t_hlen;