diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-07 13:11:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 06:44:03 -0400 |
commit | 61321bbd6235ca9a40ba3bc249e8906cc66233c3 (patch) | |
tree | 20f50af5ea5cef41ca28dcc8e79f9a7cc2a52579 /include/linux/skbuff.h | |
parent | f373b53b5fe67aa4a6f28f921a529cc90f88e79b (diff) |
net: Add netdev_alloc_skb_ip_align() helper
Instead of hardcoding NET_IP_ALIGN stuff in various network drivers,
we can add a helper around netdev_alloc_skb()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 8c866b5cb97b..0c68fbd6faac 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1491,6 +1491,16 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1491 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); | 1491 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | ||
1495 | unsigned int length) | ||
1496 | { | ||
1497 | struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); | ||
1498 | |||
1499 | if (NET_IP_ALIGN && skb) | ||
1500 | skb_reserve(skb, NET_IP_ALIGN); | ||
1501 | return skb; | ||
1502 | } | ||
1503 | |||
1494 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); | 1504 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); |
1495 | 1505 | ||
1496 | /** | 1506 | /** |