Subject: Re: virtio_net: Set correct gso->hdr_len

From: Rusty Russell <[email-masked]>
Date: Fri, 5 Jun 2009 16:20:02 +0930

On Fri, 5 Jun 2009 01:57:09 pm Herbert Xu wrote:
> On Fri, Jun 05, 2009 at 01:51:05PM +0930, Rusty Russell wrote:
> > But are we allowed to make the assumption that skb_headlen() ==
> > skb_transport_header(skb) + sizeof(transport header) ?  Or should we be
> > checking that here?
>
> We don't care.  We just want to preserve whatever the OS gave us.
> If it's bogus, the backend will reject it or fix it up.

Right, understood now.  It really is just a hint as to how much to copy.  It 
wasn't supposed to be that, as virtio_net.h:

	__u16 hdr_len;		/* Ethernet + IP + tcp/udp hdrs */
	__u16 gso_size;		/* Bytes to append to hdr_len per frame */

The host was supposed to be able to de-gso packets together relying on 
hdr_len.  But that's silly: it can't do TSO without knowing about sequence 
numbers at least, and UFO without ip fragmentation offsets.  ie. it might as 
well calc hdr_len itself.

I'm working on a proper spec, I'll be sure to note this.

Thanks,
Rusty.