iwlwifi: fix skb truesize underestimation
authorEric Dumazet <eric.dumazet@gmail.com>
Sat, 24 Mar 2012 04:29:46 +0000 (00:29 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 3 May 2012 14:52:30 +0000 (10:52 -0400)
commited90542b0ce5415050c6fbfca324bccaafa69f2f
treebc8426e780dd399259af2f8ba6e775b613714dc8
parent9d1ceac5c6f7e77ea914de376ec17ced3eb22e5f
iwlwifi: fix skb truesize underestimation

By default, iwlwifi uses order-1 pages (8 KB) to store incoming frames,
but doesnt say so in skb->truesize.

This makes very possible to exhaust kernel memory since these skb evade
normal socket memory accounting.

As struct ieee80211_hdr is going to be pulled before calling IP stack,
there is no need to use dev_alloc_skb() to reserve NET_SKB_PAD bytes.
alloc_skb() is ok in this driver, allowing more tailroom.

Pull beginning of frame in skb header, in the hope we can reuse order-1
pages in the driver immediately for small frames and reduce their
truesize to the minimum (linear skbs)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Neal Cardwell <ncardwell@google.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn-rx.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
drivers/net/wireless/iwlwifi/iwl-trans.h