aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-07-11 23:08:34 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-11 23:08:34 -0400
commit4915a0de43c3e9aef92005c1f94a8ff3a6cfced5 (patch)
tree8c387b4248593430418083c9ea4f2f7416abdd54 /include/linux/skbuff.h
parent039f02ebd9c2f3f3cb95c00b763fb70870c9116e (diff)
net: introduce __netdev_alloc_skb_ip_align
RX rings should use GFP_KERNEL allocations if possible, add __netdev_alloc_skb_ip_align() helper to ease this. 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.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 32ada5351ab4..a24218c9c84b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1579,16 +1579,22 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1579 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1579 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1580} 1580}
1581 1581
1582static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, 1582static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
1583 unsigned int length) 1583 unsigned int length, gfp_t gfp)
1584{ 1584{
1585 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); 1585 struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
1586 1586
1587 if (NET_IP_ALIGN && skb) 1587 if (NET_IP_ALIGN && skb)
1588 skb_reserve(skb, NET_IP_ALIGN); 1588 skb_reserve(skb, NET_IP_ALIGN);
1589 return skb; 1589 return skb;
1590} 1590}
1591 1591
1592static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1593 unsigned int length)
1594{
1595 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1596}
1597
1592/** 1598/**
1593 * __netdev_alloc_page - allocate a page for ps-rx on a specific device 1599 * __netdev_alloc_page - allocate a page for ps-rx on a specific device
1594 * @dev: network device to receive on 1600 * @dev: network device to receive on