• Willem de Bruijn's avatar
    net: add skb_frag_foreach_page and use with kmap_atomic · c613c209
    Willem de Bruijn authored
    Skb frags may contain compound pages. Various operations map frags
    temporarily using kmap_atomic, but this function works on single
    pages, not whole compound pages. The distinction is only relevant
    for high mem pages that require temporary mappings.
    
    Introduce a looping mechanism that for compound highmem pages maps
    one page at a time, does not change behavior on other pages.
    Use the loop in the kmap_atomic callers in net/core/skbuff.c.
    
    Verified by triggering skb_copy_bits with
    
        tcpdump -n -c 100 -i ${DEV} -w /dev/null &
        netperf -t TCP_STREAM -H ${HOST}
    
      and by triggering __skb_checksum with
    
        ethtool -K ${DEV} tx off
    
      repeated the tests with looping on a non-highmem platform
      (x86_64) by making skb_frag_must_loop always return true.
    Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c613c209
skbuff.c 127 KB