aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-05-30 21:10:01 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-01 03:21:20 -0400
commitaa989f5e46bb913e1a5966bb7d32eb2d00c1894e (patch)
treec33501bb56e85a5f1a84d071e531162382467833 /drivers
parent3ffd05159815d477f971a3259fc758f0c3c7e640 (diff)
virtio-net: pass gfp to add_buf
virtio-net bounces buffer allocations off to a thread if it can't allocate buffers from the atomic pool. However, if posting buffers still requires atomic buffers, this is unlikely to succeed. Fix by passing in the proper gfp_t parameter. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/virtio_net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 78eb3190b9b1..1edb7a61983c 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -340,7 +340,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)
340 340
341 skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); 341 skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len);
342 342
343 err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb); 343 err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp);
344 if (err < 0) 344 if (err < 0)
345 dev_kfree_skb(skb); 345 dev_kfree_skb(skb);
346 346
@@ -385,8 +385,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
385 385
386 /* chain first in list head */ 386 /* chain first in list head */
387 first->private = (unsigned long)list; 387 first->private = (unsigned long)list;
388 err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, 388 err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
389 first); 389 first, gfp);
390 if (err < 0) 390 if (err < 0)
391 give_pages(vi, first); 391 give_pages(vi, first);
392 392
@@ -404,7 +404,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp)
404 404
405 sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); 405 sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE);
406 406
407 err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page); 407 err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp);
408 if (err < 0) 408 if (err < 0)
409 give_pages(vi, page); 409 give_pages(vi, page);
410 410