Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9043501pxu; Mon, 28 Dec 2020 05:15:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEau2O+EPml1p5q4S7XL9cIOWKLuI8I1dMaaZLRmKcUPzN7ueufEwQi7KAIeoKlWg00CCr X-Received: by 2002:a05:6402:14c5:: with SMTP id f5mr41603594edx.232.1609161314895; Mon, 28 Dec 2020 05:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161314; cv=none; d=google.com; s=arc-20160816; b=SkFrVEuIuQZ3qHYCvAlVY+7h5XjemUY68K9rAwbddV1yqyFkGRMBcb2e7FT4PMn8Ok /Z0EG+PchzVG9fe9FCHzbYbEUUS4Gomka78lsMfwbgmMIbzx5rWfBXgCjqeEgud/zAnM C+cSw+ulLEjWAJmKK70vEnPThMmbXX+krgQEnAE+FXTuoNKvrLi2945Pnl+QurIP9Bkl kYhORtwfTZFLgCYYAd+KhNzkrHhEBOCUnc5yxU/PUeIWn2VoggdbM1qX5ofLSI8w+p1K SCtqpEriwPfaQ0h0Bpo5U9VUJimUnqBl2v4PSwUz0rgrVfo3hsCuUoJUGagDqanXI/XV Uekg== 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=0MQyn5g3SvW8JVrUC6D+gNvyJvp2Di0+0BXT+1UzdII=; b=e4uZPJVWR3/n1C4De2WvXoyeElTLlGRHgb6OG0MeyB3d7kLuE1pAyDh3F6MpU+aZWg sE8yOQqtfTwMXDA1mg6xhgU+Owtw3sGsF4NI+smhf9+zSw9Si75PicSgCuCfxvQbLDnr MXLEEvSGaa+FFWKi9x0Yhhfn06RyRM5ASdGD906jPIBA06pplXhieQRb6UXDaLaOJ39I 8tAWb2AlsDyXCJSvc8waUnNy7Gur9iFIvS8XYzYg5gWfxfjOe6uPxHU2r6c4NHhxbvx0 Zx/LoyrXtsBDOnAEKAau143L3Vl4AGFow4LjEx4zQT8AtJ9l2ezzcWOM+Sj7jP33OwDM LZIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C2YgrOSO; 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=pass (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 dn20si21248959ejc.47.2020.12.28.05.14.52; Mon, 28 Dec 2020 05:15:14 -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=@linuxfoundation.org header.s=korg header.b=C2YgrOSO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731434AbgL1NKl (ORCPT + 99 others); Mon, 28 Dec 2020 08:10:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:37570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729679AbgL1NKk (ORCPT ); Mon, 28 Dec 2020 08:10:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D42422AAA; Mon, 28 Dec 2020 13:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161024; bh=eIeAnZ6izoxXlyAWa6UdwaNo4l0ahH+vpR/Z9cdwvp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2YgrOSOufYyrcNXJOgvfvRQVSmj5YlkdcQsEOQsfpXIkPL7SkcDCv1JgBiScUX79 hkY73Z5weoTsk8sJI8DhgmGtBDKrf5m8eusA8igRE8sIRyR7p/4VzDrDARy1sYZsn1 5lM2TeaPOnGQ8o57nEe5KViU15BEOjRyKUsBcalU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Annika Wickert , Sven Eckelmann , Annika Wickert , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 044/242] vxlan: Add needed_headroom for lower device Date: Mon, 28 Dec 2020 13:47:29 +0100 Message-Id: <20201228124906.846772470@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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: Sven Eckelmann [ Upstream commit 0a35dc41fea67ac4495ce7584406bf9557a6e7d0 ] It was observed that sending data via batadv over vxlan (on top of wireguard) reduced the performance massively compared to raw ethernet or batadv on raw ethernet. A check of perf data showed that the vxlan_build_skb was calling all the time pskb_expand_head to allocate enough headroom for: min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len + VXLAN_HLEN + iphdr_len; But the vxlan_config_apply only requested needed headroom for: lowerdev->hard_header_len + VXLAN6_HEADROOM or VXLAN_HEADROOM So it completely ignored the needed_headroom of the lower device. The first caller of net_dev_xmit could therefore never make sure that enough headroom was allocated for the rest of the transmit path. Cc: Annika Wickert Signed-off-by: Sven Eckelmann Tested-by: Annika Wickert Link: https://lore.kernel.org/r/20201126125247.1047977-1-sven@narfation.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/vxlan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 82efa5bbf568b..c21f28840f05b 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3184,6 +3184,7 @@ static void vxlan_config_apply(struct net_device *dev, dev->gso_max_segs = lowerdev->gso_max_segs; needed_headroom = lowerdev->hard_header_len; + needed_headroom += lowerdev->needed_headroom; max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM); -- 2.27.0