freebsd-skq/sys/dev/ixgbe
Eric Joyner 7aad1f4edc ix(4),ixv(4): Fix TSO offloads when TXCSUM is disabled
This patch and commit message are based on r340256 created by Jacob Keller:

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 ixgbe_isc_txd_encap with packets which have
CSUM_IP_TSO, but do not have CSUM_IP or CSUM_IP_TCP set. Because of
this, ixgbe_tx_ctx_setup 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 ixgbe_tx_ctx_setup function to check both
CSUM_IP and CSUM_IP_TSO when deciding whether to enable 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 ix
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 ix and
ixv interface files.

Once both of these changes are made, the ix and ixv drivers should
correctly offload TSO packets when TSO offload is enabled, regardless
of whether TXCSUM is enabled or disabled.

Submitted by:	Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reviewed by:	IntelNetworking
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D18470
2019-01-31 21:53:03 +00:00
..
if_bypass.c ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
if_fdir.c ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
if_ix.c ix(4),ixv(4): Fix TSO offloads when TXCSUM is disabled 2019-01-31 21:53:03 +00:00
if_ixv.c ix(4),ixv(4): Fix TSO offloads when TXCSUM is disabled 2019-01-31 21:53:03 +00:00
if_sriov.c ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
ix_txrx.c ix(4),ixv(4): Fix TSO offloads when TXCSUM is disabled 2019-01-31 21:53:03 +00:00
ixgbe_82598.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_82598.h
ixgbe_82599.c ixgbe: this statement may fall through warnings with gcc 2019-01-19 20:45:41 +00:00
ixgbe_82599.h
ixgbe_api.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_api.h
ixgbe_bypass.h
ixgbe_common.c ixgbe: this statement may fall through warnings with gcc 2019-01-19 20:45:41 +00:00
ixgbe_common.h ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_dcb_82598.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_dcb_82598.h
ixgbe_dcb_82599.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_dcb_82599.h
ixgbe_dcb.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_dcb.h
ixgbe_fdir.h ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
ixgbe_features.h
ixgbe_mbx.c
ixgbe_mbx.h
ixgbe_osdep.c ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
ixgbe_osdep.h ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
ixgbe_phy.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_phy.h
ixgbe_rss.h
ixgbe_sriov.h ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
ixgbe_type.h ix(4): Run {mod,msf,mbx,fdir,phy}_task in if_update_admin_status 2019-01-31 21:44:33 +00:00
ixgbe_vf.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_vf.h ixgbe(4): Convert driver to use iflib 2017-12-20 18:15:06 +00:00
ixgbe_x540.c ixgbe(4): Update shared code, add support for X552 1G, fix bug 2018-03-19 20:55:05 +00:00
ixgbe_x540.h
ixgbe_x550.c netmap and iflib drivers, silence unused var warnings 2018-05-19 05:57:26 +00:00
ixgbe_x550.h
ixgbe.h ix(4): Run {mod,msf,mbx,fdir,phy}_task in if_update_admin_status 2019-01-31 21:44:33 +00:00