• Paolo Abeni's avatar
    net: core: rework basic flow dissection helper · 72a338bc
    Paolo Abeni authored
    When the core networking needs to detect the transport offset in a given
    packet and parse it explicitly, a full-blown flow_keys struct is used for
    storage.
    This patch introduces a smaller keys store, rework the basic flow dissect
    helper to use it, and apply this new helper where possible - namely in
    skb_probe_transport_header(). The used flow dissector data structures
    are renamed to match more closely the new role.
    
    The above gives ~50% performance improvement in micro benchmarking around
    skb_probe_transport_header() and ~30% around eth_get_headlen(), mostly due
    to the smaller memset. Small, but measurable improvement is measured also
    in macro benchmarking.
    
    v1 -> v2: use the new helper in eth_get_headlen() and skb_get_poff(),
      as per DaveM suggestion
    Suggested-by: default avatarDavid Miller <davem@davemloft.net>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    72a338bc
flow_dissector.h 7.35 KB