vhost: low performance in interrupt mode in some cases 40/32240/3
authorSteven Luong <sluong@cisco.com>
Thu, 6 May 2021 17:00:30 +0000 (10:00 -0700)
committerDamjan Marion <dmarion@me.com>
Sat, 8 May 2021 10:51:59 +0000 (10:51 +0000)
commit27e93a5d7692e4a7c9f60bea31cc9f8156356979
tree86aafdb3d230445612cd9fc2a86cbda9feeee3ac
parent95b67a4348f7140c2d1b4b1ccc6ae357913cdf4c
vhost: low performance in interrupt mode in some cases

When vhost and another interface, say tap, are configured for interrupt
mode, performance number may be very low from vhost.

Further analysis discovers that when vhost posts an interrupt to the
RX infra, there is a 10 msec delay in waking up its input routine.
The delay is due to vhost posts the interrupt from the main thread
which tries to wake up the worker thread.

The fix is for vhost to move the posting interrupt call to the
corresponding input worker thread by calling
vnet_hw_if_set_rx_queue_file_index() to set it up.

While at it, streamline the function vhost_user_kickfd_read_ready()
since it will be called from the worker thread.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I9beedcd33e1558c8335da4ee7fadc51c29ee4589
src/vnet/devices/virtio/vhost_user.c