• Alexander Duyck's avatar
    i40e/i40evf: Replace header pointers with unions of pointers in Tx checksum path · b96b78f2
    Alexander Duyck authored
    The Tx checksum path was maintaining a set of 3 pointers and two lengths in
    order to prepare the packet for being checksummed.  The thing is we only
    really needed 2 pointers, and the lengths that were being maintained can
    easily be computed.
    
    As such we can replace the IPv4 and IPv6 header pointers with one single
    union that represents both, or a generic pointer to the start of the
    network header.  For the L4 headers we can do the same with TCP and a
    generic pointer to the start of the transport header.  The length of the
    TCP header is obtained by simply multiplying doff by 4, and the network
    header length can be obtained by subtracting the network header pointer
    from the transport header pointer.
    
    While I was at it I renamed l4_hdr to l4_proto to make it a bit more clear
    and less likely to be confused with l4.hdr which is the transport header
    pointer.
    Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    b96b78f2
i40e_txrx.c 58.3 KB