diff options
-rw-r--r-- | include/linux/skbuff.h | 20 | ||||
-rw-r--r-- | net/core/skbuff.c | 13 |
2 files changed, 17 insertions, 16 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 0b53c43ac92e..05a358f1ba11 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -496,13 +496,13 @@ extern struct sk_buff *__alloc_skb(unsigned int size, | |||
496 | static inline struct sk_buff *alloc_skb(unsigned int size, | 496 | static inline struct sk_buff *alloc_skb(unsigned int size, |
497 | gfp_t priority) | 497 | gfp_t priority) |
498 | { | 498 | { |
499 | return __alloc_skb(size, priority, 0, -1); | 499 | return __alloc_skb(size, priority, 0, NUMA_NO_NODE); |
500 | } | 500 | } |
501 | 501 | ||
502 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 502 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
503 | gfp_t priority) | 503 | gfp_t priority) |
504 | { | 504 | { |
505 | return __alloc_skb(size, priority, 1, -1); | 505 | return __alloc_skb(size, priority, 1, NUMA_NO_NODE); |
506 | } | 506 | } |
507 | 507 | ||
508 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); | 508 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); |
@@ -1563,13 +1563,25 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | |||
1563 | return skb; | 1563 | return skb; |
1564 | } | 1564 | } |
1565 | 1565 | ||
1566 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); | 1566 | /** |
1567 | * __netdev_alloc_page - allocate a page for ps-rx on a specific device | ||
1568 | * @dev: network device to receive on | ||
1569 | * @gfp_mask: alloc_pages_node mask | ||
1570 | * | ||
1571 | * Allocate a new page. dev currently unused. | ||
1572 | * | ||
1573 | * %NULL is returned if there is no free memory. | ||
1574 | */ | ||
1575 | static inline struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask) | ||
1576 | { | ||
1577 | return alloc_pages_node(NUMA_NO_NODE, gfp_mask, 0); | ||
1578 | } | ||
1567 | 1579 | ||
1568 | /** | 1580 | /** |
1569 | * netdev_alloc_page - allocate a page for ps-rx on a specific device | 1581 | * netdev_alloc_page - allocate a page for ps-rx on a specific device |
1570 | * @dev: network device to receive on | 1582 | * @dev: network device to receive on |
1571 | * | 1583 | * |
1572 | * Allocate a new page node local to the specified device. | 1584 | * Allocate a new page. dev currently unused. |
1573 | * | 1585 | * |
1574 | * %NULL is returned if there is no free memory. | 1586 | * %NULL is returned if there is no free memory. |
1575 | */ | 1587 | */ |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 752c1972b3a7..4e8b82e167d8 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -247,10 +247,9 @@ EXPORT_SYMBOL(__alloc_skb); | |||
247 | struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | 247 | struct sk_buff *__netdev_alloc_skb(struct net_device *dev, |
248 | unsigned int length, gfp_t gfp_mask) | 248 | unsigned int length, gfp_t gfp_mask) |
249 | { | 249 | { |
250 | int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1; | ||
251 | struct sk_buff *skb; | 250 | struct sk_buff *skb; |
252 | 251 | ||
253 | skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, node); | 252 | skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, NUMA_NO_NODE); |
254 | if (likely(skb)) { | 253 | if (likely(skb)) { |
255 | skb_reserve(skb, NET_SKB_PAD); | 254 | skb_reserve(skb, NET_SKB_PAD); |
256 | skb->dev = dev; | 255 | skb->dev = dev; |
@@ -259,16 +258,6 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | |||
259 | } | 258 | } |
260 | EXPORT_SYMBOL(__netdev_alloc_skb); | 259 | EXPORT_SYMBOL(__netdev_alloc_skb); |
261 | 260 | ||
262 | struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask) | ||
263 | { | ||
264 | int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1; | ||
265 | struct page *page; | ||
266 | |||
267 | page = alloc_pages_node(node, gfp_mask, 0); | ||
268 | return page; | ||
269 | } | ||
270 | EXPORT_SYMBOL(__netdev_alloc_page); | ||
271 | |||
272 | void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, | 261 | void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, |
273 | int size) | 262 | int size) |
274 | { | 263 | { |