在 2021/11/8 下午6:53, Stefan Hajnoczi 写道:
On Fri, Nov 05, 2021 at 12:48:17AM +0800, Cindy Lu wrote:
these patches add the support for configure interrupt
These codes are all tested in vp-vdpa (support configure interrupt)
vdpa_sim (not support configure interrupt), virtio tap device
test in virtio-pci bus and virtio-mmio bus
Hi,
vhost-user has a configuration space change notification but it uses a
slave channel message (VHOST_USER_SLAVE_CONFIG_CHANGE_MSG) instead of an
eventfd. Ideally the vhost kernel ioctl and vhost-user interfaces would
follow the same design.
I'm concerned "common" vhost code is going to end up with lots of
callbacks that are not available uniformly across vhost kernel, vdpa,
and vhost-user. That makes it hard to understand and debug vhost, plus
differences make it harder to to correctly extend these interfaces in
the future.
Is the decision to a new eventfd-based interface instead of
vhost_chr_read/write() deliberate?
I think this is a good question. Here're some reasons for using eventfd
from the kernel perspective:
1) the eventfd is used for relaying interrupts for vqs, so we choose to
use that for the config interrupt
2) make it possible to be used for irq bypassing (posted interrupt)
From Qemu's perspective, as shown in this series, it looks more easier
to be integrated with the both vhost and transport layer (e.g vector
masking etc).
Thanks
If yes, do you think VHOST_USER_SLAVE_CONFIG_CHANGE_MSG was a design
mistake in vhost-user that needs to be fixed?
Stefan