diff options
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 8bd248a64879..7f7bb1a636d9 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -263,6 +263,26 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | |||
263 | return skb; | 263 | return skb; |
264 | } | 264 | } |
265 | 265 | ||
266 | struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask) | ||
267 | { | ||
268 | int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1; | ||
269 | struct page *page; | ||
270 | |||
271 | page = alloc_pages_node(node, gfp_mask, 0); | ||
272 | return page; | ||
273 | } | ||
274 | EXPORT_SYMBOL(__netdev_alloc_page); | ||
275 | |||
276 | void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, | ||
277 | int size) | ||
278 | { | ||
279 | skb_fill_page_desc(skb, i, page, off, size); | ||
280 | skb->len += size; | ||
281 | skb->data_len += size; | ||
282 | skb->truesize += size; | ||
283 | } | ||
284 | EXPORT_SYMBOL(skb_add_rx_frag); | ||
285 | |||
266 | /** | 286 | /** |
267 | * dev_alloc_skb - allocate an skbuff for receiving | 287 | * dev_alloc_skb - allocate an skbuff for receiving |
268 | * @length: length to allocate | 288 | * @length: length to allocate |