]> git.baikalelectronics.ru Git - kernel.git/commit
mwifiex: set needed_headroom, not hard_header_len
authorBrian Norris <briannorris@chromium.org>
Thu, 27 Feb 2020 00:05:11 +0000 (16:05 -0800)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 12 Mar 2020 13:41:50 +0000 (15:41 +0200)
commit092a37972c71e75e8a936e4831a8edcc8d3b84aa
tree2678ee2aaabdf58c1467b39e39b43cf10912caf4
parent37dace7fbe4a2120a1b8bd440dde50986a78da3e
mwifiex: set needed_headroom, not hard_header_len

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 2b7455214d48 ("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: 0564d842e815 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Acked-by: Ganapathi Bhat <ganapathi.gbhat@nxp.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/cfg80211.c