diff options
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) { |