linux-uconsole/drivers/net/ethernet/intel
Firo Yang f91139e250 ixgbe: sync the first fragment unconditionally
[ Upstream commit e7ba676c61 ]

In Xen environment, if Xen-swiotlb is enabled, ixgbe driver
could possibly allocate a page, DMA memory buffer, for the first
fragment which is not suitable for Xen-swiotlb to do DMA operations.
Xen-swiotlb have to internally allocate another page for doing DMA
operations. This mechanism requires syncing the data from the internal
page to the page which ixgbe sends to upper network stack. However,
since commit f3213d9321 ("ixgbe: Update driver to make use of DMA
attributes in Rx path"), the unmap operation is performed with
DMA_ATTR_SKIP_CPU_SYNC. As a result, the sync is not performed.
Since the sync isn't performed, the upper network stack could receive
a incomplete network packet. By incomplete, it means the linear data
on the first fragment(between skb->head and skb->end) is invalid. So
we have to copy the data from the internal xen-swiotlb page to the page
which ixgbe sends to upper network stack through the sync operation.

More details from Alexander Duyck:
Specifically since we are mapping the frame with
DMA_ATTR_SKIP_CPU_SYNC we have to unmap with that as well. As a result
a sync is not performed on an unmap and must be done manually as we
skipped it for the first frag. As such we need to always sync before
possibly performing a page unmap operation.

Fixes: f3213d9321 ("ixgbe: Update driver to make use of DMA attributes in Rx path")
Signed-off-by: Firo Yang <firo.yang@suse.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:51:12 +01:00
..
e1000 e1000: fix memory leaks 2019-11-12 19:21:18 +01:00
e1000e e1000e: add workaround for possible stalled packet 2019-10-05 13:09:58 +02:00
fm10k fm10k: ensure completer aborts are marked as non-fatal after a resume 2019-12-01 09:17:11 +01:00
i40e i40e: reduce stack usage in i40e_set_fc 2020-01-27 14:51:06 +01:00
i40evf i40evf: cancel workqueue sync for adminq when a VF is removed 2019-11-20 18:45:42 +01:00
ice ice: delay less 2019-12-31 16:35:57 +01:00
igb igb: shorten maximum PHC timecounter update interval 2019-12-01 09:17:11 +01:00
igbvf igbvf: netdev: Mark expected switch fall-through 2018-08-07 17:54:20 -07:00
ixgb ixgb: remove ndo_poll_controller 2018-09-23 21:55:24 -07:00
ixgbe ixgbe: sync the first fragment unconditionally 2020-01-27 14:51:12 +01:00
ixgbevf ixgbevf: VF2VF TCP RSS 2018-11-13 11:08:30 -08:00
e100.c e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait 2019-12-17 20:35:31 +01:00
Kconfig docs: Fix more broken references 2018-06-15 18:11:26 -03:00
Makefile ice: Add basic driver framework for Intel(R) E800 Series 2018-03-26 08:28:02 -07:00