From patchwork Fri Nov 27 17:38:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 18228 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from diktynna.open-mesh.org (localhost [IPv6:::1]) by diktynna.open-mesh.org (Postfix) with ESMTP id 0FB27822BF; Fri, 27 Nov 2020 18:39:02 +0100 (CET) Received: from simonwunderlich.de (simonwunderlich.de [79.140.42.25]) by diktynna.open-mesh.org (Postfix) with ESMTPS id A3E13814F4 for ; Fri, 27 Nov 2020 18:38:58 +0100 (CET) Received: from kero.packetmixer.de (p200300c59712a4e04204e2f79fd8c031.dip0.t-ipconnect.de [IPv6:2003:c5:9712:a4e0:4204:e2f7:9fd8:c031]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simonwunderlich.de (Postfix) with ESMTPSA id 55E92174060; Fri, 27 Nov 2020 18:38:58 +0100 (CET) From: Simon Wunderlich To: davem@davemloft.net, kuba@kernel.org Subject: [PATCH 1/3] batman-adv: Consider fragmentation for needed_headroom Date: Fri, 27 Nov 2020 18:38:47 +0100 Message-Id: <20201127173849.19208-2-sw@simonwunderlich.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201127173849.19208-1-sw@simonwunderlich.de> References: <20201127173849.19208-1-sw@simonwunderlich.de> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh.org; s=20121; t=1606498738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/H0LJ5b0vEDoCN7kJrsYfl3X0ixcV79CGy+Ez/ft0gw=; b=vIJbLJ+zpj1q9SQU98SFVsvvcJ1H92dLvY3MMYiSaSzAnyg7Re5F0L0zNmrRU77jN8otB0 SUe5pAsWwU7D8dN/iKRtBco9F/6VL1T3G3fIzvpINbQjrdzerUarZmSBow7uc3isUxMqOR fqROOytP13TifYoB1ddUSCGYblJ+Kps= ARC-Seal: i=1; s=20121; d=open-mesh.org; t=1606498738; a=rsa-sha256; cv=none; b=M2os4DWBmN7NOpbE+LQOyaj7ViDc6lCIsQmRE/aCVI9anvxSdHSItJkkbA+TivBu0UF4tV Tits8DQs3ywehlYPE6/R3mIis6IXOVZd9Rezi1Pm+o/EEjclWMTh2zVyi1yZDZcpRAnFMf zksXHDHsN5kMxtmQc+lmsg4MtvzpE24= ARC-Authentication-Results: i=1; diktynna.open-mesh.org; dkim=none; spf=pass (diktynna.open-mesh.org: domain of sw@simonwunderlich.de designates 79.140.42.25 as permitted sender) smtp.mailfrom=sw@simonwunderlich.de Message-ID-Hash: IFGDHCOZ34KJSXD3TQDKIZCJZPXNSZP5 X-Message-ID-Hash: IFGDHCOZ34KJSXD3TQDKIZCJZPXNSZP5 X-MailFrom: sw@simonwunderlich.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-b.a.t.m.a.n.lists.open-mesh.org-0; header-match-b.a.t.m.a.n.lists.open-mesh.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 3.2.1 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Sven Eckelmann If a batman-adv packets has to be fragmented, then the original batman-adv packet header is not stripped away. Instead, only a new header is added in front of the packet after it was split. This size must be considered to avoid cost intensive reallocations during the transmission through the various device layers. Fixes: 7bca68c7844b ("batman-adv: Add lower layer needed_(head|tail)room to own ones") Reported-by: Linus Lüssing Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich --- net/batman-adv/hard-interface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index dad99641df2a..33904595fc56 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -554,6 +554,9 @@ static void batadv_hardif_recalc_extra_skbroom(struct net_device *soft_iface) needed_headroom = lower_headroom + (lower_header_len - ETH_HLEN); needed_headroom += batadv_max_header_len(); + /* fragmentation headers don't strip the unicast/... header */ + needed_headroom += sizeof(struct batadv_frag_packet); + soft_iface->needed_headroom = needed_headroom; soft_iface->needed_tailroom = lower_tailroom; }