diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-13 01:34:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 14:48:18 -0400 |
commit | 89d71a66c40d629e3b1285def543ab1425558cd5 (patch) | |
tree | 45159e85418170fe36e4e023d9617693625d1740 /drivers/net/virtio_net.c | |
parent | bff1c09640b3006bca711e18ef08a5fb955ad9b5 (diff) |
net: Use netdev_alloc_skb_ip_align()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8d009760277c..556512dc6072 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -283,13 +283,12 @@ static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp) | |||
283 | do { | 283 | do { |
284 | struct skb_vnet_hdr *hdr; | 284 | struct skb_vnet_hdr *hdr; |
285 | 285 | ||
286 | skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); | 286 | skb = netdev_alloc_skb_ip_align(vi->dev, MAX_PACKET_LEN); |
287 | if (unlikely(!skb)) { | 287 | if (unlikely(!skb)) { |
288 | oom = true; | 288 | oom = true; |
289 | break; | 289 | break; |
290 | } | 290 | } |
291 | 291 | ||
292 | skb_reserve(skb, NET_IP_ALIGN); | ||
293 | skb_put(skb, MAX_PACKET_LEN); | 292 | skb_put(skb, MAX_PACKET_LEN); |
294 | 293 | ||
295 | hdr = skb_vnet_hdr(skb); | 294 | hdr = skb_vnet_hdr(skb); |
@@ -344,14 +343,12 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | |||
344 | do { | 343 | do { |
345 | skb_frag_t *f; | 344 | skb_frag_t *f; |
346 | 345 | ||
347 | skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN); | 346 | skb = netdev_alloc_skb_ip_align(vi->dev, GOOD_COPY_LEN); |
348 | if (unlikely(!skb)) { | 347 | if (unlikely(!skb)) { |
349 | oom = true; | 348 | oom = true; |
350 | break; | 349 | break; |
351 | } | 350 | } |
352 | 351 | ||
353 | skb_reserve(skb, NET_IP_ALIGN); | ||
354 | |||
355 | f = &skb_shinfo(skb)->frags[0]; | 352 | f = &skb_shinfo(skb)->frags[0]; |
356 | f->page = get_a_page(vi, gfp); | 353 | f->page = get_a_page(vi, gfp); |
357 | if (!f->page) { | 354 | if (!f->page) { |