]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e/i40evf: Replace header pointers with unions of pointers in Tx checksum path
authorAlexander Duyck <aduyck@mirantis.com>
Mon, 25 Jan 2016 05:16:42 +0000 (21:16 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:37:36 +0000 (08:37 -0800)
commitc850889167ca232808b12eb8f13a28c955dd9b8e
tree895951eb2ad057d83657e3c6be0583b663a3e32c
parente127f7818dd13c770a80756ac628323b239dd906
i40e/i40evf: Replace header pointers with unions of pointers in Tx checksum path

Orabug: 22342532

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: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b96b78f2b789ab8398e7ec0111bb8b4588ed42bf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c