[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1244743266.9669.64.camel@w-sridhar.beaverton.ibm.com>
Date: Thu, 11 Jun 2009 11:01:06 -0700
From: Sridhar Samudrala <sri@...ibm.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Mark McLoughlin <markmc@...hat.com>,
Rusty Russell <rusty@...tcorp.com.au>,
Danielius Kudinskas <kudinskas@...ibm.com>,
aliguori@...ux.vnet.ibm.com, Paul T Knowles <pablo@...ibm.com>,
netdev@...r.kernel.org
Subject: Re: virtio-net header alignment
On Wed, 2009-06-10 at 15:12 +1000, Herbert Xu wrote:
> On Mon, May 25, 2009 at 05:17:03PM +0100, Mark McLoughlin wrote:
> >
> > Perhaps; would padding struct virtio_net_hdr_mrg_rxbuf have 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.
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
>
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 4d1d479..52fba8e 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)
> 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,
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists