net: support __netdev_alloc_frag to always use GFP_DMA
This make it possible to ensure that any clients which use
__netdev_alloc_frag always allocate memory from the DMA zone.
Change-Id: I608939e8d460cf3e6f39748fd5c73561a051f753
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 330bc0f..8de6707 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -370,6 +370,9 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask)
unsigned long flags;
void *data;
+ if (IS_ENABLED(CONFIG_FORCE_ALLOC_FROM_DMA_ZONE))
+ gfp_mask |= GFP_DMA;
+
local_irq_save(flags);
nc = this_cpu_ptr(&netdev_alloc_cache);
data = __alloc_page_frag(nc, fragsz, gfp_mask);