On 2019/4/11 下午5:25, David Woodhouse wrote:
On Thu, 2019-04-11 at 15:22 +0800, Jason Wang wrote:
If you care about userspace performance, you may want to try vhost + TAP
instead. I admit the API is not user friendly which needs to be improved
but then there will be no syscall overhead on packet transmission and
receiving, and eventfd will be used for notification.
That would be very useful. Is there any example code I can follow?


Yes, you can refer:

1) Qemu hw/virtio/vhost.c or hw/net/vhost_net.c

2) dpdk drivers/net/virtio/virtio_user/vhost_kernel_tap.c

DPDK code seems more compact.

Basically, the setup of TUN/TAP should be the same, then userspace need to allocate virtio rings and pass them and tap fd to vhost through vhost_net ioctls.

Thanks

Reply via email to