From patchwork Thu Nov 26 12:52:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 333500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFE45C64E7B for ; Thu, 26 Nov 2020 12:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5EA9021D1A for ; Thu, 26 Nov 2020 12:53:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="sq37VNJc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389744AbgKZMxX (ORCPT ); Thu, 26 Nov 2020 07:53:23 -0500 Received: from dvalin.narfation.org ([213.160.73.56]:39320 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389703AbgKZMxW (ORCPT ); Thu, 26 Nov 2020 07:53:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1606395200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zV9ZqDHzPB9d6PtOImamgvuZOteIZ+VW/oQO+TRb7O4=; b=sq37VNJcpPUyveuutj+PATo+Uq9ER3tH2NTmSO/Ymq+2rWJByIjSZsbSO3D8KnbeAYSOWD h+vj9d0RVPDjKVJ0uhAJRD+YuvDCUJqL4ZjMfwgPbGnW+nKoBe6bm1Bgi/U0Mair7BtMBH yj656QvWwdBxWj/6VXVP6WZpcZmAl9A= From: Sven Eckelmann To: netdev@vger.kernel.org Cc: b.a.t.m.a.n@lists.open-mesh.org, linux-kernel@vger.kernel.org, Sven Eckelmann Subject: [PATCH 2/2] vxlan: Copy needed_tailroom from lowerdev Date: Thu, 26 Nov 2020 13:52:47 +0100 Message-Id: <20201126125247.1047977-2-sven@narfation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126125247.1047977-1-sven@narfation.org> References: <20201126125247.1047977-1-sven@narfation.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org While vxlan doesn't need any extra tailroom, the lowerdev might need it. In that case, copy it over to reduce the chance for additional (re)allocations in the transmit path. Signed-off-by: Sven Eckelmann --- drivers/net/vxlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 25b5b5a2dfea..44bb02122526 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3801,6 +3801,8 @@ static void vxlan_config_apply(struct net_device *dev, needed_headroom = lowerdev->hard_header_len; needed_headroom += lowerdev->needed_headroom; + dev->needed_tailroom = lowerdev->needed_tailroom; + max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM); if (max_mtu < ETH_MIN_MTU)