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] 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 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 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 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-01 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 3/3] virtio_ring: use new vring flags

2018-12-07 Thread Tiwei Bie
Switch to using the _SPLIT_ and _PACKED_ variants of vring flags in split ring and packed ring respectively. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 100 +-- 1 file changed, 59 insertions(+), 41 deletions(-) diff --git a/drivers/virtio

[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 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 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 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 +++ > >

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 +++ > >

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 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 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-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: [RFC v6 4/5] virtio_ring: add event idx support in packed ring

2018-06-08 Thread Tiwei Bie
On Thu, Jun 07, 2018 at 05:50:32PM +0800, Jason Wang wrote: > On 2018年06月05日 15:40, Tiwei Bie wrote: > > static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) > > { > > struct vring_virtqueue *vq = to_vvq(_vq); > > + u16 bufs, used_idx, wrap_co

Re: [RFC v6 4/5] virtio_ring: add event idx support in packed ring

2018-06-08 Thread Tiwei Bie
On Thu, Jun 07, 2018 at 05:50:32PM +0800, Jason Wang wrote: > On 2018年06月05日 15:40, Tiwei Bie wrote: > > static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) > > { > > struct vring_virtqueue *vq = to_vvq(_vq); > > + u16 bufs, used_idx, wrap_co

[PATCH] virtio: update the comments for transport features

2018-06-01 Thread Tiwei Bie
Suggested-by: Michael S. Tsirkin Signed-off-by: Tiwei Bie --- This patch is generated on top of below patch: https://lists.oasis-open.org/archives/virtio-dev/201805/msg00212.html include/uapi/linux/virtio_config.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PATCH] virtio: update the comments for transport features

2018-06-01 Thread Tiwei Bie
Suggested-by: Michael S. Tsirkin Signed-off-by: Tiwei Bie --- This patch is generated on top of below patch: https://lists.oasis-open.org/archives/virtio-dev/201805/msg00212.html include/uapi/linux/virtio_config.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

Re: [RFC v5 2/5] virtio_ring: support creating packed ring

2018-05-28 Thread Tiwei Bie
On Tue, May 29, 2018 at 10:49:11AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: > > This commit introduces the support for creating packed ring. > > All split ring specific functions are added _split suffix. > > Some necessary stubs for packe

Re: [RFC v5 2/5] virtio_ring: support creating packed ring

2018-05-28 Thread Tiwei Bie
On Tue, May 29, 2018 at 10:49:11AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: > > This commit introduces the support for creating packed ring. > > All split ring specific functions are added _split suffix. > > Some necessary stubs for packe

Re: [RFC v5 3/5] virtio_ring: add packed ring support

2018-05-28 Thread Tiwei Bie
On Tue, May 29, 2018 at 11:18:57AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: [...] > > +static void detach_buf_packed(struct vring_virtqueue *vq, > > + unsigned int id, void **ctx) > > +{ > > + struct vring_desc_state_pa

Re: [RFC v5 3/5] virtio_ring: add packed ring support

2018-05-28 Thread Tiwei Bie
On Tue, May 29, 2018 at 11:18:57AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: [...] > > +static void detach_buf_packed(struct vring_virtqueue *vq, > > + unsigned int id, void **ctx) > > +{ > > + struct vring_desc_state_pa

Re: [RFC v5 0/5] virtio: support packed ring

2018-05-24 Thread Tiwei Bie
On Fri, May 25, 2018 at 10:31:26AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: > > Hello everyone, > > > > This RFC implements packed ring support in virtio driver. > > > > Some simple functional tests have been done with Jason's > > p

Re: [RFC v5 0/5] virtio: support packed ring

2018-05-24 Thread Tiwei Bie
On Fri, May 25, 2018 at 10:31:26AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: > > Hello everyone, > > > > This RFC implements packed ring support in virtio driver. > > > > Some simple functional tests have been done with Jason's > > p

[RFC v5 1/5] virtio: add packed ring definitions

2018-05-22 Thread Tiwei Bie
Signed-off-by: Tiwei Bie <tiwei@intel.com> --- include/uapi/linux/virtio_config.h | 5 - include/uapi/linux/virtio_ring.h | 36 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi

[RFC v5 1/5] virtio: add packed ring definitions

2018-05-22 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- include/uapi/linux/virtio_config.h | 5 - include/uapi/linux/virtio_ring.h | 36 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index

[RFC v5 3/5] virtio_ring: add packed ring support

2018-05-22 Thread Tiwei Bie
This commit introduces the support (without EVENT_IDX) for packed ring. Signed-off-by: Tiwei Bie <tiwei@intel.com> --- drivers/virtio/virtio_ring.c | 474 ++- 1 file changed, 468 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ri

[RFC v5 3/5] virtio_ring: add packed ring support

2018-05-22 Thread Tiwei Bie
This commit introduces the support (without EVENT_IDX) for packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 474 ++- 1 file changed, 468 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio

[RFC v5 2/5] virtio_ring: support creating packed ring

2018-05-22 Thread Tiwei Bie
This commit introduces the support for creating packed ring. All split ring specific functions are added _split suffix. Some necessary stubs for packed ring are also added. Signed-off-by: Tiwei Bie <tiwei@intel.com> --- drivers/virtio/virtio_ring.c

[RFC v5 4/5] virtio_ring: add event idx support in packed ring

2018-05-22 Thread Tiwei Bie
This commit introduces the EVENT_IDX support in packed ring. Signed-off-by: Tiwei Bie <tiwei@intel.com> --- drivers/virtio/virtio_ring.c | 67 ++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/

[RFC v5 2/5] virtio_ring: support creating packed ring

2018-05-22 Thread Tiwei Bie
This commit introduces the support for creating packed ring. All split ring specific functions are added _split suffix. Some necessary stubs for packed ring are also added. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 801 +++ include/linux

[RFC v5 4/5] virtio_ring: add event idx support in packed ring

2018-05-22 Thread Tiwei Bie
This commit introduces the EVENT_IDX support in packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 67 ++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index

[RFC v5 5/5] virtio_ring: enable packed ring

2018-05-22 Thread Tiwei Bie
Signed-off-by: Tiwei Bie <tiwei@intel.com> --- 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 1ee52a89cb04..355dfef4f1eb 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/

[RFC v5 5/5] virtio_ring: enable packed ring

2018-05-22 Thread Tiwei Bie
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 1ee52a89cb04..355dfef4f1eb 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1956,6

[RFC v5 0/5] virtio: support packed ring

2018-05-22 Thread Tiwei Bie
packed ring and split ring (Jason); - Avoid using '%' operator (Jason); - Rename free_head -> next_avail_idx (Jason); - Add comments for virtio_wmb() in virtqueue_add_packed() (Jason); - Some other refinements and bug fixes; Thanks! Tiwei Bie (5): virtio: add packed ring definitions virti

[RFC v5 0/5] virtio: support packed ring

2018-05-22 Thread Tiwei Bie
packed ring and split ring (Jason); - Avoid using '%' operator (Jason); - Rename free_head -> next_avail_idx (Jason); - Add comments for virtio_wmb() in virtqueue_add_packed() (Jason); - Some other refinements and bug fixes; Thanks! Tiwei Bie (5): virtio: add packed ring definitions virti

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-20 Thread Tiwei Bie
On Mon, May 21, 2018 at 10:30:51AM +0800, Jason Wang wrote: > On 2018年05月19日 10:29, Tiwei Bie wrote: > > > I don't hope so. > > > > > > > I agreed driver should track the DMA addrs or some > > > > other necessary things from the very beginning. And

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-20 Thread Tiwei Bie
On Mon, May 21, 2018 at 10:30:51AM +0800, Jason Wang wrote: > On 2018年05月19日 10:29, Tiwei Bie wrote: > > > I don't hope so. > > > > > > > I agreed driver should track the DMA addrs or some > > > > other necessary things from the very beginning. And

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-18 Thread Tiwei Bie
On Sat, May 19, 2018 at 09:12:30AM +0800, Jason Wang wrote: > On 2018年05月18日 22:33, Tiwei Bie wrote: > > On Fri, May 18, 2018 at 09:17:05PM +0800, Jason Wang wrote: > > > On 2018年05月18日 19:29, Tiwei Bie wrote: > > > > On Thu, May 17, 2018 at 08:01:52PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-18 Thread Tiwei Bie
On Sat, May 19, 2018 at 09:12:30AM +0800, Jason Wang wrote: > On 2018年05月18日 22:33, Tiwei Bie wrote: > > On Fri, May 18, 2018 at 09:17:05PM +0800, Jason Wang wrote: > > > On 2018年05月18日 19:29, Tiwei Bie wrote: > > > > On Thu, May 17, 2018 at 08:01:52PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-18 Thread Tiwei Bie
On Fri, May 18, 2018 at 09:17:05PM +0800, Jason Wang wrote: > On 2018年05月18日 19:29, Tiwei Bie wrote: > > On Thu, May 17, 2018 at 08:01:52PM +0800, Jason Wang wrote: > > > On 2018年05月16日 22:33, Tiwei Bie wrote: > > > > On Wed, May 16, 2018 at 10:05:44PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-18 Thread Tiwei Bie
On Fri, May 18, 2018 at 09:17:05PM +0800, Jason Wang wrote: > On 2018年05月18日 19:29, Tiwei Bie wrote: > > On Thu, May 17, 2018 at 08:01:52PM +0800, Jason Wang wrote: > > > On 2018年05月16日 22:33, Tiwei Bie wrote: > > > > On Wed, May 16, 2018 at 10:05:44PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-18 Thread Tiwei Bie
On Thu, May 17, 2018 at 08:01:52PM +0800, Jason Wang wrote: > On 2018年05月16日 22:33, Tiwei Bie wrote: > > On Wed, May 16, 2018 at 10:05:44PM +0800, Jason Wang wrote: > > > On 2018年05月16日 21:45, Tiwei Bie wrote: > > > > On Wed, May 16, 2018 at 08:51:43PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-18 Thread Tiwei Bie
On Thu, May 17, 2018 at 08:01:52PM +0800, Jason Wang wrote: > On 2018年05月16日 22:33, Tiwei Bie wrote: > > On Wed, May 16, 2018 at 10:05:44PM +0800, Jason Wang wrote: > > > On 2018年05月16日 21:45, Tiwei Bie wrote: > > > > On Wed, May 16, 2018 at 08:51:43PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 10:05:44PM +0800, Jason Wang wrote: > On 2018年05月16日 21:45, Tiwei Bie wrote: > > On Wed, May 16, 2018 at 08:51:43PM +0800, Jason Wang wrote: > > > On 2018年05月16日 20:39, Tiwei Bie wrote: > > > > On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 10:05:44PM +0800, Jason Wang wrote: > On 2018年05月16日 21:45, Tiwei Bie wrote: > > On Wed, May 16, 2018 at 08:51:43PM +0800, Jason Wang wrote: > > > On 2018年05月16日 20:39, Tiwei Bie wrote: > > > > On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wa

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 08:51:43PM +0800, Jason Wang wrote: > On 2018年05月16日 20:39, Tiwei Bie wrote: > > On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wang wrote: > > > On 2018年05月16日 16:37, Tiwei Bie wrote: > > [...] > > > >struct vring_virtqueue

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 08:51:43PM +0800, Jason Wang wrote: > On 2018年05月16日 20:39, Tiwei Bie wrote: > > On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wang wrote: > > > On 2018年05月16日 16:37, Tiwei Bie wrote: > > [...] > > > >struct vring_virtqueue

Re: [RFC v4 4/5] virtio_ring: add event idx support in packed ring

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 08:17:21PM +0800, Jason Wang wrote: > On 2018年05月16日 16:37, Tiwei Bie wrote: [...] > > @@ -1160,15 +1186,27 @@ static void virtqueue_disable_cb_packed(struct > > virtqueue *_vq) > > static unsigned virtqueue_enable_cb_prepare_packed(

Re: [RFC v4 4/5] virtio_ring: add event idx support in packed ring

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 08:17:21PM +0800, Jason Wang wrote: > On 2018年05月16日 16:37, Tiwei Bie wrote: [...] > > @@ -1160,15 +1186,27 @@ static void virtqueue_disable_cb_packed(struct > > virtqueue *_vq) > > static unsigned virtqueue_enable_cb_prepare_packed(

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wang wrote: > On 2018年05月16日 16:37, Tiwei Bie wrote: [...] > > struct vring_virtqueue { > > @@ -116,6 +117,9 @@ struct vring_virtqueue { > > /* Last written value to driver->flags in > >

Re: [RFC v4 3/5] virtio_ring: add packed ring support

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wang wrote: > On 2018年05月16日 16:37, Tiwei Bie wrote: [...] > > struct vring_virtqueue { > > @@ -116,6 +117,9 @@ struct vring_virtqueue { > > /* Last written value to driver->flags in > >

Re: [RFC v4 5/5] virtio_ring: enable packed ring

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 02:42:53PM +0300, Sergei Shtylyov wrote: > On 05/16/2018 01:21 PM, Tiwei Bie wrote: > > >>> Signed-off-by: Tiwei Bie <tiwei@intel.com> > >>> --- > >>> drivers/virtio/virtio_ring.c | 2 ++ > >>> 1 file chan

Re: [RFC v4 5/5] virtio_ring: enable packed ring

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 02:42:53PM +0300, Sergei Shtylyov wrote: > On 05/16/2018 01:21 PM, Tiwei Bie wrote: > > >>> Signed-off-by: Tiwei Bie > >>> --- > >>> drivers/virtio/virtio_ring.c | 2 ++ > >>> 1 file changed, 2 insertions(+) &

Re: [RFC v4 5/5] virtio_ring: enable packed ring

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 01:15:48PM +0300, Sergei Shtylyov wrote: > On 5/16/2018 11:37 AM, Tiwei Bie wrote: > > > Signed-off-by: Tiwei Bie <tiwei@intel.com> > > --- > > drivers/virtio/virtio_ring.c | 2 ++ > > 1 file changed, 2 insertions(+)

Re: [RFC v4 5/5] virtio_ring: enable packed ring

2018-05-16 Thread Tiwei Bie
On Wed, May 16, 2018 at 01:15:48PM +0300, Sergei Shtylyov wrote: > On 5/16/2018 11:37 AM, Tiwei Bie wrote: > > > Signed-off-by: Tiwei Bie > > --- > > drivers/virtio/virtio_ring.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/dri

[RFC v4 1/5] virtio: add packed ring definitions

2018-05-16 Thread Tiwei Bie
Signed-off-by: Tiwei Bie <tiwei@intel.com> --- include/uapi/linux/virtio_config.h | 12 +- include/uapi/linux/virtio_ring.h | 36 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi

  1   2   3   >