linux-stable/drivers/net/ethernet/intel/ixgbe
Markus Boehme 09cfae9f13 ixgbe: Fix packet corruption due to missing DMA sync
When receiving a packet with multiple fragments, hardware may still
touch the first fragment until the entire packet has been received. The
driver therefore keeps the first fragment mapped for DMA until end of
packet has been asserted, and delays its dma_sync call until then.

The driver tries to fit multiple receive buffers on one page. When using
3K receive buffers (e.g. using Jumbo frames and legacy-rx is turned
off/build_skb is being used) on an architecture with 4K pages, the
driver allocates an order 1 compound page and uses one page per receive
buffer. To determine the correct offset for a delayed DMA sync of the
first fragment of a multi-fragment packet, the driver then cannot just
use PAGE_MASK on the DMA address but has to construct a mask based on
the actual size of the backing page.

Using PAGE_MASK in the 3K RX buffer/4K page architecture configuration
will always sync the first page of a compound page. With the SWIOTLB
enabled this can lead to corrupted packets (zeroed out first fragment,
re-used garbage from another packet) and various consequences, such as
slow/stalling data transfers and connection resets. For example, testing
on a link with MTU exceeding 3058 bytes on a host with SWIOTLB enabled
(e.g. "iommu=soft swiotlb=262144,force") TCP transfers quickly fizzle
out without this patch.

Cc: stable@vger.kernel.org
Fixes: 0c5661ecc5 ("ixgbe: fix crash in build_skb Rx code path")
Signed-off-by: Markus Boehme <markubo@amazon.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-20 16:58:41 -07:00
..
ixgbe.h
ixgbe_82598.c
ixgbe_82599.c ixgbe: use checker safe conversions 2021-05-26 09:11:41 -07:00
ixgbe_common.c ixgbe: Fix out-bounds warning in ixgbe_host_interface_command() 2021-05-27 16:10:00 -07:00
ixgbe_common.h
ixgbe_dcb.c
ixgbe_dcb.h
ixgbe_dcb_82598.c
ixgbe_dcb_82598.h
ixgbe_dcb_82599.c
ixgbe_dcb_82599.h
ixgbe_dcb_nl.c net: ethernet: intel: Fix a typo in the file ixgbe_dcb_nl.c 2021-04-13 19:08:48 -07:00
ixgbe_debugfs.c
ixgbe_ethtool.c intel: Update drivers to use ethtool_sprintf 2021-03-17 11:42:30 -07:00
ixgbe_fcoe.c
ixgbe_fcoe.h
ixgbe_ipsec.c ixgbe: reduce checker warnings 2021-05-26 09:11:41 -07:00
ixgbe_ipsec.h
ixgbe_lib.c ixgbe: Fix fall-through warnings for Clang 2021-03-23 11:34:02 -07:00
ixgbe_main.c ixgbe: Fix packet corruption due to missing DMA sync 2021-07-20 16:58:41 -07:00
ixgbe_mbx.c
ixgbe_mbx.h
ixgbe_model.h
ixgbe_phy.c ixgbe: Support external GBE SerDes PHY BCM54616s 2021-04-13 19:08:48 -07:00
ixgbe_phy.h
ixgbe_ptp.c ixgbe: Fix fall-through warnings for Clang 2021-03-23 11:34:02 -07:00
ixgbe_sriov.c ixgbe: fix large MTU request from VF 2021-05-20 15:22:41 -07:00
ixgbe_sriov.h
ixgbe_sysfs.c
ixgbe_txrx_common.h
ixgbe_type.h net: intel: Remove unused function pointer typedef ixgbe_mc_addr_itr 2021-04-13 19:08:48 -07:00
ixgbe_x540.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
ixgbe_x540.h
ixgbe_x550.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
ixgbe_xsk.c intel: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:44:34 +02:00
Makefile