From patchwork Thu Nov 26 17:18:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 18225 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 5B9A0814F9; Thu, 26 Nov 2020 18:18:44 +0100 (CET) Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56]) by diktynna.open-mesh.org (Postfix) with ESMTPS id 2D7B98009A for ; Thu, 26 Nov 2020 18:18:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1606411120; 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; bh=pS2LeujNcJqZrUhhZI/obc8+zVdZSGuw/F4eMsIbKn8=; b=djNUpD5z5cyuzlFMNeSFMJm8mfSskqklGAQrtPaZtnsDqZMldxfenLZk6bzq+yIK2Rq7mc bqQu3g2AdgD91ElQctWJM6ESs+pWQhPHg1fmPTp/T3DLHVMgsw+DLTBbeEoO6n5HBEBBNp TeLZLRlhPOCl8G78z60fI/kjQ71UUTw= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Cc: Sven Eckelmann , =?utf-8?q?Linus_L=C3=BCssing?= Subject: [PATCH] batman-adv: Consider fragmentation for needed_headroom Date: Thu, 26 Nov 2020 18:18:32 +0100 Message-Id: <20201126171832.1064799-1-sven@narfation.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh.org; s=20121; t=1606411121; 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:dkim-signature; bh=pS2LeujNcJqZrUhhZI/obc8+zVdZSGuw/F4eMsIbKn8=; b=Uqu3mjXCuIHANl6NF0Jq9RYS2iLYxzANzctjaLqh9ZU5vzu0KYz2osbTkv+VBDl6cF8IT5 psYivDBO7czW88+kcV+hwEPC6WJTHfVhmiFD/lJjeVyiviBzlQJv/YtCxWlrsl7EiSlHxe LSMZ+UtSBZ+FVgPat+eV0Wye1vNg9CY= ARC-Seal: i=1; s=20121; d=open-mesh.org; t=1606411121; a=rsa-sha256; cv=none; b=z2Blye3gjNSZZ2qxYOEObdB6m5ZsPpKe6+rH7pXH0Ja0ibOlZCi2Gr/4n4bMgPb0XJntws KSP8a18Tl7sEkr5lnifqpEFuhjmJ94gveIcYZ4kNQAwju5RMGd/PPee5MYcmhtBh/Hx0bs m0dK8MAXgz2G7Ui1cWPXKZ7XRWnZ+GQ= ARC-Authentication-Results: i=1; diktynna.open-mesh.org; dkim=pass header.d=narfation.org header.s=20121 header.b=djNUpD5z; spf=pass (diktynna.open-mesh.org: domain of sven@narfation.org designates 213.160.73.56 as permitted sender) smtp.mailfrom=sven@narfation.org Message-ID-Hash: 2VVKTTFDVTDLBYXCIU7U4F4XOXQPDBG4 X-Message-ID-Hash: 2VVKTTFDVTDLBYXCIU7U4F4XOXQPDBG4 X-MailFrom: sven@narfation.org 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 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: 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 splitted. This size must be considered to avoid cost intensive reallocations during the transmission through the various device layers. Reported-by: Linus Lüssing Signed-off-by: Sven Eckelmann --- 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 f122e448..bbedb9a4 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -553,6 +553,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; }