]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 18 Feb 2016 18:40:22 +0000 (10:40 -0800)
commit50ba731139e4494f358072b8cd711d21370a11d5
tree5da7cb1da5008fdae8994d3a5a604b1bbceeefd4
parent964e170c6210764a7c26b5c67bda37c7a4e32365
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