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

Commit 310e158c authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: respect GFP_DMA in __netdev_alloc_skb()



Few drivers use GFP_DMA allocations, and netdev_alloc_frag()
doesn't allocate pages in DMA zone.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ac2908e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
	unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) +
			      SKB_DATA_ALIGN(sizeof(struct skb_shared_info));

	if (fragsz <= PAGE_SIZE && !(gfp_mask & __GFP_WAIT)) {
	if (fragsz <= PAGE_SIZE && !(gfp_mask & (__GFP_WAIT | GFP_DMA))) {
		void *data = netdev_alloc_frag(fragsz);

		if (likely(data)) {