Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1930840pxu; Sun, 13 Dec 2020 07:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4tGM9e9AEYI3EPfnHyC359l3fXPkfJH0pZSDqQgMuFe4dcpPns3987zjcvixHfsjSAL93 X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr19507095ejn.484.1607875120706; Sun, 13 Dec 2020 07:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607875120; cv=none; d=google.com; s=arc-20160816; b=YJ+3AJGaEb0Knb3aSGlBZhl/5S7lG9skv84TqmghP91JDSN39mzNimN4Un5MSICdoe wC7ueUWDwXTGdsVDY2cNPKO0YA3fjQ3CNtzckibxFiz5RBzroMRtZFrZ+z20pbTsr47q Bibm1jkuV/wpeaT/crexVVJBPa2qJd4cWwQQv7y7b9xW5aLnxXWxCOZhg81P8MYQ+Jda b4yZe+28rgA5M0e0CpOZAr1eb3hev9OetzmQga/So2UH1ox5j/Yv+Td8jzyIJFCUvZwg naA8OSOqZv/jA3n4gQZyuxWkqiqzwhgJkaJL1r7XU18HrTm2RFx0duCdS9UvLeXj7G7a nA6Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kBwXN0n1mPR8jTbRwP3WZbAzkaAz+2inDSkqCux2Poc=; b=h/NheTZhi5DDHKCMdCJT355FeIRb+KvykpCtrfyWqer1Szjo2VGQYkw41gGXYOqaE6 yHS+3QrsUwr1ARgw6tjyLO9zGyX90BL1JFAUtynVih72Ox/IappirNPqK+ONiW04yO/O 1jDG0B2kR+DPuAXEjOl0FpwehUSYQ2TkHNlhFYttFpwiwUkuMTaeABg5kwrV9lI8mAc3 RQcwWAfOS/3m+DR5lAcuwhItaZvXBYQ4S25QNgqUnkQWn+/MHQ44/sH38VZd5drzu1lH hwflyLLJtsGNK99BswPE2hal/vtjyZPIubibt8M29L/hLFX5SyB8npZr+Qm/0i1UE0OQ tROg== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y23si8184585ejc.508.2020.12.13.07.58.18; Sun, 13 Dec 2020 07:58:40 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439490AbgLLQKm (ORCPT + 99 others); Sat, 12 Dec 2020 11:10:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:57712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439353AbgLLQJg (ORCPT ); Sat, 12 Dec 2020 11:09:36 -0500 From: Sasha Levin Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sven Eckelmann , Annika Wickert , Annika Wickert , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.9 13/23] vxlan: Add needed_headroom for lower device Date: Sat, 12 Dec 2020 11:07:54 -0500 Message-Id: <20201212160804.2334982-13-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201212160804.2334982-1-sashal@kernel.org> References: <20201212160804.2334982-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 b248d9e694254..85c4a6bfc7c06 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3802,6 +3802,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