Re: [PATCH] vhost: introduce vDPA based backend

2020-02-19 Thread Tiwei Bie
On Wed, Feb 19, 2020 at 09:11:02AM -0400, Jason Gunthorpe wrote: > On Wed, Feb 19, 2020 at 10:52:38AM +0800, Tiwei Bie wrote: > > > > +static int __init vhost_vdpa_init(void) > > > > +{ > > > > + int r; > > > > + > > > > +

Re: [PATCH V2 3/5] vDPA: introduce vDPA bus

2020-02-18 Thread Tiwei Bie
On Tue, Feb 18, 2020 at 01:56:12PM +, Jason Gunthorpe wrote: > On Mon, Feb 17, 2020 at 02:08:03PM +0800, Jason Wang wrote: > > > I thought you were copied in the patch [1], maybe we can move vhost related > > discussion there to avoid confusion. > > > > [1] https://lwn.net/Articles/811210/ >

Re: [PATCH] vhost: introduce vDPA based backend

2020-02-18 Thread Tiwei Bie
On Tue, Feb 18, 2020 at 09:53:59AM -0400, Jason Gunthorpe wrote: > On Fri, Jan 31, 2020 at 11:36:51AM +0800, Tiwei Bie wrote: > > > +static int vhost_vdpa_alloc_minor(struct vhost_vdpa *v) > > +{ > > + return idr_alloc(_vdpa.idr, v, 0, MINORMASK + 1, > > +

Re: [PATCH] vhost: introduce vDPA based backend

2020-02-04 Thread Tiwei Bie
On Tue, Feb 04, 2020 at 02:46:16PM +0800, Jason Wang wrote: > On 2020/2/4 下午2:01, Michael S. Tsirkin wrote: > > On Tue, Feb 04, 2020 at 11:30:11AM +0800, Jason Wang wrote: > > > 5) generate diffs of memory table and using IOMMU API to setup the dma > > > mapping in this method > > Frankly I think

Re: [PATCH] vhost: introduce vDPA based backend

2020-02-04 Thread Tiwei Bie
On Tue, Feb 04, 2020 at 11:30:11AM +0800, Jason Wang wrote: > On 2020/1/31 上午11:36, Tiwei Bie wrote: > > This patch introduces a vDPA based vhost backend. This > > backend is built on top of the same interface defined > > in virtio-vDPA and provides a generic vhost interf

Re: [PATCH] vhost: introduce vDPA based backend

2020-01-30 Thread Tiwei Bie
On Thu, Jan 30, 2020 at 09:12:57PM -0800, Randy Dunlap wrote: > On 1/30/20 7:56 PM, Randy Dunlap wrote: > > Hi, > > > > On 1/30/20 7:36 PM, Tiwei Bie wrote: > >> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig > >> index f21c45aa5e07..13e6a

Re: [PATCH] vhost: introduce vDPA based backend

2020-01-30 Thread Tiwei Bie
On Thu, Jan 30, 2020 at 07:56:43PM -0800, Randy Dunlap wrote: > Hi, > > On 1/30/20 7:36 PM, Tiwei Bie wrote: > > diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig > > index f21c45aa5e07..13e6a94d0243 100644 > > --- a/drivers/vhost/Kconfig > > +++ b/d

[PATCH] vhost: introduce vDPA based backend

2020-01-30 Thread Tiwei Bie
used in virtio-vDPA. It will create char device entry named vhost-vdpa/$vdpa_device_index for userspace to use. Userspace can use vhost ioctls on top of this char device to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2020/1/16/353 Please

[PATCH v6] vhost: introduce mdev based hardware backend

2019-11-06 Thread Tiwei Bie
, userspace can use vhost ioctls on top of it to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2019/11/6/538 v5 -> v6: - Filter out VHOST_SET_LOG_BASE/VHOST_SET_LOG_FD (Jason); - Simplify len/off check (Jason); - Address checkpatch warni

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

2019-11-06 Thread Tiwei Bie
On Thu, Nov 07, 2019 at 12:08:08PM +0800, Jason Wang wrote: > On 2019/11/6 下午10:49, Tiwei Bie wrote: > > > > > > > + default: > > > > > > > + /* > > > > > > > + * VHOST_SET_MEM_TABLE, VHOST_SET_LOG_BASE

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

2019-11-06 Thread Tiwei Bie
On Thu, Nov 07, 2019 at 12:16:01PM +0800, Jason Wang wrote: > On 2019/11/6 下午10:39, Tiwei Bie wrote: > > On Wed, Nov 06, 2019 at 07:59:02AM -0500, Michael S. Tsirkin wrote: > > > On Tue, Nov 05, 2019 at 07:53:32PM +0800, Tiwei Bie wrote: > > > > This patch introduc

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

2019-11-06 Thread Tiwei Bie
On Wed, Nov 06, 2019 at 09:20:20PM +0800, Jason Wang wrote: > On 2019/11/6 下午8:57, Michael S. Tsirkin wrote: > > On Wed, Nov 06, 2019 at 08:22:50PM +0800, Tiwei Bie wrote: > > > On Wed, Nov 06, 2019 at 03:54:45PM +0800, Jason Wang wrote: > > > > On 201

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

2019-11-06 Thread Tiwei Bie
On Wed, Nov 06, 2019 at 07:59:02AM -0500, Michael S. Tsirkin wrote: > On Tue, Nov 05, 2019 at 07:53:32PM +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 a

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

2019-11-06 Thread Tiwei Bie
On Wed, Nov 06, 2019 at 03:54:45PM +0800, Jason Wang wrote: > On 2019/11/5 下午7:53, 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 ge

[PATCH v5] vhost: introduce mdev based hardware backend

2019-11-05 Thread Tiwei Bie
, userspace can use vhost ioctls on top of it to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2019/11/5/217 v4 -> v5: - Rebase on top of virtio-mdev series v8; - Use the virtio_ops of mdev_device in vhost-mdev (Jason); - Some mi

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

2019-11-01 Thread Tiwei Bie
On Fri, Nov 01, 2019 at 03:17:39PM +0800, Jason Wang wrote: > On 2019/10/31 下午10:01, 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 ge

[PATCH v4] vhost: introduce mdev based hardware backend

2019-10-31 Thread Tiwei Bie
of this device, userspace can use vhost ioctls to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2019/10/30/62 v3 -> v4: - Rebase on top of virtio-mdev series v6; - Some minor tweaks and improvements; v2 -> v3: - Fix the return value

Re: [RFC] vhost_mdev: add network control vq support

2019-10-30 Thread Tiwei Bie
On Wed, Oct 30, 2019 at 03:04:37PM +0800, Jason Wang wrote: > On 2019/10/30 下午2:17, Tiwei Bie wrote: > > On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: > >> On 2019/10/29 下午6:17, Tiwei Bie wrote: > >>> This patch adds the network control vq support in

Re: [RFC] vhost_mdev: add network control vq support

2019-10-30 Thread Tiwei Bie
On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: > On 2019/10/29 下午6:17, Tiwei Bie wrote: > > This patch adds the network control vq support in vhost-mdev. > > A vhost-mdev specific op is introduced to allow parent drivers > > to handle the network control command

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

2019-10-29 Thread Tiwei Bie
On Wed, Oct 30, 2019 at 09:55:57AM +0800, Jason Wang wrote: > On 2019/10/29 下午6:07, 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 ge

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

2019-10-29 Thread Tiwei Bie
On Tue, Oct 29, 2019 at 06:48:27PM +0800, Jason Wang wrote: > On 2019/10/29 下午5:57, Tiwei Bie wrote: > > On Mon, Oct 28, 2019 at 11:50:49AM +0800, Jason Wang wrote: > >> On 2019/10/28 上午9:58, Tiwei Bie wrote: > >>> On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S

[RFC] vhost_mdev: add network control vq support

2019-10-29 Thread Tiwei Bie
This patch adds the network control vq support in vhost-mdev. A vhost-mdev specific op is introduced to allow parent drivers to handle the network control commands come from userspace. Signed-off-by: Tiwei Bie --- This patch depends on below patch: https://lkml.org/lkml/2019/10/29/335 drivers

[PATCH v3] vhost: introduce mdev based hardware backend

2019-10-29 Thread Tiwei Bie
of this device, userspace can use vhost ioctls to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2019/10/23/614 v2 -> v3: - Fix the return value (Jason); - Don't cache unnecessary information in vhost-mdev (Jason); - Get rid of the mem

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

2019-10-29 Thread Tiwei Bie
On Mon, Oct 28, 2019 at 11:50:49AM +0800, Jason Wang wrote: > On 2019/10/28 上午9:58, Tiwei Bie wrote: > > On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Oct 25, 2019 at 05:54:55PM +0800, Jason Wang wrote: > > > > On 2019/

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

2019-10-27 Thread Tiwei Bie
On Fri, Oct 25, 2019 at 08:16:26AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 25, 2019 at 05:54:55PM +0800, Jason Wang wrote: > > On 2019/10/24 下午6:42, Jason Wang wrote: > > > > > > Yes. > > > > > > > > > >   And we should try to avoid > > > > putting ctrl vq and Rx/Tx vqs in the same DMA

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

2019-10-24 Thread Tiwei Bie
On Thu, Oct 24, 2019 at 04:32:42PM +0800, Jason Wang wrote: > On 2019/10/24 下午4:03, Jason Wang wrote: > > On 2019/10/24 下午12:21, Tiwei Bie wrote: > > > On Wed, Oct 23, 2019 at 06:29:21PM +0800, Jason Wang wrote: > > > > On 2019/10/23 下午6:11, Tiwei Bie wrote: > >

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

2019-10-23 Thread Tiwei Bie
On Wed, Oct 23, 2019 at 06:29:21PM +0800, Jason Wang wrote: > On 2019/10/23 下午6:11, Tiwei Bie wrote: > > On Wed, Oct 23, 2019 at 03:25:00PM +0800, Jason Wang wrote: > > > On 2019/10/23 下午3:07, Tiwei Bie wrote: > > > > On Wed, Oct 23, 2019 at 01:46:23PM +0800, Jason Wa

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

2019-10-23 Thread Tiwei Bie
On Wed, Oct 23, 2019 at 03:25:00PM +0800, Jason Wang wrote: > On 2019/10/23 下午3:07, Tiwei Bie wrote: > > On Wed, Oct 23, 2019 at 01:46:23PM +0800, Jason Wang wrote: > > > On 2019/10/23 上午11:02, Tiwei Bie wrote: > > > > On Tue, Oct 22, 2019 at 09:30:16PM +0800, Jason

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

2019-10-23 Thread Tiwei Bie
On Wed, Oct 23, 2019 at 01:46:23PM +0800, Jason Wang wrote: > On 2019/10/23 上午11:02, Tiwei Bie wrote: > > On Tue, Oct 22, 2019 at 09:30:16PM +0800, Jason Wang wrote: > > > On 2019/10/22 下午5:52, Tiwei Bie wrote: > > > > This patch introduces a mdev based hardware vhost

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

2019-10-22 Thread Tiwei Bie
On Tue, Oct 22, 2019 at 09:30:16PM +0800, Jason Wang wrote: > On 2019/10/22 下午5:52, 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 ge

[PATCH v2] vhost: introduce mdev based hardware backend

2019-10-22 Thread Tiwei Bie
of this device, userspace can use vhost ioctls to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2019/10/17/286 v1 -> v2: - Replace _SET_STATE with _SET_STATUS (MST); - Check status bits at each step (MST); - Report the max ring size and

Re: [PATCH V4 4/6] mdev: introduce virtio device and its device ops

2019-10-18 Thread Tiwei Bie
On Thu, Oct 17, 2019 at 06:48:34PM +0800, Jason Wang wrote: > + * @get_vq_state:Get the state for a virtqueue > + * @mdev: mediated device > + * @idx: virtqueue index > + * Returns virtqueue state

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

2019-09-27 Thread Tiwei Bie
On Fri, Sep 27, 2019 at 03:14:42PM +0800, Jason Wang wrote: > On 2019/9/27 下午12:54, Tiwei Bie wrote: > > > > + > > > > + /* > > > > +* In vhost-mdev, userspace should pass ring addresses > > > > +*

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_dev

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    =

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

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/li

[PATCH] vhost: introduce mdev based hardware backend

2019-09-25 Thread Tiwei Bie
of this device, userspace can use vhost ioctls to setup the backend. Signed-off-by: Tiwei Bie --- This patch depends on below series: https://lkml.org/lkml/2019/9/24/357 RFC v4 -> v1: - Implement vhost-mdev as a mdev device driver directly and connect it to VFIO container/group. (Jason); - P

Re: [RFC v4 3/3] vhost: introduce mdev based hardware backend

2019-09-19 Thread Tiwei Bie
On Tue, Sep 17, 2019 at 03:26:30PM +0800, Jason Wang wrote: > On 2019/9/17 上午9:02, Tiwei Bie wrote: > > diff --git a/drivers/vhost/mdev.c b/drivers/vhost/mdev.c > > new file mode 100644 > > index ..8c6597aff45e > > --- /dev/null > > +++ b/driver

Re: [RFC v4 0/3] vhost: introduce mdev based hardware backend

2019-09-19 Thread Tiwei Bie
On Fri, Sep 20, 2019 at 09:30:58AM +0800, Jason Wang wrote: > On 2019/9/19 下午11:45, Tiwei Bie wrote: > > On Thu, Sep 19, 2019 at 09:08:11PM +0800, Jason Wang wrote: > > > On 2019/9/18 下午10:32, Michael S. Tsirkin wrote: > > > > > > > So I have some qu

Re: [RFC v4 0/3] vhost: introduce mdev based hardware backend

2019-09-19 Thread Tiwei Bie
On Thu, Sep 19, 2019 at 09:08:11PM +0800, Jason Wang wrote: > On 2019/9/18 下午10:32, Michael S. Tsirkin wrote: > > > > > So I have some questions: > > > > > > > > > > 1) Compared to method 2, what's the advantage of creating a new vhost > > > > > char > > > > > device? I guess it's for keep the

Re: [RFC v4 0/3] vhost: introduce mdev based hardware backend

2019-09-17 Thread Tiwei Bie
On Tue, Sep 17, 2019 at 11:32:03AM +0800, Jason Wang wrote: > On 2019/9/17 上午9:02, Tiwei Bie wrote: > > This RFC is to demonstrate below ideas, > > > > a) Build vhost-mdev on top of the same abstraction defined in > > the virtio-mdev series [1]; > > >

[RFC v4 3/3] vhost: introduce mdev based hardware backend

2019-09-16 Thread Tiwei Bie
More details about this patch can be found from the cover letter for now. Only compile test has been done for now. Signed-off-by: Tiwei Bie --- drivers/vhost/Kconfig| 9 + drivers/vhost/Makefile | 3 + drivers/vhost/mdev.c | 462

[RFC v4 1/3] vfio: support getting vfio device from device fd

2019-09-16 Thread Tiwei Bie
This patch introduces the support for getting VFIO device from VFIO device fd. With this support, it's possible for vhost to get VFIO device from the group fd and device fd set by the userspace. Signed-off-by: Tiwei Bie --- drivers/vfio/vfio.c | 25 + include/linux

[RFC v4 2/3] vfio: support checking vfio driver by device ops

2019-09-16 Thread Tiwei Bie
This patch introduces the support for checking the VFIO driver by device ops. And vfio-mdev's device ops is also exported to make it possible to check whether a VFIO device is based on a mdev device. Signed-off-by: Tiwei Bie --- drivers/vfio/mdev/vfio_mdev.c | 3 ++- drivers/vfio/vfio.c

[RFC v4 0/3] vhost: introduce mdev based hardware backend

2019-09-16 Thread Tiwei Bie
VHOST_MDEV_SET_BACKEND ioctl with VFIO group fd and device fd first before doing other vhost ioctls); Only compile test has been done for this series for now. RFCv3: https://patchwork.kernel.org/patch/7785/ [1] https://lkml.org/lkml/2019/9/10/135 Tiwei Bie (3): vfio: support getting vfio

Re: [RFC PATCH 3/4] virtio: introudce a mdev based transport

2019-09-10 Thread Tiwei Bie
On Wed, Sep 11, 2019 at 10:52:03AM +0800, Jason Wang wrote: > On 2019/9/11 上午9:47, Tiwei Bie wrote: > > On Tue, Sep 10, 2019 at 04:19:34PM +0800, Jason Wang wrote: > > > This path introduces a new mdev transport for virtio. This is used to > > > use kernel virtio d

Re: [RFC PATCH 3/4] virtio: introudce a mdev based transport

2019-09-10 Thread Tiwei Bie
On Tue, Sep 10, 2019 at 04:19:34PM +0800, Jason Wang wrote: > This path introduces a new mdev transport for virtio. This is used to > use kernel virtio driver to drive the mediated device that is capable > of populating virtqueue directly. > > A new virtio-mdev driver will be registered to the

Re: [RFC v3] vhost: introduce mdev based hardware vhost backend

2019-09-03 Thread Tiwei Bie
On Tue, Sep 03, 2019 at 07:26:03AM -0400, Michael S. Tsirkin wrote: > On Wed, Aug 28, 2019 at 01:37:12PM +0800, Tiwei Bie wrote: > > Details about this can be found here: > > > > https://lwn.net/Articles/750770/ > > >

Re: [RFC v3] vhost: introduce mdev based hardware vhost backend

2019-09-02 Thread Tiwei Bie
On Mon, Sep 02, 2019 at 12:15:05PM +0800, Jason Wang wrote: > On 2019/8/28 下午1:37, Tiwei Bie wrote: > > Details about this can be found here: > > > > https://lwn.net/Articles/750770/ > > > > What's new in this version > > ==

[RFC v3] vhost: introduce mdev based hardware vhost backend

2019-08-27 Thread Tiwei Bie
. And the device will report device_api as "vfio-vhost". Note that, there are dirty hacks in this version. If we decide to go this way, some refactoring in vhost.c/vhost.h may be needed. PS. The direct mapping of the notify registers isn't implemented in this version. [1] https://lkml.or

[PATCH 2/2] vhost/test: fix build for vhost test

2019-08-27 Thread Tiwei Bie
;) Cc: sta...@vger.kernel.org Signed-off-by: Tiwei Bie --- drivers/vhost/test.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index ac4f762c4f65..7804869c6a31 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.

[PATCH 1/2] vhost/test: fix build for vhost test

2019-08-27 Thread Tiwei Bie
Since below commit, callers need to specify the iov_limit in vhost_dev_init() explicitly. Fixes: b46a0bf78ad7 ("vhost: fix OOB in get_rx_bufs()") Cc: sta...@vger.kernel.org Signed-off-by: Tiwei Bie --- drivers/vhost/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-10 Thread Tiwei Bie
On Wed, Jul 10, 2019 at 10:26:10AM +0800, Jason Wang wrote: > On 2019/7/9 下午2:33, Tiwei Bie wrote: > > On Tue, Jul 09, 2019 at 10:50:38AM +0800, Jason Wang wrote: > > > On 2019/7/8 下午2:16, Tiwei Bie wrote: > > > > On Fri, Jul 05, 2019 at 08:49:46AM -0600, Alex William

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-09 Thread Tiwei Bie
On Tue, Jul 09, 2019 at 10:50:38AM +0800, Jason Wang wrote: > On 2019/7/8 下午2:16, Tiwei Bie wrote: > > On Fri, Jul 05, 2019 at 08:49:46AM -0600, Alex Williamson wrote: > > > On Thu, 4 Jul 2019 14:21:34 +0800 > > > Tiwei Bie wrote: > > > > On Thu, Jul 04, 201

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-08 Thread Tiwei Bie
On Fri, Jul 05, 2019 at 08:49:46AM -0600, Alex Williamson wrote: > On Thu, 4 Jul 2019 14:21:34 +0800 > Tiwei Bie wrote: > > On Thu, Jul 04, 2019 at 12:31:48PM +0800, Jason Wang wrote: > > > On 2019/7/3 下午9:08, Tiwei Bie wrote: > > > > On Wed, Jul 03, 2019 at 0

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-04 Thread Tiwei Bie
On Fri, Jul 05, 2019 at 08:30:00AM +0800, Jason Wang wrote: > On 2019/7/4 下午3:02, Tiwei Bie wrote: > > On Thu, Jul 04, 2019 at 02:35:20PM +0800, Jason Wang wrote: > > > On 2019/7/4 下午2:21, Tiwei Bie wrote: > > > > On Thu, Jul 04, 2019 at 12:31:48PM +0800, Jason Wang w

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-04 Thread Tiwei Bie
On Thu, Jul 04, 2019 at 02:35:20PM +0800, Jason Wang wrote: > On 2019/7/4 下午2:21, Tiwei Bie wrote: > > On Thu, Jul 04, 2019 at 12:31:48PM +0800, Jason Wang wrote: > > > On 2019/7/3 下午9:08, Tiwei Bie wrote: > > > > On Wed, Jul 03, 2019 at 08:16:23PM +0800, Jason Wang w

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-04 Thread Tiwei Bie
On Thu, Jul 04, 2019 at 12:31:48PM +0800, Jason Wang wrote: > On 2019/7/3 下午9:08, Tiwei Bie wrote: > > On Wed, Jul 03, 2019 at 08:16:23PM +0800, Jason Wang wrote: > > > On 2019/7/3 下午7:52, Tiwei Bie wrote: > > > > On Wed, Jul 03, 2019 at 06:09:51PM +0800, Jason Wang w

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-03 Thread Tiwei Bie
On Wed, Jul 03, 2019 at 12:31:57PM -0600, Alex Williamson wrote: > On Wed, 3 Jul 2019 17:13:39 +0800 > Tiwei Bie wrote: > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > > index 8f10748dac79..6c5718ab7eeb 100644 > > --- a/include/uapi/linux/vfio.

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-03 Thread Tiwei Bie
On Wed, Jul 03, 2019 at 08:16:23PM +0800, Jason Wang wrote: > On 2019/7/3 下午7:52, Tiwei Bie wrote: > > On Wed, Jul 03, 2019 at 06:09:51PM +0800, Jason Wang wrote: > > > On 2019/7/3 下午5:13, Tiwei Bie wrote: > > > > Details about this can be found here: > > &

Re: [RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-03 Thread Tiwei Bie
On Wed, Jul 03, 2019 at 06:09:51PM +0800, Jason Wang wrote: > On 2019/7/3 下午5:13, Tiwei Bie wrote: > > Details about this can be found here: > > > > https://lwn.net/Articles/750770/ > > > > What's new in this version > > == > &

[RFC v2] vhost: introduce mdev based hardware vhost backend

2019-07-03 Thread Tiwei Bie
vfio->notify_offset + offset); .. } 3. VFIO interrupt ioctl API VFIO interrupt ioctl API is used to setup device interrupts. IRQ-bypass can also be supported. Currently, the data path interrupt can be configured via the VFIO_VHOST_VQ_IRQ_INDEX with virtqueue's callfd. Signed-off-by: Ti

Re: [PATCH] virtio: drop internal struct from UAPI

2019-02-02 Thread Tiwei Bie
On Fri, Feb 01, 2019 at 05:16:01PM -0500, Michael S. Tsirkin wrote: > There's no reason to expose struct vring_packed in UAPI - if we do we > won't be able to change or drop it, and it's not part of any interface. > > Let's move it to virtio_ring.c > > Cc: Tiwei Bie > Sig

[PATCH v2] virtio: support VIRTIO_F_ORDER_PLATFORM

2019-01-23 Thread Tiwei Bie
but not accepted. Signed-off-by: Tiwei Bie --- v2: - Add more explanations in commit log (MST); drivers/virtio/virtio_ring.c | 8 include/uapi/linux/virtio_config.h | 6 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio

Re: [PATCH] virtio: support VIRTIO_F_ORDER_PLATFORM

2019-01-23 Thread Tiwei Bie
On Tue, Jan 22, 2019 at 11:04:29PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 01:03:46AM +0800, Tiwei Bie wrote: > > This patch introduces the support for VIRTIO_F_ORDER_PLATFORM. > > When this feature is negotiated, driver will use the barriers > > suitable

[PATCH] virtio: support VIRTIO_F_ORDER_PLATFORM

2019-01-22 Thread Tiwei Bie
This patch introduces the support for VIRTIO_F_ORDER_PLATFORM. When this feature is negotiated, driver will use the barriers suitable for hardware devices. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 8 include/uapi/linux/virtio_config.h | 6 ++ 2 files

Re: [RFC 3/3] virtio_ring: use new vring flags

2018-12-08 Thread Tiwei Bie
On Fri, Dec 07, 2018 at 01:10:48PM -0500, Michael S. Tsirkin wrote: > On Fri, Dec 07, 2018 at 04:48:42PM +0800, Tiwei Bie wrote: > > Switch to using the _SPLIT_ and _PACKED_ variants of vring flags > > in split ring and packed ring respectively. > > > &g

Re: [RFC 2/3] virtio_ring: add VIRTIO_RING_NO_LEGACY

2018-12-08 Thread Tiwei Bie
On Fri, Dec 07, 2018 at 01:05:35PM -0500, Michael S. Tsirkin wrote: > On Fri, Dec 07, 2018 at 04:48:41PM +0800, Tiwei Bie wrote: > > Introduce VIRTIO_RING_NO_LEGACY to support disabling legacy > > macros and layout definitions. > > > > Suggested-by: Michael S. Tsirki

Re: [RFC 0/3] virtio_ring: define flags as shifts consistently

2018-12-08 Thread Tiwei Bie
On Fri, Dec 07, 2018 at 01:11:42PM -0500, Michael S. Tsirkin wrote: > On Fri, Dec 07, 2018 at 04:48:39PM +0800, Tiwei Bie wrote: > > This is a follow up of the discussion in this thread: > > https://patchwork.ozlabs.org/patch/1001015/#2042353 > > How was this tested? I'd su

[RFC 2/3] virtio_ring: add VIRTIO_RING_NO_LEGACY

2018-12-07 Thread Tiwei Bie
Introduce VIRTIO_RING_NO_LEGACY to support disabling legacy macros and layout definitions. Suggested-by: Michael S. Tsirkin Signed-off-by: Tiwei Bie --- VRING_AVAIL_ALIGN_SIZE, VRING_USED_ALIGN_SIZE and VRING_DESC_ALIGN_SIZE are not pre-virtio 1.0, but can also be disabled

[RFC 1/3] virtio_ring: define flags as shifts consistently

2018-12-07 Thread Tiwei Bie
Introduce _SPLIT_ and/or _PACKED_ variants for VRING_DESC_F_*, VRING_AVAIL_F_NO_INTERRUPT and VRING_USED_F_NO_NOTIFY. These variants are defined as shifts instead of shifted values for consistency with other _F_ flags. Suggested-by: Michael S. Tsirkin Signed-off-by: Tiwei Bie --- include/uapi

[RFC 0/3] virtio_ring: define flags as shifts consistently

2018-12-07 Thread Tiwei Bie
This is a follow up of the discussion in this thread: https://patchwork.ozlabs.org/patch/1001015/#2042353 Tiwei Bie (3): virtio_ring: define flags as shifts consistently virtio_ring: add VIRTIO_RING_NO_LEGACY virtio_ring: use new vring flags drivers/virtio/virtio_ring.c | 100

Re: [PATCH net-next v3 01/13] virtio: add packed ring types and macros

2018-11-30 Thread Tiwei Bie
On Fri, Nov 30, 2018 at 11:46:57AM -0500, Michael S. Tsirkin wrote: > On Sat, Dec 01, 2018 at 12:24:16AM +0800, Tiwei Bie wrote: > > On Fri, Nov 30, 2018 at 10:53:07AM -0500, Michael S. Tsirkin wrote: > > > On Fri, Nov 30, 2018 at 11:37:37PM +0800, Tiwei Bie wrote: > >

Re: [PATCH net-next v3 01/13] virtio: add packed ring types and macros

2018-11-30 Thread Tiwei Bie
On Fri, Nov 30, 2018 at 10:53:07AM -0500, Michael S. Tsirkin wrote: > On Fri, Nov 30, 2018 at 11:37:37PM +0800, Tiwei Bie wrote: > > On Fri, Nov 30, 2018 at 08:52:42AM -0500, Michael S. Tsirkin wrote: > > > On Fri, Nov 30, 2018 at 02:01:06PM +0100, Maxime Coquelin wrote: > &

Re: [PATCH net-next v3 01/13] virtio: add packed ring types and macros

2018-11-30 Thread Tiwei Bie
On Fri, Nov 30, 2018 at 08:52:42AM -0500, Michael S. Tsirkin wrote: > On Fri, Nov 30, 2018 at 02:01:06PM +0100, Maxime Coquelin wrote: > > On 11/30/18 1:47 PM, Michael S. Tsirkin wrote: > > > On Fri, Nov 30, 2018 at 05:53:40PM +0800, Tiwei Bie wrote: > > > > On F

Re: [PATCH net-next v3 01/13] virtio: add packed ring types and macros

2018-11-30 Thread Tiwei Bie
On Fri, Nov 30, 2018 at 04:10:55PM +0800, Jason Wang wrote: > > On 2018/11/21 下午6:03, Tiwei Bie wrote: > > Add types and macros for packed ring. > > > > Signed-off-by: Tiwei Bie > > --- > > include/uapi/linux/virtio_config.h | 3 +++ > >

[PATCH net-next v3 13/13] virtio_ring: advertize packed ring layout

2018-11-21 Thread Tiwei Bie
Advertize the packed ring layout support. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 40e4d3798d16..cd7e755484e3 100644 --- a/drivers/virtio/virtio_ring.c +++ b

[PATCH net-next v3 12/13] virtio_ring: disable packed ring on unsupported transports

2018-11-21 Thread Tiwei Bie
Currently, ccw, vop and remoteproc need some legacy virtio APIs to create or access virtio rings, which are not supported by packed ring. So disable packed ring on these transports for now. Signed-off-by: Tiwei Bie --- drivers/misc/mic/vop/vop_main.c| 13 + drivers

[PATCH net-next v3 11/13] virtio_ring: leverage event idx in packed ring

2018-11-21 Thread Tiwei Bie
Leverage the EVENT_IDX feature in packed ring to suppress events when it's available. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 77 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b

[PATCH net-next v3 10/13] virtio_ring: introduce packed ring support

2018-11-21 Thread Tiwei Bie
Introduce the packed ring support. Packed ring can only be created by vring_create_virtqueue() and each chunk of packed ring will be allocated individually. Packed ring can not be created on preallocated memory by vring_new_virtqueue() or the likes currently. Signed-off-by: Tiwei Bie

[PATCH net-next v3 09/13] virtio_ring: cache whether we will use DMA API

2018-11-21 Thread Tiwei Bie
Cache whether we will use DMA API, instead of doing the check every time. We are going to check whether DMA API is used more often in packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH net-next v3 08/13] virtio_ring: extract split ring handling from ring creation

2018-11-21 Thread Tiwei Bie
Introduce a specific function to create the split ring. And also move the DMA allocation and size information to the .split sub-structure. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 220 --- 1 file changed, 121 insertions(+), 99 deletions

[PATCH net-next v3 06/13] virtio_ring: introduce helper for indirect feature

2018-11-21 Thread Tiwei Bie
Introduce a helper to check whether we will use indirect feature. It will be used by packed ring too. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio

[PATCH net-next v3 05/13] virtio_ring: introduce debug helpers

2018-11-21 Thread Tiwei Bie
Introduce debug helpers for last_add_time update, check and invalid. They will be used by packed ring too. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 49 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/drivers/virtio

[PATCH net-next v3 04/13] virtio_ring: put split ring fields in a sub struct

2018-11-21 Thread Tiwei Bie
Put the split ring specific fields in a sub-struct named as "split" to avoid misuse after introducing packed ring. There is no functional change. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 156 +-- 1 file changed, 91 inserti

[PATCH net-next v3 03/13] virtio_ring: put split ring functions together

2018-11-21 Thread Tiwei Bie
Put the xxx_split() functions together to make the code more readable and avoid misuse after introducing the packed ring. There is no functional change. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 587 ++- 1 file changed, 302 insertions

[PATCH net-next v3 02/13] virtio_ring: add _split suffix for split ring functions

2018-11-21 Thread Tiwei Bie
Add _split suffix for split ring specific functions. This is a preparation for introducing the packed ring support. There is no functional change. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 269 ++- 1 file changed, 164 insertions(+), 105

[PATCH net-next v3 01/13] virtio: add packed ring types and macros

2018-11-21 Thread Tiwei Bie
Add types and macros for packed ring. Signed-off-by: Tiwei Bie --- include/uapi/linux/virtio_config.h | 3 +++ include/uapi/linux/virtio_ring.h | 52 ++ 2 files changed, 55 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi

Re: [PATCH net-next v3 00/13] virtio: support packed ring

2018-11-21 Thread Tiwei Bie
On Wed, Nov 21, 2018 at 07:20:27AM -0500, Michael S. Tsirkin wrote: > On Wed, Nov 21, 2018 at 06:03:17PM +0800, Tiwei Bie wrote: > > Hi, > > > > This patch set implements packed ring support in virtio driver. > > > > A performance test between pktgen (pkt

[PATCH net-next v3 00/13] virtio: support packed ring

2018-11-21 Thread Tiwei Bie
son); - Rename free_head -> next_avail_idx (Jason); - Add comments for virtio_wmb() in virtqueue_add_packed() (Jason); - Some other refinements and bug fixes; Tiwei Bie (13): virtio: add packed ring types and macros virtio_ring: add _split suffix for split ring functions virtio_ring: put sp

[PATCH net-next v3 07/13] virtio_ring: allocate desc state for split ring separately

2018-11-21 Thread Tiwei Bie
Put the split ring's desc state into the .split sub-structure, and allocate desc state for split ring separately, this makes the code more readable and more consistent with what we will do for packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 45

Re: [PATCH net-next v2 3/5] virtio_ring: add packed ring support

2018-11-08 Thread Tiwei Bie
On Thu, Nov 08, 2018 at 10:56:02AM -0500, Michael S. Tsirkin wrote: > On Thu, Nov 08, 2018 at 07:51:48PM +0800, Tiwei Bie wrote: > > On Thu, Nov 08, 2018 at 04:18:25PM +0800, Jason Wang wrote: > > > > > > On 2018/11/8 上午9:38, Tiwei Bie wrote: > > > > &g

Re: [PATCH net-next v2 3/5] virtio_ring: add packed ring support

2018-11-08 Thread Tiwei Bie
On Thu, Nov 08, 2018 at 04:18:25PM +0800, Jason Wang wrote: > > On 2018/11/8 上午9:38, Tiwei Bie wrote: > > > > + > > > > + if (vq->vq.num_free < descs_used) { > > > > + pr_debug("Can't add buf len %i - avail = %i\n", &g

Re: [PATCH net-next v2 3/5] virtio_ring: add packed ring support

2018-11-07 Thread Tiwei Bie
On Wed, Nov 07, 2018 at 12:48:46PM -0500, Michael S. Tsirkin wrote: > On Wed, Jul 11, 2018 at 10:27:09AM +0800, Tiwei Bie wrote: > > This commit introduces the support (without EVENT_IDX) for > > packed ring. > > > > Signed-off-by: Tiwei Bie > > --- > &

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Tiwei Bie
On Thu, Oct 11, 2018 at 10:17:15AM -0400, Michael S. Tsirkin wrote: > On Thu, Oct 11, 2018 at 10:13:31PM +0800, Tiwei Bie wrote: > > On Thu, Oct 11, 2018 at 09:48:48AM -0400, Michael S. Tsirkin wrote: > > > On Thu, Oct 11, 2018 at 08:12:21PM +0800, Tiwei Bie wrote: > > >

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Tiwei Bie
On Thu, Oct 11, 2018 at 09:48:48AM -0400, Michael S. Tsirkin wrote: > On Thu, Oct 11, 2018 at 08:12:21PM +0800, Tiwei Bie wrote: > > > > But if it's not too late, I second for a OUT_OF_ORDER feature. > > > > Starting from in order can have much simpler code in driv

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-10-11 Thread Tiwei Bie
On Wed, Oct 10, 2018 at 10:36:26AM -0400, Michael S. Tsirkin wrote: > On Thu, Sep 13, 2018 at 05:47:29PM +0800, Jason Wang wrote: > > On 2018年09月13日 16:59, Tiwei Bie wrote: > > > > If what you say is true then we should take a careful look > > > > and no

Re: [virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-09-13 Thread Tiwei Bie
On Wed, Sep 12, 2018 at 12:16:32PM -0400, Michael S. Tsirkin wrote: > On Tue, Sep 11, 2018 at 01:37:26PM +0800, Tiwei Bie wrote: > > On Mon, Sep 10, 2018 at 11:33:17AM +0800, Jason Wang wrote: > > > On 2018年09月10日 11:00, Tiwei Bie wrote: > > > > On Fri, Sep 07, 2018

Re: [PATCH net-next v2 2/5] virtio_ring: support creating packed ring

2018-09-12 Thread Tiwei Bie
On Mon, Sep 10, 2018 at 10:28:37AM +0800, Tiwei Bie wrote: > On Fri, Sep 07, 2018 at 10:03:24AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 11, 2018 at 10:27:08AM +0800, Tiwei Bie wrote: > > > This commit introduces the support for creating packed ring. > > > All sp

  1   2   3   >