Re: [PATCH v2 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-18 Thread jiangyiwen
On 2018/12/12 23:09, Michael S. Tsirkin wrote: > On Wed, Dec 12, 2018 at 05:25:50PM +0800, jiangyiwen wrote: >> Now vsock only support send/receive small packet, it can't achieve >> high performance. As previous discussed with Jason Wang, I revisit the >> idea of vh

Re: [PATCH v2 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-17 Thread jiangyiwen
On 2018/12/14 0:34, Stefan Hajnoczi wrote: > On Wed, Dec 12, 2018 at 05:25:50PM +0800, jiangyiwen wrote: >> Now vsock only support send/receive small packet, it can't achieve >> high performance. As previous discussed with Jason Wang, I revisit the >> idea of vhost-net

Re: [PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-17 Thread jiangyiwen
On 2018/12/14 0:20, Stefan Hajnoczi wrote: > On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote: >> +static struct virtio_vsock_pkt *receive_mergeable(struct virtqueue *vq, >> +struct virtio_vsock *vsock, unsigned int *total_len) >> +{ >> +s

Re: [PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-17 Thread jiangyiwen
On 2018/12/13 22:29, Michael S. Tsirkin wrote: > On Thu, Dec 13, 2018 at 10:38:09AM +0800, jiangyiwen wrote: >> Hi Michael, >> >> On 2018/12/12 23:31, Michael S. Tsirkin wrote: >>> On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote: >>>> Guest

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-17 Thread jiangyiwen
On 2018/12/13 23:49, Stefan Hajnoczi wrote: > On Thu, Dec 13, 2018 at 11:08:04AM +0800, jiangyiwen wrote: >> On 2018/12/12 23:37, Michael S. Tsirkin wrote: >>> On Wed, Dec 12, 2018 at 05:29:31PM +0800, jiangyiwen wrote: >>>> When vhost support VIRTIO_VSOCK_F_MRG_RXB

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-17 Thread jiangyiwen
On 2018/12/13 22:50, Michael S. Tsirkin wrote: > On Thu, Dec 13, 2018 at 11:11:48AM +0800, jiangyiwen wrote: >> On 2018/12/13 3:09, David Miller wrote: >>> From: jiangyiwen >>> Date: Wed, 12 Dec 2018 17:29:31 +0800 >>> >>>> diff --git a/include/uapi

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-17 Thread jiangyiwen
On 2018/12/13 22:48, Michael S. Tsirkin wrote: > On Thu, Dec 13, 2018 at 11:08:04AM +0800, jiangyiwen wrote: >> On 2018/12/12 23:37, Michael S. Tsirkin wrote: >>> On Wed, Dec 12, 2018 at 05:29:31PM +0800, jiangyiwen wrote: >>>> When vhost support VIRTIO_VSOCK_F_M

Re: [PATCH v2 5/5] VSOCK: batch sending rx buffer to increase bandwidth

2018-12-17 Thread jiangyiwen
On 2018/12/13 23:17, Stefan Hajnoczi wrote: > On Wed, Dec 12, 2018 at 05:35:27PM +0800, jiangyiwen wrote: >> Batch sending rx buffer can improve total bandwidth. >> >> Signed-off-by: Yiwen Jiang >> --- > > Please send patches with git-send-email --thread --no-ch

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-15 Thread jiangyiwen
On 2018/12/13 13:59, David Miller wrote: > From: jiangyiwen > Date: Thu, 13 Dec 2018 11:11:48 +0800 > >> I hope Host can fill fewer bytes into rx virtqueue, so >> I keep structure virtio_vsock_mrg_rxbuf_hdr one byte >> alignment. > > The question is if this

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-15 Thread jiangyiwen
On 2018/12/13 3:09, David Miller wrote: > From: jiangyiwen > Date: Wed, 12 Dec 2018 17:29:31 +0800 > >> diff --git a/include/uapi/linux/virtio_vsock.h >> b/include/uapi/linux/virtio_vsock.h >> index 1d57ed3..2292f30 100644 >> --- a/include/uapi/linux/virtio_vs

Re: [PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-15 Thread jiangyiwen
On 2018/12/12 23:37, Michael S. Tsirkin wrote: > On Wed, Dec 12, 2018 at 05:29:31PM +0800, jiangyiwen wrote: >> When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, >> it will merge big packet into rx vq. >> >> Signed-off-by: Yiwen Jiang > > I feel this app

Re: [PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest

2018-12-15 Thread jiangyiwen
On 2018/12/13 3:08, David Miller wrote: > From: jiangyiwen > Date: Wed, 12 Dec 2018 17:28:16 +0800 > >> +static int fill_mergeable_rx_buff(struct virtio_vsock *vsock, >> +struct virtqueue *vq) >> +{ >> +struct page_frag *alloc_frag = &vsock-&g

Re: [PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-15 Thread jiangyiwen
Hi Michael, On 2018/12/12 23:31, Michael S. Tsirkin wrote: > On Wed, Dec 12, 2018 at 05:31:39PM +0800, jiangyiwen wrote: >> Guest receive mergeable rx buffer, it can merge >> scatter rx buffer into a big buffer and then copy >> to user space. >> >> In addition, it

Re: [PATCH v2 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-15 Thread jiangyiwen
On 2018/12/12 23:09, Michael S. Tsirkin wrote: > On Wed, Dec 12, 2018 at 05:25:50PM +0800, jiangyiwen wrote: >> Now vsock only support send/receive small packet, it can't achieve >> high performance. As previous discussed with Jason Wang, I revisit the >> idea of vh

[PATCH v2 5/5] VSOCK: batch sending rx buffer to increase bandwidth

2018-12-12 Thread jiangyiwen
Batch sending rx buffer can improve total bandwidth. Signed-off-by: Yiwen Jiang --- drivers/vhost/vsock.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 9600133..a4bf0a1 100644 --- a/drivers/vhost/

[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance

2018-12-12 Thread jiangyiwen
Since VSOCK already support mergeable rx buffer, so it can implement the balance with performance and guest memory, we can increase the sent pkt len to improve performance. And in order to be compatible with old version, so we still send max default rx buf size once. Signed-off-by: Yiwen Jiang --

[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-12 Thread jiangyiwen
Guest receive mergeable rx buffer, it can merge scatter rx buffer into a big buffer and then copy to user space. In addition, it also use iovec to replace buf in struct virtio_vsock_pkt, keep tx and rx consistency. The only difference is now tx still uses a segment of continuous physical memory to

[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-12 Thread jiangyiwen
When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, it will merge big packet into rx vq. Signed-off-by: Yiwen Jiang --- drivers/vhost/vsock.c | 111 ++ include/linux/virtio_vsock.h | 1 + include/uapi/linux/virtio_vsock.h | 5 ++ 3 files

[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest

2018-12-12 Thread jiangyiwen
In driver probing, if virtio has VIRTIO_VSOCK_F_MRG_RXBUF feature, it will fill mergeable rx buffer, support for host send mergeable rx buffer. It will fill a fixed size(PAGE_SIZE) everytime to compact with small packet and big packet. In addition, it also add one optimizations copied from virtio-

[PATCH v2 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-12 Thread jiangyiwen
Now vsock only support send/receive small packet, it can't achieve high performance. As previous discussed with Jason Wang, I revisit the idea of vhost-net about mergeable rx buffer and implement the mergeable rx buffer in vhost-vsock, it can allow big packet to be scattered in into different buffe

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-12-03 Thread jiangyiwen
On 2018/12/4 12:08, Michael S. Tsirkin wrote: > On Tue, Dec 04, 2018 at 10:21:40AM +0800, jiangyiwen wrote: >> On 2018/12/4 9:31, Michael S. Tsirkin wrote: >>> On Mon, Dec 03, 2018 at 11:10:58AM +0800, jiangyiwen wrote: >>>> On 2018/11/30 21:40, Michael S. Tsirkin wro

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-12-03 Thread jiangyiwen
On 2018/12/4 9:31, Michael S. Tsirkin wrote: > On Mon, Dec 03, 2018 at 11:10:58AM +0800, jiangyiwen wrote: >> On 2018/11/30 21:40, Michael S. Tsirkin wrote: >>> On Fri, Nov 30, 2018 at 09:10:03PM +0800, Jason Wang wrote: >>>> >>>> On 2018/11/30 下午8:55, Jas

Re: [PATCH 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-02 Thread jiangyiwen
On 2018/11/29 22:19, Stefan Hajnoczi wrote: > On Tue, Nov 06, 2018 at 01:53:54PM +0800, jiangyiwen wrote: >> On 2018/11/6 11:32, Jason Wang wrote: >>> >>> On 2018/11/6 上午11:17, jiangyiwen wrote: >>>> On 2018/11/6 10:41, Jason Wang wrote: >>>>>

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-12-02 Thread jiangyiwen
On 2018/11/30 21:40, Michael S. Tsirkin wrote: > On Fri, Nov 30, 2018 at 09:10:03PM +0800, Jason Wang wrote: >> >> On 2018/11/30 下午8:55, Jason Wang wrote: >>> >>> On 2018/11/30 下午8:52, Michael S. Tsirkin wrote: >>If you want to compare it with >> something that would be TCP or QUIC. Th

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-15 Thread jiangyiwen
On 2018/11/15 17:36, Yan Vugenfirer wrote: > > >> On 15 Nov 2018, at 05:56, jiangyiwen wrote: >> >> Hi Stefan, Michael, Jason and everyone, >> >> Several days ago, I discussed with jason about "Vsock over Virtio-net". >> This idea has two adv

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-15 Thread jiangyiwen
On 2018/11/15 17:21, Jason Wang wrote: > > On 2018/11/15 下午5:02, jiangyiwen wrote: >> On 2018/11/15 16:19, Jason Wang wrote: >>> On 2018/11/15 下午2:46, jiangyiwen wrote: >>>> On 2018/11/15 12:19, Jason Wang wrote: >>>>> On 2018/11/15 上午11:56, jiangy

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-15 Thread jiangyiwen
On 2018/11/15 16:19, Jason Wang wrote: > > On 2018/11/15 下午2:46, jiangyiwen wrote: >> On 2018/11/15 12:19, Jason Wang wrote: >>> On 2018/11/15 上午11:56, jiangyiwen wrote: >>>> Hi Stefan, Michael, Jason and everyone, >>>> >>>> Several days

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-15 Thread jiangyiwen
On 2018/11/15 16:10, Michael S. Tsirkin wrote: > On Thu, Nov 15, 2018 at 03:38:15PM +0800, jiangyiwen wrote: >> On 2018/11/15 15:04, Michael S. Tsirkin wrote: >>> On Thu, Nov 15, 2018 at 11:56:03AM +0800, jiangyiwen wrote: >>>> Hi Stefan, Michael, Jason and everyone,

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-14 Thread jiangyiwen
On 2018/11/15 15:04, Michael S. Tsirkin wrote: > On Thu, Nov 15, 2018 at 11:56:03AM +0800, jiangyiwen wrote: >> Hi Stefan, Michael, Jason and everyone, >> >> Several days ago, I discussed with jason about "Vsock over Virtio-net". >> This idea has two advant

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-14 Thread jiangyiwen
On 2018/11/15 14:46, jiangyiwen wrote: > On 2018/11/15 12:19, Jason Wang wrote: >> >> On 2018/11/15 上午11:56, jiangyiwen wrote: >>> Hi Stefan, Michael, Jason and everyone, >>> >>> Several days ago, I discussed with jason about "Vsock over Virtio-net&qu

Re: [RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-14 Thread jiangyiwen
On 2018/11/15 12:19, Jason Wang wrote: > > On 2018/11/15 上午11:56, jiangyiwen wrote: >> Hi Stefan, Michael, Jason and everyone, >> >> Several days ago, I discussed with jason about "Vsock over Virtio-net". >> This idea has two advantages: >> First

[RFC] Discuss about an new idea "Vsock over Virtio-net"

2018-11-14 Thread jiangyiwen
Hi Stefan, Michael, Jason and everyone, Several days ago, I discussed with jason about "Vsock over Virtio-net". This idea has two advantages: First, it can use many great features of virtio-net, like batching, mergeable rx buffer and multiqueue, etc. Second, it can reduce many duplicate codes and

Re: [PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-11-07 Thread jiangyiwen
On 2018/11/7 21:32, Jason Wang wrote: > > On 2018/11/7 下午3:11, jiangyiwen wrote: >> On 2018/11/7 14:18, Jason Wang wrote: >>> On 2018/11/6 下午2:30, jiangyiwen wrote: >>>>> Seems duplicated with the one used by vhost-net. >>>>> >>>&

Re: [PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-11-06 Thread jiangyiwen
On 2018/11/7 14:18, Jason Wang wrote: > > On 2018/11/6 下午2:30, jiangyiwen wrote: >>> Seems duplicated with the one used by vhost-net. >>> >>> In packed virtqueue implementation, I plan to move this to vhost.c. >>> >> Yes, this code is full

Re: [PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-11-06 Thread jiangyiwen
On 2018/11/7 14:20, Jason Wang wrote: > > On 2018/11/6 下午2:41, jiangyiwen wrote: >> On 2018/11/6 12:00, Jason Wang wrote: >>> On 2018/11/5 下午3:47, jiangyiwen wrote: >>>> Guest receive mergeable rx buffer, it can merge >>>> scatter rx buffer into

Re: [PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-11-05 Thread jiangyiwen
On 2018/11/6 12:00, Jason Wang wrote: > > On 2018/11/5 下午3:47, jiangyiwen wrote: >> Guest receive mergeable rx buffer, it can merge >> scatter rx buffer into a big buffer and then copy >> to user space. >> >> Signed-off-by: Yiwen Jiang >> --- >>

Re: [PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-11-05 Thread jiangyiwen
On 2018/11/6 11:43, Jason Wang wrote: > > On 2018/11/5 下午3:45, jiangyiwen wrote: >> When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, >> it will merge big packet into rx vq. >> >> Signed-off-by: Yiwen Jiang >> --- >>

Re: [PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest

2018-11-05 Thread jiangyiwen
On 2018/11/6 11:38, Jason Wang wrote: > > On 2018/11/5 下午3:45, jiangyiwen wrote: >> In driver probing, if virtio has VIRTIO_VSOCK_F_MRG_RXBUF feature, >> it will fill mergeable rx buffer, support for host send mergeable >> rx buffer. It will fill a page everytime to comp

Re: [PATCH 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-11-05 Thread jiangyiwen
On 2018/11/6 11:32, Jason Wang wrote: > > On 2018/11/6 上午11:17, jiangyiwen wrote: >> On 2018/11/6 10:41, Jason Wang wrote: >>> On 2018/11/6 上午10:17, jiangyiwen wrote: >>>> On 2018/11/5 17:21, Jason Wang wrote: >>>>> On 2018/11/5 下午3:43, jiangyiwen w

Re: [PATCH 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-11-05 Thread jiangyiwen
On 2018/11/6 10:41, Jason Wang wrote: > > On 2018/11/6 上午10:17, jiangyiwen wrote: >> On 2018/11/5 17:21, Jason Wang wrote: >>> On 2018/11/5 下午3:43, jiangyiwen wrote: >>>> Now vsock only support send/receive small packet, it can't achieve >>>>

Re: [PATCH 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-11-05 Thread jiangyiwen
On 2018/11/5 17:21, Jason Wang wrote: > > On 2018/11/5 下午3:43, jiangyiwen wrote: >> Now vsock only support send/receive small packet, it can't achieve >> high performance. As previous discussed with Jason Wang, I revisit the >> idea of vhost-net about mergeabl

[PATCH 4/5] VSOCK: modify default rx buf size to improve performance

2018-11-05 Thread jiangyiwen
Since VSOCK already support mergeable rx buffer, so it can implement the balance with performance and guest memory, we can increase the default rx buffer size to improve performance. Signed-off-by: Yiwen Jiang --- include/linux/virtio_vsock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 5/5] VSOCK: batch sending rx buffer to increase bandwidth

2018-11-04 Thread jiangyiwen
Batch sending rx buffer can improve total bandwidth. Signed-off-by: Yiwen Jiang --- drivers/vhost/vsock.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 648be39..a587ddc 100644 --- a/drivers/vhost/

[PATCH 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-11-04 Thread jiangyiwen
Guest receive mergeable rx buffer, it can merge scatter rx buffer into a big buffer and then copy to user space. Signed-off-by: Yiwen Jiang --- include/linux/virtio_vsock.h| 9 net/vmw_vsock/virtio_transport.c| 75 + net/vmw_vsock/virtio_

[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-11-04 Thread jiangyiwen
When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, it will merge big packet into rx vq. Signed-off-by: Yiwen Jiang --- drivers/vhost/vsock.c | 117 +++--- include/linux/virtio_vsock.h | 1 + include/uapi/linux/virtio_vsock.h | 5 ++ 3 files

[PATCH 1/5] VSOCK: support fill mergeable rx buffer in guest

2018-11-04 Thread jiangyiwen
In driver probing, if virtio has VIRTIO_VSOCK_F_MRG_RXBUF feature, it will fill mergeable rx buffer, support for host send mergeable rx buffer. It will fill a page everytime to compact with small packet and big packet. Signed-off-by: Yiwen Jiang --- include/linux/virtio_vsock.h | 3 ++ net/

[PATCH 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-11-04 Thread jiangyiwen
Now vsock only support send/receive small packet, it can't achieve high performance. As previous discussed with Jason Wang, I revisit the idea of vhost-net about mergeable rx buffer and implement the mergeable rx buffer in vhost-vsock, it can allow big packet to be scattered in into different buffe

Re: [RFC] VSOCK: The performance problem of vhost_vsock.

2018-10-17 Thread jiangyiwen
On 2018/10/17 20:31, Jason Wang wrote: > > On 2018/10/17 下午7:41, jiangyiwen wrote: >> On 2018/10/17 17:51, Jason Wang wrote: >>> On 2018/10/17 下午5:39, Jason Wang wrote: >>>>> Hi Jason and Stefan, >>>>> >>>>> Maybe I find the re

Re: [RFC] VSOCK: The performance problem of vhost_vsock.

2018-10-17 Thread jiangyiwen
On 2018/10/17 17:51, Jason Wang wrote: > > On 2018/10/17 下午5:39, Jason Wang wrote: >>> Hi Jason and Stefan, >>> >>> Maybe I find the reason of bad performance. >>> >>> I found pkt_len is limited to VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE(4K), >>> it will cause the bandwidth is limited to 500~600MB/s

Re: [RFC] VSOCK: The performance problem of vhost_vsock.

2018-10-17 Thread jiangyiwen
On 2018/10/17 17:39, Jason Wang wrote: > > On 2018/10/17 下午5:27, jiangyiwen wrote: >> On 2018/10/15 14:12, jiangyiwen wrote: >>> On 2018/10/15 10:33, Jason Wang wrote: >>>> >>>> On 2018年10月15日 09:43, jiangyiwen wrote: >>>>> Hi Stefan &

Re: [RFC] VSOCK: The performance problem of vhost_vsock.

2018-10-17 Thread jiangyiwen
On 2018/10/15 14:12, jiangyiwen wrote: > On 2018/10/15 10:33, Jason Wang wrote: >> >> >> On 2018年10月15日 09:43, jiangyiwen wrote: >>> Hi Stefan & All: >>> >>> Now I find vhost-vsock has two performance problems even if it >>> is not

Re: [RFC] VSOCK: The performance problem of vhost_vsock.

2018-10-14 Thread jiangyiwen
On 2018/10/15 10:33, Jason Wang wrote: > > > On 2018年10月15日 09:43, jiangyiwen wrote: >> Hi Stefan & All: >> >> Now I find vhost-vsock has two performance problems even if it >> is not designed for performance. >> >> First, I think vhost-vsock sho

[RFC] VSOCK: The performance problem of vhost_vsock.

2018-10-14 Thread jiangyiwen
Hi Stefan & All: Now I find vhost-vsock has two performance problems even if it is not designed for performance. First, I think vhost-vsock should faster than vhost-net because it is no TCP/IP stack, but the real test result vhost-net is 5~10 times than vhost-vsock, currently I am looking for the

[RFC] VSOCK: About Virtio-vsock support "Multiqueue" feature ?

2018-10-08 Thread jiangyiwen
Hi Stefan & All: Now virtio-vsock only supports two vqs(tx and rx), that means if multiple sockets in the guest will use the same vq to transmit the message and get the response. In this way, the bandwidth will be limited to ~700MB/s. So if there are multiple applications in the guest, we should s