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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 18 Feb 2016 18:40:22 +0000 (10:40 -0800)
commitb96b78f2b789ab8398e7ec0111bb8b4588ed42bf
tree5da7cb1da5008fdae8994d3a5a604b1bbceeefd4
parentc777019af1dc7343be8dc44bb4d32f5e2ef072dd
i40e/i40evf: Replace header pointers with unions of pointers in Tx checksum path

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>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
This page took 0.02603 seconds and 5 git commands to generate.