Add mergeable buffers support for virtio-net

Operating Systems / OSv - Dor Laor [cloudius-systems.com] - 20 June 2013 05:14 UTC

The feature allows the hypervisor to batch several packets together as one large SG list. Once such header is received, the guest rx routine interates over the list and assembles a mega mbuf.

The patch also simplifies the rx path by using a single buffer for the virtio data and its header. This shrinks the sg list from size of two into a single one.

The issue is that at the moment I haven't seen packets w/ mbuf > 1 being received. Linux guest does receives such packets here and there. It may be due to the use of offload features that enalrge the packet size

d487ffd Add mergeable buffers support for virtio-net
drivers/virtio-net.cc | 123 +++++++++++++++++++++++++++++------------------
drivers/virtio-net.hh | 2 +
drivers/virtio-vring.cc | 5 ++
drivers/virtio-vring.hh | 1 +
4 files changed, 83 insertions(+), 48 deletions(-)

Upstream: github.com


  • Share