Commit c11a49d
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: 295525e ("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]>1 parent 0cbfd45 commit c11a49d
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1807 | 1807 | | |
1808 | 1808 | | |
1809 | 1809 | | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
1810 | 1815 | | |
1811 | 1816 | | |
1812 | 1817 | | |
| |||
2422 | 2427 | | |
2423 | 2428 | | |
2424 | 2429 | | |
2425 | | - | |
2426 | | - | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
2427 | 2433 | | |
2428 | 2434 | | |
2429 | 2435 | | |
| |||
0 commit comments