vhost: support vhost-user
authorHuawei Xie <huawei.xie@intel.com>
Mon, 23 Feb 2015 17:36:31 +0000 (17:36 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 24 Feb 2015 00:38:15 +0000 (01:38 +0100)
commit8f972312b8f469af5cf6f20de48719468b1c7cda
tree6fba3043add250191877112f43f9a181e52e29cb
parentfbf7e07ca1423f7cbf96063a7e522a07b6c43fc9
vhost: support vhost-user

In rte_vhost_driver_register(), vhost unix domain socket listener fd is created
and added to polled(based on select) fdset.

In rte_vhost_driver_session_start(), fds in the fdset are checked for
processing. If there is new connection from qemu, connection fd accepted is
added to polled fdset. The listener and connection fds in the fdset are
then both checked. When there is message on the connection fd, its
callback vserver_message_handler is called to process vhost-user messages.

To support identifying which virtio is from which guest VM, we could call
rte_vhost_driver_register with different socket path. Virtio devices from
same VM will connect to VM specific socket. The socket path information is
stored in the virtio_net structure.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Signed-off-by: Przemyslaw Czesnowicz <przemyslaw.czesnowicz@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
lib/librte_vhost/Makefile
lib/librte_vhost/rte_virtio_net.h
lib/librte_vhost/vhost-net.h
lib/librte_vhost/vhost_user/vhost-net-user.c [new file with mode: 0644]
lib/librte_vhost/vhost_user/vhost-net-user.h [new file with mode: 0644]
lib/librte_vhost/vhost_user/virtio-net-user.c [new file with mode: 0644]
lib/librte_vhost/vhost_user/virtio-net-user.h [new file with mode: 0644]
lib/librte_vhost/virtio-net.c