diff options
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bb47314c7179..fe37c21d3a60 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1680,31 +1680,11 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
1680 | kfree_skb(skb); | 1680 | kfree_skb(skb); |
1681 | } | 1681 | } |
1682 | 1682 | ||
1683 | /** | 1683 | extern void *netdev_alloc_frag(unsigned int fragsz); |
1684 | * __dev_alloc_skb - allocate an skbuff for receiving | ||
1685 | * @length: length to allocate | ||
1686 | * @gfp_mask: get_free_pages mask, passed to alloc_skb | ||
1687 | * | ||
1688 | * Allocate a new &sk_buff and assign it a usage count of one. The | ||
1689 | * buffer has unspecified headroom built in. Users should allocate | ||
1690 | * the headroom they think they need without accounting for the | ||
1691 | * built in space. The built in space is used for optimisations. | ||
1692 | * | ||
1693 | * %NULL is returned if there is no free memory. | ||
1694 | */ | ||
1695 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | ||
1696 | gfp_t gfp_mask) | ||
1697 | { | ||
1698 | struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD, gfp_mask); | ||
1699 | if (likely(skb)) | ||
1700 | skb_reserve(skb, NET_SKB_PAD); | ||
1701 | return skb; | ||
1702 | } | ||
1703 | |||
1704 | extern struct sk_buff *dev_alloc_skb(unsigned int length); | ||
1705 | 1684 | ||
1706 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | 1685 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, |
1707 | unsigned int length, gfp_t gfp_mask); | 1686 | unsigned int length, |
1687 | gfp_t gfp_mask); | ||
1708 | 1688 | ||
1709 | /** | 1689 | /** |
1710 | * netdev_alloc_skb - allocate an skbuff for rx on a specific device | 1690 | * netdev_alloc_skb - allocate an skbuff for rx on a specific device |
@@ -1720,11 +1700,25 @@ extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | |||
1720 | * allocates memory it can be called from an interrupt. | 1700 | * allocates memory it can be called from an interrupt. |
1721 | */ | 1701 | */ |
1722 | static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | 1702 | static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, |
1723 | unsigned int length) | 1703 | unsigned int length) |
1724 | { | 1704 | { |
1725 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); | 1705 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); |
1726 | } | 1706 | } |
1727 | 1707 | ||
1708 | /* legacy helper around __netdev_alloc_skb() */ | ||
1709 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | ||
1710 | gfp_t gfp_mask) | ||
1711 | { | ||
1712 | return __netdev_alloc_skb(NULL, length, gfp_mask); | ||
1713 | } | ||
1714 | |||
1715 | /* legacy helper around netdev_alloc_skb() */ | ||
1716 | static inline struct sk_buff *dev_alloc_skb(unsigned int length) | ||
1717 | { | ||
1718 | return netdev_alloc_skb(NULL, length); | ||
1719 | } | ||
1720 | |||
1721 | |||
1728 | static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, | 1722 | static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, |
1729 | unsigned int length, gfp_t gfp) | 1723 | unsigned int length, gfp_t gfp) |
1730 | { | 1724 | { |