Skip to the content.

redhat blog for vhost

How vhost-user came into being: Virtio-networking and DPDK

The vhost-net/virtio-net architecture provides a working solution which has been widely deployed over the years.

难道说 vhost-net 和 virtio-net 配合使用的吗?

In order to address the performance issues we will introduce the vhost-user/virtio-pmd architecture.

To understand the details we will review

In practice DPDK offers a series of poll mode drivers (PMDs) that enable direct transfer of packets between user space and the physical interfaces which bypass the kernel network stack all together.

A journey to the vhost-users realm

The main difference between the vhost-user library and the vhost-net kernel driver is the communication channel. While the vhost-net kernel driver implements this channel using ioctls, the vhost-user library defines the structure of messages that are sent over a unix socket.

When a device that is being emulated in QEMU attempts to DMA to the guest’s virtio I/O space it will use the vIOMMU TLB to look up the page mapping and perform a secured DMA access. Question is what happens if the actual DMA was being offloaded to an external process such as a DPDK application using vhost-user library?

When the vhost-user library tries to directly access the shared memory, it has to translate all the addresses (I/O virtual addresses) into its own memory. It does that by asking QEMU’s vIOMMU for the translation through the Device TLB API.

Deep dive into Virtio-networking and vhost-net

The vhost API is a message based protocol that allows the hypervisor to offload the data plane to another component (handler) that performs data forwarding more efficiently.

Using this protocol, the master sends the following configuration information to the handler:

After this process, the hypervisor will no longer process packets (read or write to/from the virtqueues).

A tap device is still used to communicate the VM with the host but now the worker thread handles the I/O events i.e. it polls for driver notifications or tap events, and forwards data.

Achieving network wirespeed in an open standard manner: introducing vDPA

In the past few posts we have discussed the existing virtio-networking architecture both the kernel based (vhost-net/virtio-net) and the userspace/DPDK based (vhost-user/virtio-pmd).

In the vhost-net/virtio-net and vhost-user/virto-pmd architectures we had a software switch (OVS or other) which could take a single NIC on a phy-facing port and distribute it to several VMs with a VM-facing port per VM.

Let’s see how SR-IOV can be mapped to the guest kernel, userspace DPDK or directly to the host kernel:

Virtio full HW offloading

Deep dive into Virtio-networking and vhost-net

—> 未完待续。

Achieving network wirespeed in an open standard manner: introducing vDPA

Introduction to vDPA kernel framework

A “vDPA device” means a type of device whose datapath complies with the virtio specification, but whose control path is vendor specific.

—> 未完待续。

vDPA kernel framework part 1: vDPA bus for abstracting hardware

—> 未开始。

vDPA kernel framework part 2: vDPA bus drivers for kernel subsystem interactions

—> 未开始。

Introducing VDUSE: a software-defined datapath for virtio

vDPA was originally developed to help implement virtio (an open standard control and dataplane) in dedicated hardware (such as smartNICs).

vhost diagram

vhost-net

vhost-user

virtio 如何 和 DPDK 工作:

这个图更加符合认识:

以及这个图:

vDPA

VDUSE

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。