Skip to content
  • Herbert Xu's avatar
    gro: Add page frag support · 5d38a079
    Herbert Xu authored
    
    
    This patch allows GRO to merge page frags (skb_shinfo(skb)->frags)
    in one skb, rather than using the less efficient frag_list.
    
    It also adds a new interface, napi_gro_frags to allow drivers
    to inject page frags directly into the stack without allocating
    an skb.  This is intended to be the GRO equivalent for LRO's
    lro_receive_frags interface.
    
    The existing GSO interface can already handle page frags with
    or without an appended frag_list so nothing needs to be changed
    there.
    
    The merging itself is rather simple.  We store any new frag entries
    after the last existing entry, without checking whether the first
    new entry can be merged with the last existing entry.  Making this
    check would actually be easy but since no existing driver can
    produce contiguous frags anyway it would just be mental masturbation.
    
    If the total number of entries would exceed the capacity of a
    single skb, we simply resort to using frag_list as we do now.
    
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5d38a079