[backfire] backport r26906
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches-2.6.32 / 205-skb_padding.patch
1 --- a/include/linux/skbuff.h
2 +++ b/include/linux/skbuff.h
3 @@ -1384,11 +1384,18 @@ static inline int skb_network_offset(con
4 *
5 * Various parts of the networking layer expect at least 32 bytes of
6 * headroom, you should not reduce this.
7 + *
8 + * This has been changed to 64 to acommodate for routing between ethernet
9 + * and wireless, but only for new allocations
10 */
11 #ifndef NET_SKB_PAD
12 #define NET_SKB_PAD 32
13 #endif
14
15 +#ifndef NET_SKB_PAD_ALLOC
16 +#define NET_SKB_PAD_ALLOC 64
17 +#endif
18 +
19 extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
20
21 static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
22 @@ -1478,9 +1485,9 @@ static inline void __skb_queue_purge(str
23 static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
24 gfp_t gfp_mask)
25 {
26 - struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);
27 + struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD_ALLOC, gfp_mask);
28 if (likely(skb))
29 - skb_reserve(skb, NET_SKB_PAD);
30 + skb_reserve(skb, NET_SKB_PAD_ALLOC);
31 return skb;
32 }
33
34 @@ -1553,7 +1560,7 @@ static inline int __skb_cow(struct sk_bu
35 delta = headroom - skb_headroom(skb);
36
37 if (delta || cloned)
38 - return pskb_expand_head(skb, ALIGN(delta, NET_SKB_PAD), 0,
39 + return pskb_expand_head(skb, ALIGN(delta, NET_SKB_PAD_ALLOC), 0,
40 GFP_ATOMIC);
41 return 0;
42 }
43 --- a/net/core/skbuff.c
44 +++ b/net/core/skbuff.c
45 @@ -339,9 +339,9 @@ struct sk_buff *__netdev_alloc_skb(struc
46 int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
47 struct sk_buff *skb;
48
49 - skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, node);
50 + skb = __alloc_skb(length + NET_SKB_PAD_ALLOC, gfp_mask, 0, node);
51 if (likely(skb)) {
52 - skb_reserve(skb, NET_SKB_PAD);
53 + skb_reserve(skb, NET_SKB_PAD_ALLOC);
54 skb->dev = dev;
55 }
56 return skb;