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

Commit dc8e3dea authored by Liam Mark's avatar Liam Mark Committed by Patrick Daly
Browse files

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: default avatarLiam Mark <lmark@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 284f2b89
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -370,6 +370,9 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask)
	unsigned long flags;
	unsigned long flags;
	void *data;
	void *data;


	if (IS_ENABLED(CONFIG_FORCE_ALLOC_FROM_DMA_ZONE))
		gfp_mask |= GFP_DMA;

	local_irq_save(flags);
	local_irq_save(flags);
	nc = this_cpu_ptr(&netdev_alloc_cache);
	nc = this_cpu_ptr(&netdev_alloc_cache);
	data = __alloc_page_frag(nc, fragsz, gfp_mask);
	data = __alloc_page_frag(nc, fragsz, gfp_mask);