aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-06-11 23:55:17 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-11 23:55:17 -0400
commit8981f01001c616f58f1623ecadfab8b1ed758da7 (patch)
tree338a5439aeb3961b115b5dee85fb52725de21d5b /drivers/net
parentadf76cfe24dab32a54e2dd1f51534cea8277f32a (diff)
virtio_net: Fix IP alignment on non-mergeable RX path
We need to enforce the IP alignment on the non-mergeable RX path just like the other RX path. Not doing so results in misaligned IP headers. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/virtio_net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 09bd4410fa65..f0bb1a4c8323 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)
283 for (;;) { 283 for (;;) {
284 struct virtio_net_hdr *hdr; 284 struct virtio_net_hdr *hdr;
285 285
286 skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN); 286 skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN);
287 if (unlikely(!skb)) 287 if (unlikely(!skb))
288 break; 288 break;
289 289
290 skb_reserve(skb, NET_IP_ALIGN);
290 skb_put(skb, MAX_PACKET_LEN); 291 skb_put(skb, MAX_PACKET_LEN);
291 292
292 hdr = skb_vnet_hdr(skb); 293 hdr = skb_vnet_hdr(skb);