All of lore.kernel.org
 help / color / mirror / Atom feed
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: [virtio-dev] Re: [PATCH 4/6] vhost-user: support registering external host notifiers
Date: Fri, 25 May 2018 00:05:50 +0800	[thread overview]
Message-ID: <20180524160549.GA15321@debian> (raw)
In-Reply-To: <20180524184438-mutt-send-email-mst@kernel.org>

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

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


WARNING: multiple messages have this Message-ID (diff)
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:05:50 +0800	[thread overview]
Message-ID: <20180524160549.GA15321@debian> (raw)
In-Reply-To: <20180524184438-mutt-send-email-mst@kernel.org>

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

  reply	other threads:[~2018-05-24 16:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 10:33 [virtio-dev] [PATCH 0/6] Support host notifiers in vhost-user Tiwei Bie
2018-05-24 10:33 ` [Qemu-devel] " Tiwei Bie
2018-05-24 10:33 ` [virtio-dev] [PATCH 1/6] vhost: allow backends to filter memory sections Tiwei Bie
2018-05-24 10:33   ` [Qemu-devel] " Tiwei Bie
2018-05-24 10:33 ` [virtio-dev] [PATCH 2/6] vhost-user: allow slave to send fds via slave channel Tiwei Bie
2018-05-24 10:33   ` [Qemu-devel] " Tiwei Bie
2018-05-24 10:33 ` [virtio-dev] [PATCH 3/6] vhost-user: introduce shared vhost-user state Tiwei Bie
2018-05-24 10:33   ` [Qemu-devel] " Tiwei Bie
2018-05-24 10:33 ` [virtio-dev] [PATCH 4/6] vhost-user: support registering external host notifiers Tiwei Bie
2018-05-24 10:33   ` [Qemu-devel] " Tiwei Bie
2018-05-24 15:49   ` [virtio-dev] " Michael S. Tsirkin
2018-05-24 15:49     ` [Qemu-devel] " Michael S. Tsirkin
2018-05-24 16:05     ` Tiwei Bie [this message]
2018-05-24 16:05       ` Tiwei Bie
2018-05-24 16:15       ` [virtio-dev] " Michael S. Tsirkin
2018-05-24 16:15         ` [Qemu-devel] " Michael S. Tsirkin
2018-05-24 16:25         ` [virtio-dev] " Tiwei Bie
2018-05-24 16:25           ` [Qemu-devel] " Tiwei Bie
2018-05-24 10:33 ` [virtio-dev] [PATCH 5/6] libvhost-user: support host notifier Tiwei Bie
2018-05-24 10:33   ` [Qemu-devel] " Tiwei Bie
2018-05-24 10:33 ` [virtio-dev] [PATCH 6/6] vhost-user-bridge: " Tiwei Bie
2018-05-24 10:33   ` [Qemu-devel] " 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=20180524160549.GA15321@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.