All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhihong.wang@intel.com, maxime.coquelin@redhat.com,
	virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, lingshan.zhu@intel.com
Subject: Re: [PATCH] vhost: introduce mdev based hardware backend
Date: Fri, 27 Sep 2019 09:23:46 -0400	[thread overview]
Message-ID: <20190927092219-mutt-send-email-mst__926.648620382764$1569590646$gmane$org@kernel.org> (raw)
In-Reply-To: <b6f6ffb2-0b16-5041-be2e-94b805c6a4c9@redhat.com>

On Fri, Sep 27, 2019 at 09:17:56PM +0800, Jason Wang wrote:
> 
> On 2019/9/27 下午8:46, Michael S. Tsirkin wrote:
> > On Fri, Sep 27, 2019 at 08:17:47PM +0800, Jason Wang wrote:
> > > On 2019/9/27 下午5:41, Michael S. Tsirkin wrote:
> > > > On Fri, Sep 27, 2019 at 11:27:12AM +0800, Jason Wang wrote:
> > > > > On 2019/9/26 下午9:14, Tiwei Bie wrote:
> > > > > > On Thu, Sep 26, 2019 at 04:35:18AM -0400, Michael S. Tsirkin wrote:
> > > > > > > On Thu, Sep 26, 2019 at 12:54:27PM +0800, Tiwei Bie wrote:
> > > > > > [...]
> > > > > > > > diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
> > > > > > > > index 40d028eed645..5afbc2f08fa3 100644
> > > > > > > > --- a/include/uapi/linux/vhost.h
> > > > > > > > +++ b/include/uapi/linux/vhost.h
> > > > > > > > @@ -116,4 +116,12 @@
> > > > > > > >     #define VHOST_VSOCK_SET_GUEST_CID	_IOW(VHOST_VIRTIO, 0x60, __u64)
> > > > > > > >     #define VHOST_VSOCK_SET_RUNNING		_IOW(VHOST_VIRTIO, 0x61, int)
> > > > > > > > +/* VHOST_MDEV specific defines */
> > > > > > > > +
> > > > > > > > +#define VHOST_MDEV_SET_STATE	_IOW(VHOST_VIRTIO, 0x70, __u64)
> > > > > > > > +
> > > > > > > > +#define VHOST_MDEV_S_STOPPED	0
> > > > > > > > +#define VHOST_MDEV_S_RUNNING	1
> > > > > > > > +#define VHOST_MDEV_S_MAX	2
> > > > > > > > +
> > > > > > > >     #endif
> > > > > > > So assuming we have an underlying device that behaves like virtio:
> > > > > > I think they are really good questions/suggestions. Thanks!
> > > > > > 
> > > > > > > 1. Should we use SET_STATUS maybe?
> > > > > > I like this idea. I will give it a try.
> > > > > > 
> > > > > > > 2. Do we want a reset ioctl?
> > > > > > I think it is helpful. If we use SET_STATUS, maybe we
> > > > > > can use it to support the reset.
> > > > > > 
> > > > > > > 3. Do we want ability to enable rings individually?
> > > > > > I will make it possible at least in the vhost layer.
> > > > > Note the API support e.g set_vq_ready().
> > > > virtio spec calls this "enabled" so let's stick to that.
> > > 
> > > Ok.
> > > 
> > > 
> > > > > > > 4. Does device need to limit max ring size?
> > > > > > > 5. Does device need to limit max number of queues?
> > > > > > I think so. It's helpful to have ioctls to report the max
> > > > > > ring size and max number of queues.
> > > > > An issue is the max number of queues is done through a device specific way,
> > > > > usually device configuration space. This is supported by the transport API,
> > > > > but how to expose it to userspace may need more thought.
> > > > > 
> > > > > Thanks
> > > > an ioctl for device config?  But for v1 I'd be quite happy to just have
> > > > a minimal working device with 2 queues.
> > > 
> > > I'm fully agree, and it will work as long as VIRTIO_NET_F_MQ and
> > > VIRTIO_NET_F_CTRL_VQ is not advertised by the mdev device.
> > > 
> > > Thanks
> > Hmm this means we need to validate the features bits,
> > not just pass them through to the hardware.
> > Problem is, how do we add more feature bits later,
> > without testing all hardware?
> > I guess this means the device specific driver must do it.
> > 
> 
> That looks not good, maybe a virtio device id based features blacklist in
> vhost-mdev. Then MQ and CTRL_VQ could be filtered out by vhost-mdev.
> 
> Thanks

Two implementations of e.g. virtio net can have different
features whitelisted. So I think there's no way but let
the driver do it. We should probably provide a standard place
in the ops for driver to supply the whitelist, to make sure
drivers don't forget.

> 
> > > > > > Thanks!
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2019-09-27 13:23 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26  4:54 [PATCH] vhost: introduce mdev based hardware backend Tiwei Bie
2019-09-26  8:35 ` Michael S. Tsirkin
2019-09-26  8:35 ` Michael S. Tsirkin
2019-09-26 13:14   ` Tiwei Bie
2019-09-26 13:14   ` Tiwei Bie
2019-09-26 13:26     ` Michael S. Tsirkin
2019-09-26 13:26     ` Michael S. Tsirkin
2019-09-26 13:34       ` Tiwei Bie
2019-09-26 13:34       ` Tiwei Bie
2019-09-27  3:27     ` Jason Wang
2019-09-27  3:27     ` Jason Wang
2019-09-27  9:41       ` Michael S. Tsirkin
2019-09-27  9:41       ` Michael S. Tsirkin
2019-09-27 12:17         ` Jason Wang
2019-09-27 12:17         ` Jason Wang
2019-09-27 12:46           ` Michael S. Tsirkin
2019-09-27 13:17             ` Jason Wang
2019-09-27 13:17             ` Jason Wang
2019-09-27 13:23               ` Michael S. Tsirkin
2019-09-29  7:39                 ` Jason Wang
2019-09-29  7:39                   ` Jason Wang
2019-09-27 13:23               ` Michael S. Tsirkin [this message]
2019-09-27 12:46           ` Michael S. Tsirkin
2019-09-26 14:05 ` kbuild test robot
2019-09-26 14:05 ` kbuild test robot
2019-09-27  3:46 ` Jason Wang
2019-09-27  3:46 ` Jason Wang
2019-09-27  3:51   ` Jason Wang
2019-09-27  3:51   ` Jason Wang
2019-09-27  4:26     ` Tiwei Bie
2019-09-27  4:26     ` Tiwei Bie
2019-09-27  4:54   ` Tiwei Bie
2019-09-27  7:14     ` Jason Wang
2019-09-27  7:14     ` Jason Wang
2019-09-27  8:04       ` Tiwei Bie
2019-09-27  8:31         ` Jason Wang
2019-09-27  8:31         ` Jason Wang
2019-09-27  8:04       ` Tiwei Bie
2019-09-27  7:17     ` Jason Wang
2019-09-27  7:17     ` Jason Wang
2019-09-27  8:47     ` Jason Wang
2019-09-27  8:47     ` Jason Wang
2019-09-27  9:38       ` Michael S. Tsirkin
2019-09-27  9:38       ` Michael S. Tsirkin
2019-09-27 12:15         ` Jason Wang
2019-09-27 12:15         ` Jason Wang
2019-09-27  4:54   ` Tiwei Bie
  -- strict thread matches above, loose matches on Subject: below --
2019-09-26  4:54 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='20190927092219-mutt-send-email-mst__926.648620382764$1569590646$gmane$org@kernel.org' \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lingshan.zhu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=zhihong.wang@intel.com \
    /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.