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=ham 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 EBAB7C2BBC7 for ; Sat, 11 Apr 2020 23:20:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF82B20769 for ; Sat, 11 Apr 2020 23:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586647238; bh=bLBnbysrKfsk8Dar8PPtGfq5wiM7ssyB9QACtB20Xl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=khJ7hiq7DHilA1rh6/AcFaH/DQBv0f7yznfI0UprSczR7eKflvlxb9k9yALs3AE6J lc0ymVhwsbIw9SFpNwIfOzpnpVXM2VQYqHHBB0i585hqhFxK7Ch2MyQ5OQBCLkuGCL F0kbx1dXiqZQ8rG+DJzSiSJZHbbtOUAwXQuVW9mo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730771AbgDKXUh (ORCPT ); Sat, 11 Apr 2020 19:20:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:54986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbgDKXNj (ORCPT ); Sat, 11 Apr 2020 19:13:39 -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 BBB7E21BE5; Sat, 11 Apr 2020 23:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586646819; bh=bLBnbysrKfsk8Dar8PPtGfq5wiM7ssyB9QACtB20Xl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x7xzPEKcL3M+pHE99AWi8HxIXD7tP6T3iXUXKIoM3bEGeNGxlAnVxlcEcJfTx1vlm /TxBBhb5YL5FqjVqa4Fd1PSU2lidOzdE49xJXKh/rwpXdl50EW1jJ1bYK/PSggM4VV 9CYkEoAq5vLLmMZt9ex+bN8XO1nFNbBYX9Z82n/g= 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.14 10/37] mwifiex: set needed_headroom, not hard_header_len Date: Sat, 11 Apr 2020 19:12:59 -0400 Message-Id: <20200411231327.26550-10-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200411231327.26550-1-sashal@kernel.org> References: <20200411231327.26550-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 5e8e34a08b2d6..638e1fa64eea1 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -3007,7 +3007,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