From: Tiwei Bie <tiwei.bie@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: jasowang@redhat.com, qemu-devel@nongnu.org,
virtio-dev@lists.oasis-open.org
Subject: Re: [Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers
Date: Fri, 25 May 2018 00:25:19 +0800 [thread overview]
Message-ID: <20180524162519.GA24120@debian> (raw)
In-Reply-To: <20180524191330-mutt-send-email-mst@kernel.org>
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
next prev parent reply other threads:[~2018-05-24 16:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 10:33 [Qemu-devel] [PATCH 0/6] Support host notifiers in vhost-user Tiwei Bie
2018-05-24 10:33 ` [Qemu-devel] [PATCH 1/6] vhost: allow backends to filter memory sections Tiwei Bie
2018-05-24 10:33 ` [Qemu-devel] [PATCH 2/6] vhost-user: allow slave to send fds via slave channel Tiwei Bie
2018-05-24 10:33 ` [Qemu-devel] [PATCH 3/6] vhost-user: introduce shared vhost-user state Tiwei Bie
2018-05-24 10:33 ` [Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers Tiwei Bie
2018-05-24 15:49 ` Michael S. Tsirkin
2018-05-24 16:05 ` Tiwei Bie
2018-05-24 16:15 ` Michael S. Tsirkin
2018-05-24 16:25 ` Tiwei Bie [this message]
2018-05-24 10:33 ` [Qemu-devel] [PATCH 5/6] libvhost-user: support host notifier Tiwei Bie
2018-05-24 10:33 ` [Qemu-devel] [PATCH 6/6] vhost-user-bridge: " Tiwei Bie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180524162519.GA24120@debian \
--to=tiwei.bie@intel.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virtio-dev@lists.oasis-open.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).