vhost: migrate to use device infra for worker thread assignment, rx-mode. 40/6540/6
authorSteven <sluong@cisco.com>
Mon, 1 May 2017 21:03:02 +0000 (14:03 -0700)
committerSteven <sluong@cisco.com>
Mon, 22 May 2017 23:15:38 +0000 (16:15 -0700)
commitf3b53643e87e7521c57cccc157385d2fa4bd0d80
tree19b0716291d3d69c2a787b2b45661916a564f585
parent10980465ce97eceff05ac94a69a13d63d3cfa70a
vhost: migrate to use device infra for worker thread assignment, rx-mode.
and add adaptive mode support to receive queue

- Migrate vhost to use device infra which does the interface/queue to worker
thread assignment.

- Retire vhost thread CLI and corresponding code which assigns interface/queue
to worker thread. set interface placement should be used instead to customize
the interface/queue to worker thread assignment.

- Retire vhost interrupt/polling option when creating vhost-user interface.
Instead, set interface rx-mode should be used.

- Add code in vnet_device_input_unassign_thread to change the node state
to interrupt if the last polling interface has left the worker thread for the
device of the corresponding interface/queue.

- Add adaptive mode support. The node state is set to interrupt initially.
When the scheduler detects a burst of traffic, it switches the input node to
polling. Then we inform the device that we don't need interrupt notification.
When the traffic subsides, the scheduler switches the input node back to
interrupt. Then we immediately tell the driver that we want interrupt
notification again.

- Remove some duplicate code in vlib/main.c

Change-Id: Id19bb1b9e50e6521c6464f470f5825c26924d3a8
Signed-off-by: Steven <sluong@cisco.com>
src/vat/api_format.c
src/vlib/main.c
src/vnet/devices/devices.c
src/vnet/devices/virtio/vhost-user.c
src/vnet/devices/virtio/vhost-user.h
src/vnet/devices/virtio/vhost_user_api.c