source: trunk/target/linux/generic-2.6/patches-2.6.33/205-skb_padding.patch @ 20767

Last change on this file since 20767 was 20767, checked in by florian, 7 years ago

[kernel] refresh patches

File size: 1.8 KB
  • include/linux/skbuff.h

    a b static inline int skb_network_offset(con 
    13781378 * 
    13791379 * Various parts of the networking layer expect at least 32 bytes of 
    13801380 * headroom, you should not reduce this. 
     1381 * 
     1382 * This has been changed to 64 to acommodate for routing between ethernet 
     1383 * and wireless, but only for new allocations 
    13811384 */ 
    13821385#ifndef NET_SKB_PAD 
    13831386#define NET_SKB_PAD     32 
    13841387#endif 
    13851388 
     1389#ifndef NET_SKB_PAD_ALLOC 
     1390#define NET_SKB_PAD_ALLOC       64 
     1391#endif 
     1392 
    13861393extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); 
    13871394 
    13881395static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 
    static inline void __skb_queue_purge(str 
    14721479static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 
    14731480                                              gfp_t gfp_mask) 
    14741481{ 
    1475         struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD, gfp_mask); 
     1482        struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD_ALLOC, gfp_mask); 
    14761483        if (likely(skb)) 
    1477                 skb_reserve(skb, NET_SKB_PAD); 
     1484                skb_reserve(skb, NET_SKB_PAD_ALLOC); 
    14781485        return skb; 
    14791486} 
    14801487 
    static inline int __skb_cow(struct sk_bu 
    15571564                delta = headroom - skb_headroom(skb); 
    15581565 
    15591566        if (delta || cloned) 
    1560                 return pskb_expand_head(skb, ALIGN(delta, NET_SKB_PAD), 0, 
     1567                return pskb_expand_head(skb, ALIGN(delta, NET_SKB_PAD_ALLOC), 0, 
    15611568                                        GFP_ATOMIC); 
    15621569        return 0; 
    15631570} 
  • net/core/skbuff.c

    a b struct sk_buff *__netdev_alloc_skb(struc 
    339339        int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1; 
    340340        struct sk_buff *skb; 
    341341 
    342         skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, node); 
     342        skb = __alloc_skb(length + NET_SKB_PAD_ALLOC, gfp_mask, 0, node); 
    343343        if (likely(skb)) { 
    344                 skb_reserve(skb, NET_SKB_PAD); 
     344                skb_reserve(skb, NET_SKB_PAD_ALLOC); 
    345345                skb->dev = dev; 
    346346        } 
    347347        return skb; 
Note: See TracBrowser for help on using the repository browser.