[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/6] vhost-user: support registering external ho
From: |
Tiwei Bie |
Subject: |
Re: [Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers |
Date: |
Fri, 25 May 2018 00:05:50 +0800 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
On Thu, May 24, 2018 at 06:49:47PM +0300, Michael S. Tsirkin wrote:
> On Thu, May 24, 2018 at 06:33:34PM +0800, Tiwei Bie wrote:
> > This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER.
> > With this feature negotiated, vhost-user backend can register
> > memory region based host notifiers. And it will allow the guest
> > driver in the VM to notify the hardware accelerator at the
> > vhost-user backend directly.
> >
> > Signed-off-by: Tiwei Bie <address@hidden>
>
> So maybe we don't need a new VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD?
> Let's check VHOST_USER_PROTOCOL_F_HOST_NOTIFIER instead?
Yeah. I think it would be the best choice!
If this feature (HOST NOTIFIER) is negotiated, it means
the QEMU is able to safely receive (the expected number
of) file descriptors.
>
> > ---
[...]
> > +typedef struct VhostUserHostNotifier {
> > + MemoryRegion mr;
> > + void *addr;
> > + bool set;
> > +} VhostUserHostNotifier;
> >
> > typedef struct VhostUserState {
> > CharBackend *chr;
> > + VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX];
> > } VhostUserState;
>
> So this notifier is per-queue. Can't we maintain it in
> NetVhostUserState then?
This notifier is per virtio-queue. But NetVhostUserState
is per net-queue-pair.
And ideally, I think this structure shouldn't be visible
to net/vhost-user, vhost-user-scsi, vhost-user-crypto, etc.
Best regards,
Tiwei Bie
[Qemu-devel] [PATCH 3/6] vhost-user: introduce shared vhost-user state, Tiwei Bie, 2018/05/24
[Qemu-devel] [PATCH 1/6] vhost: allow backends to filter memory sections, Tiwei Bie, 2018/05/24
[Qemu-devel] [PATCH 2/6] vhost-user: allow slave to send fds via slave channel, Tiwei Bie, 2018/05/24
[Qemu-devel] [PATCH 6/6] vhost-user-bridge: support host notifier, Tiwei Bie, 2018/05/24
[Qemu-devel] [PATCH 5/6] libvhost-user: support host notifier, Tiwei Bie, 2018/05/24