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

2018-05-16 Thread Tiwei Bie
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/4/23/12 Both of ping and netperf worked as expected (with EVENT_IDX disabled). TODO: - Refinements

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

2018-05-16 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- 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/linux/virtio_config.h index 30

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

2018-05-16 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 | 764 +++ include/linux/virtio_r

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

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

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

2018-05-16 Thread Tiwei Bie
This commit introduces the event idx support in packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 75 +--- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c6c5d

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

2018-05-16 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 de3839f3621a..b158692263b0 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1940,6 +194

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

2018-05-16 Thread Sergei Shtylyov
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/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index de3839f3621a..b158692263b0 100644 --- a/drivers/virtio/virtio_ring.c +++ b

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/drivers/virtio/virtio_ring.c b/drivers/virtio/vir

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

2018-05-16 Thread Sergei Shtylyov
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(+) >>> >>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c >>> index de3839f3621a..b158692263b0 100644 >>> --- a/driv

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

2018-05-16 Thread Jason Wang
On 2018年05月16日 16:37, Tiwei Bie wrote: This commit introduces the basic support (without EVENT_IDX) for packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 491 ++- 1 file changed, 481 insertions(+), 10 deletions(-) diff --git a/drivers

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

2018-05-16 Thread Jason Wang
On 2018年05月16日 16:37, Tiwei Bie wrote: This commit introduces the event idx support in packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 75 +--- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring

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(+) > >>> > >>> diff --git a/drivers/virtio/virtio_ring.c b/driver

[RFC V4 PATCH 0/8] Packed ring layout for vhost

2018-05-16 Thread Jason Wang
Hi all: This RFC implement packed ring layout. The code were tested with Tiwei's RFC V3 ahttps://lkml.org/lkml/2018/4/25/34. Some fixups and tweaks were needed on top of Tiwei's code to make it run for event index. Pktgen reports about 20% improvement on PPS (event index is off). More testing is

[RFC V4 PATCH 1/8] vhost: move get_rx_bufs to vhost.c

2018-05-16 Thread Jason Wang
Move get_rx_bufs() to vhost.c and rename it to vhost_get_bufs(). This helps to hide vring internal layout from specific device implementation. Packed ring implementation will benefit from this. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 83 ++---

[RFC V4 PATCH 2/8] vhost: hide used ring layout from device

2018-05-16 Thread Jason Wang
We used to return descriptor head by vhost_get_vq_desc() to device and pass it back to vhost_add_used() and its friends. This exposes the internal used ring layout to device which makes it hard to be extended for e.g packed ring layout. So this patch tries to hide the used ring layout by - lettin

[RFC V4 PATCH 3/8] vhost: do not use vring_used_elem

2018-05-16 Thread Jason Wang
Instead of depending on the exported vring_used_elem, this patch switches to use a new internal structure vhost_used_elem which embed vring_used_elem in itself. This could be used to let vhost to record extra metadata for the incoming packed ring layout. Signed-off-by: Jason Wang --- drivers/vho

[RFC V4 PATCH 4/8] vhost_net: do not explicitly manipulate vhost_used_elem

2018-05-16 Thread Jason Wang
Two helpers of setting/getting used len were introduced to avoid explicitly manipulating vhost_used_elem in zerocopy code. This will be used to hide used_elem internals and simplify packed ring implementation. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 11 +-- drivers/vhost/vh

[RFC V4 PATCH 5/8] vhost: vhost_put_user() can accept metadata type

2018-05-16 Thread Jason Wang
We assumes used ring update is the only user for vhost_put_user() in the past. This may not be the case for the incoming packed ring which may update the descriptor ring for used. So introduce a new type parameter. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 14 +++--- 1 file c

[RFC V4 PATCH 6/8] virtio: introduce packed ring defines

2018-05-16 Thread Jason Wang
Signed-off-by: Jason Wang --- include/uapi/linux/virtio_config.h | 9 + include/uapi/linux/virtio_ring.h | 13 + 2 files changed, 22 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index 308e209..5903d51 100644 --- a/incl

[RFC V4 PATCH 7/8] vhost: packed ring support

2018-05-16 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vhost/net.c | 3 +- drivers/vhost/vhost.c | 539 ++ drivers/vhost/vhost.h | 8 +- 3 files changed, 513 insertions(+), 37 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 30273ad..

[RFC V4 PATCH 8/8] vhost: event suppression for packed ring

2018-05-16 Thread Jason Wang
This patch introduces basic support for event suppression aka driver and device area. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c| 168 --- drivers/vhost/vhost.h| 10 ++- include/uapi/linux/virtio_ring.h | 19 + 3 files ch

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 > > * guest byte order. *

Re: [PATCH 1/2] Convert target drivers to use sbitmap

2018-05-16 Thread kbuild test robot
Hi Matthew, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v4.17-rc5 next-20180516] [cannot apply to target/master] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url

[RFC PATCH] iscsit_wait_for_tag() can be static

2018-05-16 Thread kbuild test robot
Fixes: 5aff7a710f13 ("Convert target drivers to use sbitmap") Signed-off-by: Fengguang Wu --- iscsi_target_util.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 28bcffa..e147aef 100

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

2018-05-16 Thread Jason Wang
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 { @@ -116,6 +117,9 @@ struct vring_virtqueue { /* Last written value to driver->flags in

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(struct virtqueue *_vq) > > { > >

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

2018-05-16 Thread Jason Wang
On 2018年05月16日 20:58, Tiwei Bie wrote: 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(struct

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 { > > > > @@ -116,6 +117,9 @@ struct vring_vi

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

2018-05-16 Thread Jason Wang
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 Wang wrote: On 2018年05月16日 16:37, Tiwei Bie wrote: [...] struct vring_virtqueue { @@ -116,6 +117,9 @

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 Wang wrote: > > > > > On 2018年05月