Skip to content

Commit 8981f01

Browse files
herbertxdavem330
authored andcommitted
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>
1 parent adf76cf commit 8981f01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/virtio_net.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)
283283
for (;;) {
284284
struct virtio_net_hdr *hdr;
285285

286-
skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN);
286+
skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN);
287287
if (unlikely(!skb))
288288
break;
289289

290+
skb_reserve(skb, NET_IP_ALIGN);
290291
skb_put(skb, MAX_PACKET_LEN);
291292

292293
hdr = skb_vnet_hdr(skb);

0 commit comments

Comments
 (0)