Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Tiwei Bie
On Fri, Sep 27, 2019 at 11:46:06AM +0800, Jason Wang wrote: > On 2019/9/26 下午12:54, Tiwei Bie wrote: > > + > > +static long vhost_mdev_start(struct vhost_mdev *m) > > +{ > > + struct mdev_device *mdev = m->mdev; > > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); > > + st

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Tiwei Bie
On Fri, Sep 27, 2019 at 11:51:35AM +0800, Jason Wang wrote: > On 2019/9/27 上午11:46, Jason Wang wrote: > > + > > +static struct mdev_class_id id_table[] = { > > +    { MDEV_ID_VHOST }, > > +    { 0 }, > > +}; > > + > > +static struct mdev_driver vhost_mdev_driver = { > > +    .name    = "vhost_mdev"

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Jason Wang
On 2019/9/27 上午11:46, Jason Wang wrote: + +static struct mdev_class_id id_table[] = { +    { MDEV_ID_VHOST }, +    { 0 }, +}; + +static struct mdev_driver vhost_mdev_driver = { +    .name    = "vhost_mdev", +    .probe    = vhost_mdev_probe, +    .remove    = vhost_mdev_remove, +    .id_table =

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Jason Wang
On 2019/9/26 下午12:54, Tiwei Bie wrote: This patch introduces a mdev based hardware vhost backend. This backend is built on top of the same abstraction used in virtio-mdev and provides a generic vhost interface for userspace to accelerate the virtio devices in guest. This backend is implemented

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Jason Wang
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

Re: [PATCH] vsock/virtio: add support for MSG_PEEK

2019-09-26 Thread Eric Dumazet
On 9/26/19 11:23 AM, Matias Ezequiel Vara Larsen wrote: > This patch adds support for MSG_PEEK. In such a case, packets are not > removed from the rx_queue and credit updates are not sent. > > Signed-off-by: Matias Ezequiel Vara Larsen > --- > net/vmw_vsock/virtio_transport_common.c | 50 > +

[PATCH] vsock/virtio: add support for MSG_PEEK

2019-09-26 Thread Matias Ezequiel Vara Larsen
This patch adds support for MSG_PEEK. In such a case, packets are not removed from the rx_queue and credit updates are not sent. Signed-off-by: Matias Ezequiel Vara Larsen --- net/vmw_vsock/virtio_transport_common.c | 50 +++-- 1 file changed, 47 insertions(+), 3 dele

Re: [PATCH V2 5/8] mdev: introduce device specific ops

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 10:26:08AM -0600, Alex Williamson wrote: > On Thu, 26 Sep 2019 11:46:55 -0400 > "Michael S. Tsirkin" wrote: > > > On Wed, Sep 25, 2019 at 10:30:28AM -0600, Alex Williamson wrote: > > > On Wed, 25 Sep 2019 10:11:00 -0400 > > > Rob Miller wrote: > > > > > > On Tue, 24 Sep

Re: [PATCH V2 5/8] mdev: introduce device specific ops

2019-09-26 Thread Alex Williamson
On Thu, 26 Sep 2019 11:46:55 -0400 "Michael S. Tsirkin" wrote: > On Wed, Sep 25, 2019 at 10:30:28AM -0600, Alex Williamson wrote: > > On Wed, 25 Sep 2019 10:11:00 -0400 > > Rob Miller wrote: > > > > > On Tue, 24 Sep 2019 21:53:29 +0800 > > > > > Jason Wang wrote: > > > > > > diff --git a/dr

Re: [PATCH V2 5/8] mdev: introduce device specific ops

2019-09-26 Thread Michael S. Tsirkin
On Wed, Sep 25, 2019 at 10:30:28AM -0600, Alex Williamson wrote: > On Wed, 25 Sep 2019 10:11:00 -0400 > Rob Miller wrote: > > > > On Tue, 24 Sep 2019 21:53:29 +0800 > > > > Jason Wang wrote: > > > > > diff --git a/drivers/vfio/mdev/vfio_mdev.c > > > > b/drivers/vfio/mdev/vfio_mdev.c > > > > >

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread kbuild test robot
to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Tiwei-Bie/vhost-introduce-mdev-based-hardware-backend/20190926-125932 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next conf

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Tiwei Bie
On Thu, Sep 26, 2019 at 09:26:22AM -0400, Michael S. Tsirkin wrote: > On Thu, Sep 26, 2019 at 09:14:39PM +0800, Tiwei Bie wrote: > > > 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

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 09:14:39PM +0800, Tiwei Bie wrote: > > 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. Also, let's not repeat the vhost ne

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Tiwei Bie
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/

Re: [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 06:48:54PM +0800, Jason Wang wrote: > > On 2019/9/26 下午4:21, Michael S. Tsirkin wrote: > > On Thu, Sep 26, 2019 at 12:04:46PM +0800, Jason Wang wrote: > > > > > > I'm not sure how stable above ops are. > > > > > It's the kernel internal API, so there's no strict requirement

Re: [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-26 Thread Jason Wang
On 2019/9/26 下午4:21, Michael S. Tsirkin wrote: On Thu, Sep 26, 2019 at 12:04:46PM +0800, Jason Wang wrote: I'm not sure how stable above ops are. It's the kernel internal API, so there's no strict requirement for this. We will export a version value for userspace for compatibility. Given it's

Re: [PATCH] vhost: introduce mdev based hardware backend

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 12:54:27PM +0800, Tiwei Bie wrote: > This patch introduces a mdev based hardware vhost backend. > This backend is built on top of the same abstraction used > in virtio-mdev and provides a generic vhost interface for > userspace to accelerate the virtio devices in guest. > >

Re: [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-26 Thread Michael S. Tsirkin
On Thu, Sep 26, 2019 at 12:04:46PM +0800, Jason Wang wrote: > > > > I'm not sure how stable above ops are. > > > It's the kernel internal API, so there's no strict requirement for this. > > > We > > > will export a version value for userspace for compatibility. > > Given it's tied to virtio we pro

Re: [PATCH V2 6/8] mdev: introduce virtio device and its device ops

2019-09-26 Thread Jason Wang
On 2019/9/26 上午8:48, Tian, Kevin wrote: +}; I'm not sure how stable above ops are. It's the kernel internal API, so there's no strict requirement for this. We will export a version value for userspace for compatibility. Does it make sense if defining just two callbacks here, e.g. vq_ctrl an

Re: [PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()

2019-09-26 Thread Stefano Garzarella
Hi Dexuan, On Thu, Sep 26, 2019 at 01:11:27AM +, Dexuan Cui wrote: > Lockdep is unhappy if two locks from the same class are held. > > Fix the below warning for hyperv and virtio sockets (vmci socket code > doesn't have the issue) by using lock_sock_nested() when __vsock_release() > is called