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 <tiwei....@intel.com> > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscr...@lists.oasis-open.org For additional commands, e-mail: virtio-dev-h...@lists.oasis-open.org