freebsd-skq/sys/dev/ixl
erj 236d6fde00 ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled
From Jake:
The iflib stack does not disable TSO automatically when TXCSUM is
disabled, instead assuming that the driver will correctly handle TSOs
even when CSUM_IP is not set.

This results in iflib calling ixl_isc_txd_encap with packets which have
CSUM_IP_TSO, but do not have CSUM_IP or CSUM_IP_TCP set. Because of
this, ixl_tx_setup_offload will not setup the IPv4 checksum offloading.

This results in bad TSO packets being sent if a user disables TXCSUM
without disabling TSO.

Fix this by updating the ixl_tx_setup_offload function to check both
CSUM_IP and CSUM_IP_TSO when deciding whether to enable IPv4 checksums.

Once this is corrected, another issue for TSO packets is revealed. The
driver sets IFLIB_NEED_ZERO_CSUM in order to enable a work around that
causes the ip->sum field to be zero'd. This is necessary for ixl
hardware to correctly perform TSOs.

However, if TXCSUM is disabled, then the work around is not enabled, as
CSUM_IP will not be set when the iflib stack checks to see if it should
clear the sum field.

Fix this by adding IFLIB_TSO_INIT_IP to the iflib flags for the iavf and
ixl interface files.

It is uncertain if the hardware needs IFLIB_NEED_ZERO_CSUM for any other
case besides TSO, so leave that flag assigned. It may be worth
investigating to see if this work around flag could be disabled in
a future change.

Once both of these changes are made, the ixl driver should correctly
offload TSO packets when TSO4 offload is enabled, regardless of whether
TXCSUM is enabled or disabled.

Submitted by:	Jacob Keller <jacob.e.keller@intel.com>
Reviewed by:	erj@, shurd@
MFC after:	0 days
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D17900
2018-11-08 19:10:43 +00:00
..
i40e_adminq_cmd.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_adminq.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_adminq.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_alloc.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_common.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_dcb.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_dcb.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_devids.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_hmc.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_hmc.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_lan_hmc.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_lan_hmc.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_nvm.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_osdep.c ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9) 2018-10-12 22:40:54 +00:00
i40e_osdep.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_prototype.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_register.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_status.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
i40e_type.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
iavf_vc.c ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues" 2018-11-01 17:29:14 +00:00
iavf.h iavf(4): Finish rename/rebrand internally 2018-10-15 17:23:41 +00:00
if_iavf.c ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled 2018-11-08 19:10:43 +00:00
if_ixl.c ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled 2018-11-08 19:10:43 +00:00
ixl_debug.h iavf(4): Finish rename/rebrand internally 2018-10-15 17:23:41 +00:00
ixl_iw_int.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
ixl_iw.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
ixl_iw.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
ixl_pf_i2c.c ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00
ixl_pf_iov.c iavf(4): Finish rename/rebrand internally 2018-10-15 17:23:41 +00:00
ixl_pf_iov.h ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9) 2018-10-12 22:40:54 +00:00
ixl_pf_main.c ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9) 2018-10-12 22:40:54 +00:00
ixl_pf_qmgr.c ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9) 2018-10-12 22:40:54 +00:00
ixl_pf_qmgr.h ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9) 2018-10-12 22:40:54 +00:00
ixl_pf.h ixl/iavf(4): Fix GCC 6.4.0 build 2018-10-20 18:00:12 +00:00
ixl_txrx.c ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled 2018-11-08 19:10:43 +00:00
ixl.h ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled 2018-11-08 19:10:43 +00:00
virtchnl.h ixl(4): Update version number to 2.0.0-k 2018-06-18 20:32:53 +00:00