virtio_net: fix the missing of the dma cpu sync
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Wed, 27 Sep 2023 05:52:46 +0000 (13:52 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 15 Oct 2023 18:49:57 +0000 (11:49 -0700)
commit5720c43d5216b5dbd9ab25595f7c61e55d36d4fc
tree1a29a9fd69ded0883431ba38d619ffeb960c5b6e
parent11d3f72613957cba0783938a1ceddffe7dbbf5a1
virtio_net: fix the missing of the dma cpu sync

Commit 295525e29a5b ("virtio_net: merge dma operations when filling
mergeable buffers") unmaps the buffer with DMA_ATTR_SKIP_CPU_SYNC when
the dma->ref is zero. We do that with DMA_ATTR_SKIP_CPU_SYNC, because we
do not want to do the sync for the entire page_frag. But that misses the
sync for the current area.

This patch does cpu sync regardless of whether the ref is zero or not.

Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers")
Reported-by: Michael Roth <michael.roth@amd.com>
Closes: http://lore.kernel.org/all/20230926130451.axgodaa6tvwqs3ut@amd.com
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/net/virtio_net.c