net: support __netdev_alloc_skb to always use GFP_DMA
This make it possible to ensure that any clients which use __netdev_alloc_skb always allocate memory from the DMA zone. Change-Id: Ia2a32905ac8f3e1b26fd6bcee5a04b96bdf29bef Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
This commit is contained in:
parent
b1c46e3dc3
commit
7825e1e929
1 changed files with 3 additions and 0 deletions
|
@ -416,6 +416,9 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len,
|
|||
|
||||
len += NET_SKB_PAD;
|
||||
|
||||
if (IS_ENABLED(CONFIG_FORCE_ALLOC_FROM_DMA_ZONE))
|
||||
gfp_mask |= GFP_DMA;
|
||||
|
||||
if ((len > SKB_WITH_OVERHEAD(PAGE_SIZE)) ||
|
||||
(gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA))) {
|
||||
skb = __alloc_skb(len, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE);
|
||||
|
|
Loading…
Add table
Reference in a new issue