From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 A8BB4C2BA19 for ; Sat, 11 Apr 2020 23:25:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78F0220787 for ; Sat, 11 Apr 2020 23:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586647520; bh=QfEOgstoRGmlFxrVw9RQTwlfeFNTPU7GVv+PibiPVyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QL6unAPNbbpmFpPc36pnhoKrVTvgWJg+DMHVzKxAFwITbyG47ezb1d18Vy0YGUo05 SPp0fyJp49OrqayazbJ3xczJQb+3itugITJdSghcqfdTvE8/Dwc70bxI4G/UTIYq1g qGQGhhyq6gwMqyFgk+RQXwyac5LEMDdpmHybZLV4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730587AbgDKXZN (ORCPT ); Sat, 11 Apr 2020 19:25:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:52312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729784AbgDKXMS (ORCPT ); Sat, 11 Apr 2020 19:12:18 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7509A20708; Sat, 11 Apr 2020 23:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586646738; bh=QfEOgstoRGmlFxrVw9RQTwlfeFNTPU7GVv+PibiPVyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WBbs/mv0oqqnw6it8gWqlX2Fjs83e9BSlyt5wQIA43RU2EjLt8frNjRKcXMwaxcZy MT0Dk+ZJ6hRq326uCW3uSGgGofU1bnQ3p5Ic//ZHs5HVe7i147jc7E5wfWBqw8PDFk 1oK+Hb8+M7Uja4frqA7kuVgXwmRQXTjwNqyYS4xM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Brian Norris , Ganapathi Bhat , Kalle Valo , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 12/66] mwifiex: set needed_headroom, not hard_header_len Date: Sat, 11 Apr 2020 19:11:09 -0400 Message-Id: <20200411231203.25933-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200411231203.25933-1-sashal@kernel.org> References: <20200411231203.25933-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Brian Norris [ Upstream commit 9454f7a895b822dd8fb4588fc55fda7c96728869 ] hard_header_len provides limitations for things like AF_PACKET, such that we don't allow transmitting packets smaller than this. needed_headroom provides a suggested minimum headroom for SKBs, so that we can trivally add our headers to the front. The latter is the correct field to use in this case, while the former mostly just prevents sending small AF_PACKET frames. In any case, mwifiex already does its own bounce buffering [1] if we don't have enough headroom, so hints (not hard limits) are all that are needed. This is the essentially the same bug (and fix) that brcmfmac had, fixed in commit cb39288fd6bb ("brcmfmac: use ndev->needed_headroom to reserve additional header space"). [1] mwifiex_hard_start_xmit(): if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) { [...] /* Insufficient skb headroom - allocate a new skb */ Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Signed-off-by: Brian Norris Acked-by: Ganapathi Bhat Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 7b74ef71bef1d..af59f622c48e8 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -3025,7 +3025,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, dev->flags |= IFF_BROADCAST | IFF_MULTICAST; dev->watchdog_timeo = MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT; - dev->hard_header_len += MWIFIEX_MIN_DATA_HEADER_LEN; + dev->needed_headroom = MWIFIEX_MIN_DATA_HEADER_LEN; dev->ethtool_ops = &mwifiex_ethtool_ops; mdev_priv = netdev_priv(dev); -- 2.20.1