virtio-net header alignment
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): OF1B881599.F1B4A2EF-ON802575BB.0036EA40-802575BC.0041BFB5@au1.ibm.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1243268223.32745.25.camel@blaa
Quoted 4 lines · Mark McLoughlin
Perhaps; would padding struct
virtio_net_hdr_mrg_rxbufhave avoided it?Cc-ing Herbert, he initially wrote the guest side of this.
Does this fix it?
virtio_net: Fix IP alignment on mergeable RX path
We need to enforce the IP alignment on the mergeable RX path just like the other RX path. Not doing so results in misaligned IP headers.
drivers/net/virtio_net.c +2 -1
@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)for (;;) {struct virtio_net_hdr *hdr; - skb =netdev_alloc_skb (vi->dev,MAX_PACKET_LEN ); + skb =netdev_alloc_skb (vi->dev,MAX_PACKET_LEN +NET_IP_ALIGN );if (unlikely (!skb))break ; +skb_reserve (skb,NET_IP_ALIGN );skb_put (skb,MAX_PACKET_LEN ); hdr =skb_vnet_hdr (skb);
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtDavid Miller
maintainerFrom: Herbert Xu <[email protected]>
Date: Wed, 10 Jun 2009 15:12:27 +1000
Quoted 8 lines · Mark McLoughlin
Quoted 4 lines
Perhaps; would padding struct
virtio_net_hdr_mrg_rxbufhave avoided it?Cc-ing Herbert, he initially wrote the guest side of this.
Does this fix it?
Quoted 7 lines
virtio_net: Fix IP alignment on mergeable RX pathWe need to enforce the IP alignment on the mergeable RX path just like the other RX path. Not doing so results in misaligned IP headers.
Signed-off-by Herbert Xu <[email protected]>
I'll apply this as soon as I see some test reports.
Has anyone had a chance to try this out yet?
Quoted 6 lines · Herbert Xu
Quoted 4 lines · Mark McLoughlin
Perhaps; would padding struct
virtio_net_hdr_mrg_rxbufhave avoided it?Cc-ing Herbert, he initially wrote the guest side of this.
Quoted 7 lines
Does this fix it?
virtio_net: Fix IP alignment on mergeable RX pathWe need to enforce the IP alignment on the mergeable RX path just like the other RX path. Not doing so results in misaligned IP headers.
I think this fixes the old RX path rather than the mergeable RX path. try_fill_recv_maxbufs() is called from try_fill_recv()
if (!vi->mergeable_rx_bufs) {
try_fill_recv_maxbufs(vi);
return;
}-Sridhar
Quoted 22 lines
Signed-off-by Herbert Xu <[email protected]>drivers/net/virtio_net.c +2
-1@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)for (;;) {struct virtio_net_hdr *hdr; - skb =netdev_alloc_skb (vi->dev,MAX_PACKET_LEN ); + skb =netdev_alloc_skb (vi->dev,MAX_PACKET_LEN +NET_IP_ALIGN );if (unlikely (!skb))break ; +skb_reserve (skb,NET_IP_ALIGN );skb_put (skb,MAX_PACKET_LEN ); hdr =skb_vnet_hdr (skb);Cheers,
Quoted 8 lines · Sridhar Samudrala
I think this fixes the old RX path rather than the mergeable RX path.
try_fill_recv_maxbufs()is called fromtry_fill_recv()if (!vi->mergeable_rx_bufs) { try_fill_recv_maxbufs(vi); return; }
Yes you're right. We should do s/mergeable/non-mergeable/ in the changelog :)
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtPATCH 1/1 virtio_net: Fix IP alignment on non-mergeable RX path
From: Herbert Xu <[email protected]>
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.
drivers/net/virtio_net.c +2 -1
@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)for (;;) {struct virtio_net_hdr *hdr; - skb =netdev_alloc_skb (vi->dev,MAX_PACKET_LEN ); + skb =netdev_alloc_skb (vi->dev,MAX_PACKET_LEN +NET_IP_ALIGN );if (unlikely (!skb))break ; +skb_reserve (skb,NET_IP_ALIGN );skb_put (skb,MAX_PACKET_LEN ); hdr =skb_vnet_hdr (skb);
Re: [PATCH] virtio_net: Fix IP alignment on non-mergeable RX path
From: Rusty Russell <[email protected]>
Date: Fri, 12 Jun 2009 08:29:22 +0930
Quoted 8 lines
From: Herbert Xu <[email protected]>
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 <[email protected]>Signed-off-by Rusty Russell <[email protected]>
Applied, thanks everyone.