Files
i2som-imx-linux/include/linux
Eric Dumazet 0df29c4a28 tcp: avoid order-1 allocations on wifi and tx path
[ This combines upstream commit
  a21d45726a and the follow-on bug fix
  commit a21d45726a ]

Marc Merlin reported many order-1 allocations failures in TX path on its
wireless setup, that dont make any sense with MTU=1500 network, and non
SG capable hardware.

After investigation, it turns out TCP uses sk_stream_alloc_skb() and
used as a convention skb_tailroom(skb) to know how many bytes of data
payload could be put in this skb (for non SG capable devices)

Note : these skb used kmalloc-4096 (MTU=1500 + MAX_HEADER +
sizeof(struct skb_shared_info) being above 2048)

Later, mac80211 layer need to add some bytes at the tail of skb
(IEEE80211_ENCRYPT_TAILROOM = 18 bytes) and since no more tailroom is
available has to call pskb_expand_head() and request order-1
allocations.

This patch changes sk_stream_alloc_skb() so that only
sk->sk_prot->max_header bytes of headroom are reserved, and use a new
skb field, avail_size to hold the data payload limit.

This way, order-0 allocations done by TCP stack can leave more than 2 KB
of tailroom and no more allocation is performed in mac80211 layer (or
any layer needing some tailroom)

avail_size is unioned with mark/dropcount, since mark will be set later
in IP stack for output packets. Therefore, skb size is unchanged.

Reported-by: Marc MERLIN <marc@merlins.org>
Tested-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-27 10:17:06 -07:00
..
2012-01-22 15:08:43 -05:00
2012-02-20 19:46:36 +11:00
2012-01-12 20:13:04 -08:00
2012-01-12 20:13:08 -08:00
2012-01-17 15:40:51 -08:00
2012-04-02 10:31:52 -07:00
2012-01-12 20:13:10 -08:00
2012-04-27 10:16:53 -07:00
2012-01-12 15:23:04 -08:00
2012-03-05 15:49:42 -08:00
2012-02-28 15:06:33 -05:00
2012-01-24 12:25:14 -08:00