[6/6] [VIRTIO] net: Allow receiving SG packets

Herbert Xu herbert at gondor.apana.org.au
Mon Apr 21 18:13:55 PDT 2008


On Mon, Apr 21, 2008 at 01:04:18PM -0700, David Miller wrote:
> From: Rusty Russell <rusty at rustcorp.com.au>
> Date: Tue, 22 Apr 2008 05:06:16 +1000
> 
> > I'm not sure what the right number is here.  Say worst case is header which 
> > goes over a page boundary then MAX_SKB_FRAGS in the skb, but for some reason 
> > that already has a +2:

The +2 (i.e., extra +1) is for the virtio GSO header.
 
> skb->data is linear, therefore it's not possible to need
> more than one scatterlist entry for it.

Theoretically yes :) But for virtualisation the underlying transport
may present meta-physically contiguous memory that is physically
discrete.  So we may actually need to have multiple SG entries for
skb->data.  However, no current code path should generate packets
with both long skb->data areas *and* skb page frags so we could
just drop them if they show up.

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


More information about the Virtualization mailing list