Skip to content

Use scatter-gather IO in Firecracker virtio-net TX path #420

Closed
@acatangiu

Description

@acatangiu

The virtio network device emulation implementation in Firecracker is currently using an intermediate buffer to build the TX packet from the guest virtqueue descriptors and then calls write() on the host tap to send this packet (see NetEpollHandler::process_tx() in devices/src/virtio/net.rs).

When doing write(), the data is again copied in the kernel from the userspace Firecracker intermediate buffer to the kernel tap buffers.

An alternative is to use a scatter-gather IO system call like writev() which would take a list of memory addresses for the packet parts (in this case the addresses of the data portion of the virtqueue descriptors), thus avoiding the intermediate buffer and avoiding an extra step of moving the full packet around in memory.

See https://www.gnu.org/software/libc/manual/html_node/Scatter_002dGather.html

Metadata

Metadata

Assignees

Labels

Priority: LowIndicates that an issue or pull request should be resolved behind issues or pull requests labelled `

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions