[PATCH net v2 0/2] virtio-net: xsk: rx: fix the frame's length check

From: Bui Quang Minh
Date: Sat Jun 21 2025 - 10:51:35 EST


Hi everyone,

This series contains 2 patches for the zerocopy XDP receive path in virtio
net
- Patch 1: there is a difference between first buffer and the following
buffers in this receive path. While the first buffer contains virtio
header, the following ones do not. So the length of the remaining region
for frame data is also different in 2 cases. The current maximum frame's
length check is only correct for the following buffers not the first one.
- Patch 2: no functional change. The tricky xdp->data adjustment due to
the above difference is moved to buf_to_xdp() so that this helper contains
all logic to build xdp_buff and the tricky adjustment does not scatter
over different functions.

Version 2 changes:
- Patch 1: fix kdoc

Thanks,
Quang Minh.

Bui Quang Minh (2):
virtio-net: xsk: rx: fix the frame's length check
virtio-net: xsk: rx: move the xdp->data adjustment to buf_to_xdp()

drivers/net/virtio_net.c | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)

--
2.43.0