Explorar o código

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: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet %!s(int64=13) %!d(string=hai) anos
pai
achega
310e158cc3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      net/core/skbuff.c

+ 1 - 1
net/core/skbuff.c

@@ -353,7 +353,7 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
 	unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) +
 	unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) +
 			      SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
 			      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);
 		void *data = netdev_alloc_frag(fragsz);
 
 
 		if (likely(data)) {
 		if (likely(data)) {