Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 940c2a93 authored by Prakash Gupta's avatar Prakash Gupta Committed by Praveen Kurapati
Browse files

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: default avatarPraveen Kurapati <pkurapat@codeaurora.org>
Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
parent cccfd52b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -398,6 +398,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);