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) >> +{ >> +struct virtio_vsock_pkt *pkt; >> +

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 receive mergeable rx buffer, it can merge

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

2018-12-16 Thread Stefan Hajnoczi
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) > +{ > + struct virtio_vsock_pkt *pkt; > + u16 num_buf; > + void *buf; > + unsi

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

2018-12-16 Thread Michael S. Tsirkin
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 receive mergeable rx buffer, it can merge > >> scatter rx buffer into a big buffer and then copy >

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 also use iovec to replace buf in

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

2018-12-14 Thread Michael S. Tsirkin
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 also use iovec to replace buf in struct > virtio_vsock_pkt, keep tx and rx consistency. The only >

[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