[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [PATCH 4/6] vhost-user: support registering external host notifiers
On Thu, May 24, 2018 at 07:15:24PM +0300, Michael S. Tsirkin wrote: > 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 <tiwei.bie@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 > > I wonder whether we can create a new per vq structure. Maybe something like: typedef struct VhostUserStatePerVQ { VhostUserHostNotifier notifier; } VhostUserStatePerVQ; typedef struct VhostUserState { CharBackend *chr; VhostUserStatePerVQ queue[VIRTIO_QUEUE_MAX]; } VhostUserState; Best regards, Tiwei Bie
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]