aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netkit.c
diff options
context:
space:
mode:
authorWenbo Li <[email protected]>2024-09-19 08:13:51 +0000
committerPaolo Abeni <[email protected]>2024-09-26 08:35:27 +0000
commitc11a49d58ad229a1be1ebe08a2b68fedf83db6c8 (patch)
tree91639008bf8f9368617bd7ba3423eb8a2e528064 /drivers/net/netkit.c
parentbonding: Fix unnecessary warnings and logs from bond_xdp_get_xmit_slave() (diff)
downloadkernel-c11a49d58ad229a1be1ebe08a2b68fedf83db6c8.tar.gz
kernel-c11a49d58ad229a1be1ebe08a2b68fedf83db6c8.zip
virtio_net: Fix mismatched buf address when unmapping for small packets
Currently, the virtio-net driver will perform a pre-dma-mapping for small or mergeable RX buffer. But for small packets, a mismatched address without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. That will result in unsynchronized buffers when SWIOTLB is enabled, for example, when running as a TDX guest. This patch unifies the address passed to the virtio core as the address of the virtnet header and fixes the mismatched buffer address. Changes from v2: unify the buf that passed to the virtio core in small and merge mode. Changes from v1: Use ctx to get xdp_headroom. Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers") Signed-off-by: Wenbo Li <[email protected]> Signed-off-by: Jiahui Cen <[email protected]> Signed-off-by: Ying Fang <[email protected]> Reviewed-by: Xuan Zhuo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/net/netkit.c')
0 files changed, 0 insertions, 0 deletions