[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: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers |
Date: |
Thu, 24 May 2018 19:15:24 +0300 |
On Fri, May 25, 2018 at 12:05:50AM +0800, Tiwei Bie wrote:
> 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
I wonder whether we can create a new per vq structure.
--
MST
[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