Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9261895pxu; Mon, 28 Dec 2020 10:44:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYWcMd4tUMsf6SUL1C0XESba7WWah9vbiOC09j/e9Mbicap94l+hBTpOJ3VyzPbZGyXXTT X-Received: by 2002:a17:906:b1c8:: with SMTP id bv8mr43505568ejb.208.1609181072139; Mon, 28 Dec 2020 10:44:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609181072; cv=none; d=google.com; s=arc-20160816; b=uJwY9vMe0eEix1JbzDf1WOapP4hw5Wv9q68SmxacmdW67E1FImsU+jKBdxw1711ysK 1IUPaa25tBnpirJLtH/VtGoCLN+ZXnlHhDIIwCcFFWytEisbM0aqEl5qljOQaB6FXIwl KI7QosnKSIFvTsqjDofwbEZS3kt8hXObvZ/rkbB4QV3vp68fkxi5oRbpuHgeh9vgp+h1 Gdnfqxe4BvdYllu8Hadm8j35bgGrcsDLu6mDRifXU4mxx1nvJnOOsAg2Nh5uGFMExn80 UYcG+if/Y/zB1qs0Y7ESHSI+PaZvMqK3ticGPSBXIpYw2CQcyCZcwdf+7B/IWF/9QHou 6LXw== 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=Oy2Rx4ppnVnDJJxtwN+ju+9m4LhZMArJRTZg/DDaICU=; b=m2IJmCdxLjwW5XuJ+EUR9YEuGB0TCfhFdu4hOqaxUVF+233Zpu0wGG//9xKplhpfLn bTpN2Jt0LM6zitr4jpMTVjLtRsq8jSN83Z7u+gWjGQ3mHdQJSQMbCKTolsoDtIPoRXxI cTz73U033Wz8l2jalHFBqcXW+oHs6dXwCrU7VT69J2+zMAhNkfItKdBNjXBIfxliRdN3 vQDtChuG/dwjbKdqQt9+y2RgNkLW/j3kqS6pGcEqZK/x1VufexDDBIqhVdi41gAKl72u Ivo1lE0yZwJqmNpYt8vJYtvc7lEZ3vHTCWQdN6PZa/QaubTUDClFIJUvXH+BsfYdpPKg 9C3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WLPRAfj/"; 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 eb5si22593657edb.393.2020.12.28.10.44.09; Mon, 28 Dec 2020 10:44:32 -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="WLPRAfj/"; 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 S2391873AbgL1Nli (ORCPT + 99 others); Mon, 28 Dec 2020 08:41:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:41182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391511AbgL1NlA (ORCPT ); Mon, 28 Dec 2020 08:41:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F4CC22A84; Mon, 28 Dec 2020 13:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162819; bh=jlsM12PnKPXZL1Ky68Ox9ha9r6zBCa6jDqNLVuiki0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WLPRAfj/Homk2beFZHmW+/Tx5Zk6cWn0CqCkYSgo1ushswpbuXw+xvE/YT8NWa/s7 /E0TrbnQxwPgAzRZAnFt2pwCSw0ouRxgKqGufvsV7xSQ/FRYulcddq99EzI9+EvDBn Vm/C+eVmAU6/nEaYX6afp9sgeU7ZI56RAS6Y+XAY= 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 5.4 042/453] vxlan: Add needed_headroom for lower device Date: Mon, 28 Dec 2020 13:44:38 +0100 Message-Id: <20201228124939.284399062@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@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 630ac00a34ede..3753cf0942865 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3538,6 +3538,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