Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2809884pxu; Mon, 14 Dec 2020 11:23:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuwbpFHUJjwraWMCAq0bbOt93rz1RpwfxOmLd4/Ami24Y0FTa8xVOvJrUYQbR7MWd+Uxxy X-Received: by 2002:a17:906:ec9:: with SMTP id u9mr2972622eji.400.1607973792405; Mon, 14 Dec 2020 11:23:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607973792; cv=none; d=google.com; s=arc-20160816; b=E7tzJ553okxBcYf1Xmob1i9QKpTujdkeGeFC3cx/oezV6i26oQ6FaD6HgmZhtP5WzL sVpnyivHXGzbn/2yQfvQOumKSIS9OMOR8rdfRNzulmCd8bCDW9auSMN3mJwWh+DM27Jb RHeuswKdeh8DCMvMWaDBFNMmvAbpSP3uJmwzkAtPZ80nBtBNOYQ7eGRGJhW+ypkqWP2M xSB+Su9AQh9OPVu4/wMUfdKMo95Z2+UmTV9+RwXxdNQdm0hl/y1tPPwiDHvlpi++wPLn /ABBy1BHtzsFLT0omob43RG0yxbP/Avb94L1bML9glba/RCALdQNCHUw1h7ce7jALbvT w4HQ== 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; bh=tFsm6l25MMnosXiDVkeq9dWu+Lgc6fWQuf5lQ4NaLxU=; b=hPZtRvDCI3w0r69KF7bgqCGHQpFTD9EhXp+/yyu5UMBnpenkmUKTWgSo8+8rNxarvE ExFSCb4lsGKAMHLyvJpVjmHqcjMWtgk9PVLOAEPFS7KD4RcZvzm/ZI0EGGy4Kb3e2fBq fzViZoq4ocsWvIflBADQI3JFicrgi3wRAGOZ38zve9Nc2sGJtlf1hG5HL14ON9ER3hdD kMQ7i4nxYHLFrsWNFDJjM3O0CAnEiBNB1oHHd+D926HGAbgo/ALuYU0ySuzZdv2VOtTM QSsXRk5AA8gi+yfDgPtdwEFxH6nT5qmcIwnrZ0mo3LcRp+wdS2dHJBL3jj+XBpefJGz1 BIOw== 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=fail (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 h12si10572710eje.122.2020.12.14.11.22.48; Mon, 14 Dec 2020 11:23:12 -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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502668AbgLNTHh (ORCPT + 99 others); Mon, 14 Dec 2020 14:07:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:47556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408575AbgLNRhE (ORCPT ); Mon, 14 Dec 2020 12:37:04 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Linus=20L=C3=BCssing?= , Sven Eckelmann , Simon Wunderlich , Sasha Levin Subject: [PATCH 5.9 011/105] batman-adv: Consider fragmentation for needed_headroom Date: Mon, 14 Dec 2020 18:27:45 +0100 Message-Id: <20201214172555.823340072@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214172555.280929671@linuxfoundation.org> References: <20201214172555.280929671@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 4ca23e2c2074465bff55ea14221175fecdf63c5f ] 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 Signed-off-by: Sasha Levin --- 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 fa06b51c0144d..d72c183919b44 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; } -- 2.27.0