Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-31 Thread Stefano Garzarella
On Tue, Mar 30, 2021 at 06:02:33PM -0700, Jiang Wang . wrote: Hi Stefano, I checked dgram code again. I think assigning transport for each packet is doable. The dgram will be similar to stream to have two transports. Yeah, make sense. If there is no other problem, I can submit a Linux

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-30 Thread Jiang Wang .
Hi Stefano, I checked dgram code again. I think assigning transport for each packet is doable. The dgram will be similar to stream to have two transports. If there is no other problem, I can submit a Linux kernel patch to support nested dgram on VMCI first. Then it will be easier for virtio

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-30 Thread Jiang Wang .
On Tue, Mar 30, 2021 at 8:32 AM Stefano Garzarella wrote: > > Hi Jiang, > > On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: > >Hi Michael and Stefan, > > > >I thought about this and discussed it with my colleague Cong Wang. > >One idea is to make current asynchronous send_pkt flow

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-30 Thread Jiang Wang .
On Tue, Mar 30, 2021 at 3:42 AM Stefan Hajnoczi wrote: > > On Mon, Mar 29, 2021 at 04:22:28PM -0700, Jiang Wang . wrote: > > On Mon, Mar 29, 2021 at 2:26 AM Stefan Hajnoczi wrote: > > > > > > On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: > > > > I thought about this and discussed

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-30 Thread Stefano Garzarella
Hi Jiang, On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: Hi Michael and Stefan, I thought about this and discussed it with my colleague Cong Wang. One idea is to make current asynchronous send_pkt flow to be synchronous, then if the virtqueue is full, the function can return

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-30 Thread Stefan Hajnoczi
On Mon, Mar 29, 2021 at 04:22:28PM -0700, Jiang Wang . wrote: > On Mon, Mar 29, 2021 at 2:26 AM Stefan Hajnoczi wrote: > > > > On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: > > > I thought about this and discussed it with my colleague Cong Wang. > > > One idea is to make current

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-29 Thread Jiang Wang .
On Mon, Mar 29, 2021 at 2:26 AM Stefan Hajnoczi wrote: > > On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: > > I thought about this and discussed it with my colleague Cong Wang. > > One idea is to make current asynchronous send_pkt flow to be synchronous, > > then if the virtqueue

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-29 Thread Stefan Hajnoczi
On Fri, Mar 26, 2021 at 04:40:09PM -0700, Jiang Wang . wrote: > I thought about this and discussed it with my colleague Cong Wang. > One idea is to make current asynchronous send_pkt flow to be synchronous, > then if the virtqueue is full, the function can return ENOMEM all the way > back > to

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-26 Thread Jiang Wang .
Hi Michael and Stefan, I thought about this and discussed it with my colleague Cong Wang. One idea is to make current asynchronous send_pkt flow to be synchronous, then if the virtqueue is full, the function can return ENOMEM all the way back to the caller and the caller can check the return

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-23 Thread Stefan Hajnoczi
On Mon, Mar 22, 2021 at 07:23:14PM -0700, Jiang Wang . wrote: > Got it. Will do. You could look at udp_sendmsg() to see how sockets compete when transmitting to the same net device. I'm not very familiar with this but I guess that the qdisc (like fq_codel) decides which packets to place into the

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-22 Thread Jiang Wang .
Got it. Will do. On Mon, Mar 22, 2021 at 4:10 PM Michael S. Tsirkin wrote: > > On Mon, Mar 22, 2021 at 04:02:14PM -0700, Jiang Wang . wrote: > > After dropping my additional accounting. I think there is still a question > > about if we want to protect the shared dgram virtqueue > > against bad

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-22 Thread Michael S. Tsirkin
On Mon, Mar 22, 2021 at 04:02:14PM -0700, Jiang Wang . wrote: > After dropping my additional accounting. I think there is still a question > about if we want to protect the shared dgram virtqueue > against bad dgram sockets or not. And if so, how to do it, or what to write > in the spec. For

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-22 Thread Jiang Wang .
On Mon, Mar 22, 2021 at 9:51 AM Stefan Hajnoczi wrote: > > On Thu, Mar 18, 2021 at 10:59:20AM -0700, Jiang Wang . wrote: > > On Wed, Mar 17, 2021 at 8:45 AM Stefan Hajnoczi wrote: > > > > > > On Tue, Mar 16, 2021 at 09:56:44PM +, jiang.wang wrote: > > > > Add supports for datagram type for

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-22 Thread Stefan Hajnoczi
On Thu, Mar 18, 2021 at 10:59:20AM -0700, Jiang Wang . wrote: > On Wed, Mar 17, 2021 at 8:45 AM Stefan Hajnoczi wrote: > > > > On Tue, Mar 16, 2021 at 09:56:44PM +, jiang.wang wrote: > > > Add supports for datagram type for virtio-vsock. Datagram > > > sockets are connectionless and

Re: [External] Re: [RFC PATCH] virtio-vsock: add description for datagram type

2021-03-18 Thread Jiang Wang .
On Wed, Mar 17, 2021 at 8:45 AM Stefan Hajnoczi wrote: > > On Tue, Mar 16, 2021 at 09:56:44PM +, jiang.wang wrote: > > Add supports for datagram type for virtio-vsock. Datagram > > sockets are connectionless and unreliable. To avoid contention > > with stream and other sockets, add two more