Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3849421pxb; Tue, 17 Nov 2020 05:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuQVH5Zs3L0TYpcuhFdYV/kDI9vmubt7IjpeIS2JwHT9kaE3ob5wN0m5MQhwZrlNViGIOK X-Received: by 2002:a17:907:264d:: with SMTP id ar13mr18698423ejc.207.1605619237003; Tue, 17 Nov 2020 05:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619236; cv=none; d=google.com; s=arc-20160816; b=oY6bZhXLT8ZB4PoMwrZiZAPveY0l3OErdSXBBTLjCT2r6STDwYfK2o0LyxWh53aNz/ 9UqlZlJ5k28oqOiCrr6kIOBmbeKJlNQ5NNAiNXFgqVwBOEEVw1kdGge9siZHbXANpHKD iO0BOO7rPpZH001+OrKpKOt4iX5iJkOWJ7tg4G6z5MGWTDKHkVDZMsfgp2KgLzWBnJuj U4ukKJ1JM6XtGFs1GVQ1VaTWv9TAr+QA2EeicTrU3eEvRy84BPtYg+jLbuCshLaV2T31 m2JykWCm+VUYOmnwCVxSv1srgkKwQmOtThTm5/af9KRj40J8UMO2qYehfPy4rEVVWf/t c1/w== 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=ZTZhq0Utoq2p/HoX1GXUZ//vhPSI7Fdcf7JrLd2jTDE=; b=WGRnmBV+GJwKrmnaOI7TjTEzhLhe1FDuSy0viDhjlqEiPdX6g+jZre1SibtrFuiejK ii8ED3clvQsTjXujKDCctBX3nVXZq5tR5/v2wXQmNDJIHuIVH2HgAzg/fAbrgkmOBJ6o mzXUTRi6t/VsXfPdzJ0Pi91QYOYIQLYe4SmRAUbau1ikIvjk8dgQzWc7wm7b8UpZbZvS y/IWVabdc25exiRd37CKjy7XnIapzbniNglM5AFM8w91RJeX3At+Ph+iz/iLf1Z/2wJp zQgicaJf2nm2weB8IOfD+LzVe724ik/DySG12YRa8GlV3K4UB9cPmYeT6BH4+n8PXkbM kVow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QTUoOLu8; 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 bm22si14215562edb.342.2020.11.17.05.20.12; Tue, 17 Nov 2020 05:20:36 -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=QTUoOLu8; 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 S1730225AbgKQNPm (ORCPT + 99 others); Tue, 17 Nov 2020 08:15:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:47076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729655AbgKQNPh (ORCPT ); Tue, 17 Nov 2020 08:15:37 -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 C9C102151B; Tue, 17 Nov 2020 13:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618936; bh=kCXd3ZZYGdWKylxN8cEbduyIRgobZqkHHV/q/6szfv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QTUoOLu8v8C7eMrODjAUIVlwW0j8ZvDYik2UgGesJRWrEp1660QiV0xpAiLASiKy1 VacGUAuYp8hVQkwgbbeUvyZ6d4QGWmR20c5spwtJ3bevtVVWamYjFv9+uh+yP1pc5o WxjpNTx/wVar/Qq3J+RMNAS187qu8YQnOua6TGBw= 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.14 58/85] IPv6: Set SIT tunnel hard_header_len to zero Date: Tue, 17 Nov 2020 14:05:27 +0100 Message-Id: <20201117122113.876789585@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122111.018425544@linuxfoundation.org> References: <20201117122111.018425544@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 @@ -1073,7 +1073,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; @@ -1363,7 +1362,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;