WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [0/5] [NET]: Add TSO support

On Thu, Jun 29, 2006 at 10:02:20AM +0100, Keir Fraser wrote:
>
> >For TSO, gso_segs can be easily determined from the packet and 
> >gso_size.
> >However, for GSO, we don't know the packet header length so the same is
> >not true.
> 
> Each segment will need a header though, I'd imagine, so whoever does 
> the segmentation needs to know the packet header length? Maybe I'm just 

The code or chip that actually does the segmentation will obviously
know the header length.  However, netback or netfront does not.

Since Linux requires gso_segs to be set (it's used to figure out how
many packets there are going to be before segmentation takes place),
we really need to set it at the source where the packet is produced.

For another OS that only supports TSO, they would simply have to set
gso_segs in the frontend driver.

> confused. :-) Could you briefly explain what the inter-domain data 
> format would be (e.g., is there a header, etc.), and gso_{size,segs}, 
> for some arbitrary IP-encapsulated protocol? And how that information 

GSO packets are simply given as one continuous chunk of data with a
gso_type that determines the protocol (e.g., TCPv4 or UDPv4) and a
set of features that the packet requires (e.g., header verification or
ECN for TCPv4).

The parameter gso_size is required to perform the actual segmentation.

The parameter gso_segs is used by bits that sit in front of the actual
segmentation to figure out how many segments will be produced.

> would be used to perform segmentation in the backend domain? Is the 
> segmentation algorithm any different at all when the protocol is 
> specifically TCPv4? I'd like to add some documentation of all this to 
> netif.h when I have it clear in my head.

How segmentation is performed is protocol-specific.  In general, all
headers are duplicated and modified for each segment.  The modification
is protocol-specific.  For TCP it involves clearing header flags depending
on whether it's the first, a middle or the last packet, changing the
sequence number and checksum.

You can have a look at the tcp_segment in net/ipv4/tcp.c.  The only catch
is that most of the hardware out there can't deal with ECN so by default
we turn that off (that'll actually change soon now that GSO is here).

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel