mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
vhost: backend masking support
Support backend guest notifier masking in vhost-net: create eventfd at device init, when masked, make vhost use that as eventfd instead of sending an interrupt. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
24f4fe345c
commit
f56a12475f
5 changed files with 137 additions and 16 deletions
10
hw/vhost.h
10
hw/vhost.h
|
@ -18,6 +18,7 @@ struct vhost_virtqueue {
|
|||
void *ring;
|
||||
unsigned long long ring_phys;
|
||||
unsigned ring_size;
|
||||
EventNotifier masked_notifier;
|
||||
};
|
||||
|
||||
typedef unsigned long vhost_log_chunk_t;
|
||||
|
@ -53,4 +54,13 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev);
|
|||
int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
|
||||
void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
|
||||
|
||||
/* Test and clear masked event pending status.
|
||||
* Should be called after unmask to avoid losing events.
|
||||
*/
|
||||
bool vhost_virtqueue_pending(struct vhost_dev *hdev, int n);
|
||||
|
||||
/* Mask/unmask events from this vq.
|
||||
*/
|
||||
void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
|
||||
bool mask);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue