1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel
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
..
e1000 intel: remove checker warning 2021-05-26 09:11:40 -07:00
e1000e e1000e: Fix an error handling path in 'e1000_probe()' 2021-07-01 10:59:21 -07:00
fm10k fm10k: Fix an error handling path in 'fm10k_probe()' 2021-07-01 10:59:21 -07:00
i40e RDMA v5.14 merge window Pull Request 2021-07-01 14:54:03 -07:00
iavf iavf: Fix an error handling path in 'iavf_probe()' 2021-07-01 10:59:21 -07:00
ice Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
igb igb: Fix position of assignment to *ring 2021-07-01 10:59:21 -07:00
igbvf igbvf: convert to strongly typed descriptors 2021-05-26 09:11:41 -07:00
igc igc: Fix an error handling path in 'igc_probe()' 2021-07-01 10:53:22 -07:00
ixgb intel: handle unused assignments 2020-09-25 16:28:59 -07:00
ixgbe ixgbe: Fix packet corruption due to missing DMA sync 2021-07-20 16:58:41 -07:00
ixgbevf ixgbevf: use xso.real_dev instead of xso.dev in callback functions of struct xfrmdev_ops 2021-07-06 10:36:59 -07:00
e100.c e100: handle eeprom as little endian 2021-05-26 09:11:40 -07:00
Kconfig ice: register 1588 PTP clock device object for E810 devices 2021-06-11 08:47:30 -07:00
Makefile igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support 2018-10-17 12:14:54 -07:00