]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix page DMA map/unmap attributes
authorAya Levin <ayal@nvidia.com>
Thu, 23 Dec 2021 12:38:28 +0000 (14:38 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 7 Jan 2022 00:55:39 +0000 (16:55 -0800)
commitce34fd2c0855814faafb68719981e3b6776aa20f
treee372e73b819d629440314fdb59ab87f88587ce6a
parentc7a1ef96a1c0447ec95bb209fceed8af278f7ae5
net/mlx5e: Fix page DMA map/unmap attributes

Driver initiates DMA sync, hence it may skip CPU sync. Add
DMA_ATTR_SKIP_CPU_SYNC as input attribute both to dma_map_page and
dma_unmap_page to avoid redundant sync with the CPU.
When forcing the device to work with SWIOTLB, the extra sync might cause
data corruption. The driver unmaps the whole page while the hardware
used just a part of the bounce buffer. So syncing overrides the entire
page with bounce buffer that only partially contains real data.

Fixes: 2cda7f9675b3 ("net/mlx5e: Add fragmented memory support for RX multi packet WQE")
Fixes: c59ac2b74bd8 ("net/mlx5e: Add XSK zero-copy support")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c