Page MenuHomeFreeBSD

ixl/iavf: fix TSO offloads when TXCSUM is disabled
ClosedPublic

Authored by jacob.e.keller_intel.com on Nov 7 2018, 11:54 PM.
Tags
None
Referenced Files
F81618423: D17900.diff
Fri, Apr 19, 1:42 AM
Unknown Object (File)
Feb 23 2024, 12:11 AM
Unknown Object (File)
Feb 13 2024, 10:33 AM
Unknown Object (File)
Dec 26 2023, 7:35 AM
Unknown Object (File)
Dec 22 2023, 10:49 PM
Unknown Object (File)
Dec 21 2023, 10:10 AM
Unknown Object (File)
Dec 10 2023, 11:32 PM
Unknown Object (File)
Nov 21 2023, 3:52 AM
Subscribers

Details

Summary

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.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20695
Build 20109: arc lint + arc unit

Event Timeline

There is an upcoming patch that will make the IXL_CSUM_IPV4 macro obsolete, but better to fix it at both ends anyway.

lgtm

This revision is now accepted and ready to land.Nov 8 2018, 6:06 PM

I'll commit this for Jake and try to get it into 12-RELEASE

This revision was automatically updated to reflect the committed changes.