On 11.02.2021 15:27, Stefano Garzarella wrote:
> On Sun, Feb 07, 2021 at 06:16:12PM +0300, Arseny Krasnov wrote:
>> This does rest of SOCK_SEQPACKET support:
>> 1) Adds socket ops for SEQPACKET type.
>> 2) Allows to create socket with SEQPACKET type.
>>
>&
On 11.02.2021 18:11, Jorgen Hansen wrote:
>> On 7 Feb 2021, at 16:14, Arseny Krasnov wrote:
>>
>> This moves wait loop for data to dedicated function, because later
>> it will be used by SEQPACKET data receive loop.
>>
>> Signed-off-by: Arseny Krasnov
>
On 11.02.2021 17:57, Stefano Garzarella wrote:
> Hi Arseny,
>
> On Mon, Feb 08, 2021 at 09:32:59AM +0300, Arseny Krasnov wrote:
>> On 07.02.2021 19:20, Michael S. Tsirkin wrote:
>>> On Sun, Feb 07, 2021 at 06:12:56PM +0300, Arseny Krasnov wrote:
>>>>
On 23.02.2021 17:50, Stefano Garzarella wrote:
> On Mon, Feb 22, 2021 at 03:23:11PM +0100, Stefano Garzarella wrote:
>> Hi Arseny,
>>
>> On Thu, Feb 18, 2021 at 08:33:44AM +0300, Arseny Krasnov wrote:
>>> This patchset impelements support of SOCK_SEQP
On 23.02.2021 17:17, Michael S. Tsirkin wrote:
> On Thu, Feb 18, 2021 at 08:39:37AM +0300, Arseny Krasnov wrote:
>> This adds transport callback and it's logic for SEQPACKET dequeue.
>> Callback fetches RW packets from rx queue of socket until whole record
>> is copie
On 24.02.2021 11:23, Stefano Garzarella wrote:
> On Wed, Feb 24, 2021 at 07:29:25AM +0300, Arseny Krasnov wrote:
>> On 23.02.2021 17:50, Stefano Garzarella wrote:
>>> On Mon, Feb 22, 2021 at 03:23:11PM +0100, Stefano Garzarella wrote:
>>>> Hi Arseny,
>>>&g
On 24.02.2021 11:35, Stefano Garzarella wrote:
> On Wed, Feb 24, 2021 at 11:28:50AM +0300, Arseny Krasnov wrote:
>> On 24.02.2021 11:23, Stefano Garzarella wrote:
>>> On Wed, Feb 24, 2021 at 07:29:25AM +0300, Arseny Krasnov wrote:
>>>> On 23.02.2021 17:50, Stefano
On 07.02.2021 18:17, Arseny Krasnov wrote:
> This adds rest of logic for SEQPACKET:
> 1) Packet's type is now set in 'virtio_send_pkt_info()' using
>type of socket.
> 2) SEQPACKET specific functions which send SEQ_BEGIN/SEQ_END.
>Note that both functions
This prepares af_vsock.c for SEQPACKET support: some functions such
as setsockopt(), getsockopt(), connect(), recvmsg(), sendmsg() are
shared between both types of sockets, so rename them in general
manner.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 64
This moves wait loop for data to dedicated function, because later
it will be used by SEQPACKET data receive loop.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 155 +--
1 file changed, 83 insertions(+), 72 deletions(-)
diff --git a/net
t is
that user is not woken up until whole record is received or error
occurred. Implementation also supports 'MSG_EOR' and 'MSG_TRUNC' flags.
Tests also implemented.
Arseny Krasnov (19):
af_vsock: update functions for connectible socket
af_vsock: separate wai
This moves STREAM specific data receive logic to dedicated function:
'__vsock_stream_recvmsg()', while checks that will be same for both
types of socket are in shared function: 'vsock_connectible_recvmsg()'.
Signed-off-by: Arseny Krasnov
---
net/vmw_vs
so to avoid it, sender waits until
enough space will be ready.
Signed-off-by: Arseny Krasnov
---
include/net/af_vsock.h | 2 +
net/vmw_vsock/af_vsock.c | 99 +---
2 files changed, 63 insertions(+), 38 deletions(-)
diff --git a/include/net/af_vsock.h b/includ
This does rest of SOCK_SEQPACKET support:
1) Adds socket ops for SEQPACKET type.
2) Allows to create socket with SEQPACKET type.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 36 +++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a
in SEQPACKET case.
3) It waits until whole record is received or error is found during
receiving.
4) It processes and sets 'MSG_TRUNC' flag.
So to avoid extra conditions for two types of socket inside one loop, two
independent functions were created.
Signed-off-by: Arseny Krasnov
---
This adds some logic to current stream enqueue function for SEQPACKET
support:
1) Send record's begin/end marker.
2) Return value from enqueue function is whole record length or error
for SOCK_SEQPACKET.
Signed-off-by: Arseny Krasnov
---
include/net/af_vsock.h | 2 ++
net/vmw_
This replaces 'stream' to 'connect oriented' in comments as SEQPACKET is
also connect oriented.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 31 +--
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/net/vmw_vs
'virtio_transport_send_credit_update()' has some extra args:
1) 'type' may be set in 'virtio_transport_send_pkt_info()' using type
of socket.
2) This function is static and 'hdr' arg was always NULL.
Signed-off-by: Arseny Krasnov
---
net/
This moves passing type of packet from 'info' srtucture to send
function. There is no sense to set type of packet which differs
from type of socket, and since at current time only stream type
is supported, so force to use this type.
Signed-off-by: Arseny Krasnov
---
net
ov iterator(previous unfinished data is dropped).
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 10 +++
include/uapi/linux/virtio_vsock.h | 16
net/vmw_vsock/virtio_transport_common.c | 114
3 files changed, 140 insertions(+)
packet type during send.
5) Set MSG_EOR in flags for SEQPACKET during send.
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 3 ++
net/vmw_vsock/virtio_transport_common.c | 67 -
2 files changed, 68 insertions(+), 2 deletions(-)
diff --git a
This adds transport callback which tries to fetch record begin marker
from socket's rx queue. It is called from af_vsock.c before reading data
packets of record.
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 1 +
net/vmw_vsock/virtio_transport_common.c
n receive(if mismatch,
then reset connection).
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/virtio_transport_common.c | 63 +
1 file changed, 44 insertions(+), 19 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c
b/net/vmw_vsock/virtio_transpo
This adds SEQPACKET ops for loopback transport
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/vsock_loopback.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c
index a45f7ffca8c5..c0da94119f74 100644
--- a/net/vmw_vsock
This adds SEQPACKET ops for virtio transport
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/virtio_transport.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 2700a63ab095..bd3a854bb366 100644
--- a/net
This also removes ignore of non-stream type of packets.
Signed-off-by: Arseny Krasnov
---
drivers/vhost/vsock.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 5e78fb719602..5c86d09e36d9 100644
--- a/drivers/vhost
This updates current implementation for trace event of virtio vsock:
SEQPACKET socket's type, SEQPACKET specific ops and SEQPACKET 'msg_len'
and 'msg_cnt' fields are added.
Signed-off-by: Arseny Krasnov
---
.../events/vsock_virtio_transport_common.h| 48 +
This adds two tests of SOCK_SEQPACKET socket: both transfer data and
then test MSG_EOR and MSG_TRUNC flags. Cases for connect(), bind(),
etc. are not tested, because it is same as for stream socket.
Signed-off-by: Arseny Krasnov
---
tools/testing/vsock/util.c | 32 ++--
tools/testing
On 28.01.2021 19:55, Stefano Garzarella wrote:
> On Mon, Jan 25, 2021 at 02:12:36PM +0300, Arseny Krasnov wrote:
>> This adds receive loop for SEQPACKET. It looks like receive loop for
>> SEQPACKET, but there is a little bit difference:
>> 1) It doesn't call notify c
On 28.01.2021 20:19, Stefano Garzarella wrote:
> Hi Arseny,
> I reviewed a part, tomorrow I hope to finish the other patches.
>
> Just a couple of comments in the TODOs below.
>
> On Mon, Jan 25, 2021 at 02:09:00PM +0300, Arseny Krasnov wrote:
>> This patchse
On 01.02.2021 14:02, Stefano Garzarella wrote:
> On Fri, Jan 29, 2021 at 06:52:23PM +0300, Arseny Krasnov wrote:
>> On 29.01.2021 12:26, Stefano Garzarella wrote:
>>> On Fri, Jan 29, 2021 at 09:41:50AM +0300, Arseny Krasnov wrote:
>>>> On 28.01.2021 20:19, Stef
On 01.02.2021 17:23, Stefano Garzarella wrote:
> On Mon, Feb 01, 2021 at 04:57:18PM +0300, Arseny Krasnov wrote:
>> On 01.02.2021 14:02, Stefano Garzarella wrote:
>>> On Fri, Jan 29, 2021 at 06:52:23PM +0300, Arseny Krasnov wrote:
>>>> On 29.01.2021 12:26, Stefano
On 25.02.2021 19:27, Jorgen Hansen wrote:
> On 18 Feb 2021, at 06:37, Arseny Krasnov wrote:
>> This adds receive loop for SEQPACKET. It looks like receive loop for
>> STREAM, but there is a little bit difference:
>> 1) It doesn't call notify callbacks.
>> 2) It
On 25.02.2021 17:24, Jorgen Hansen wrote:
>> On 18 Feb 2021, at 06:36, Arseny Krasnov
>> wrote:
>>
>> This moves wait loop for data to dedicated function, because later
>> it will be used by SEQPACKET data receive loop.
>>
>> Signed-off-by: Arseny K
On 24.02.2021 09:41, Michael S. Tsirkin wrote:
> On Wed, Feb 24, 2021 at 08:07:48AM +0300, Arseny Krasnov wrote:
>> On 23.02.2021 17:17, Michael S. Tsirkin wrote:
>>> On Thu, Feb 18, 2021 at 08:39:37AM +0300, Arseny Krasnov wrote:
>>>> This adds transport callbac
> Hmm, are you sure you need to convert
> "err" to the pointer, just to return true/false
> as the return value?
> How about still returning "err" itself?
In this case i need to reserve some value for
"err" as success, because both 0 and negative
values are passed to caller when this function
retu
er is not woken up until whole record is received or error
occurred. Implementation also supports 'MSG_EOR' and 'MSG_TRUNC' flags.
Tests also implemented.
Arseny Krasnov (13):
af_vsock: implement 'vsock_wait_data()'.
af_vsock: separate rx loops for STREAM/SEQP
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 47
1 file changed, 47 insertions(+)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index b12d3a322242..af716f5a93a4 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_v
This adds entry point for STREAM/SEQPACKET rx loops. As both types are
connect oriented, so there are same checks before reading data from
socket. All this checks are performed in this entry point, then specific
rx loop is called.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 55
This removes previous 'vsock_stream_recvmsg()' and uses newly implemented
receive loops. Moved to separate patch to make review easier.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 184 +++
1 file changed, 12 insertions(+), 172
s no sense for these values in SEQPACKET case.
3) It waits until whole record is received or error is found during
receiving.
4) It processes and sets 'MSG_TRUNC' flag.
So to avoid extra conditions for two types of socket inside on loop, two
independent functions were created.
Signed-
This adds socket operations for SOCK_SEQPACKET and adds this type of
socket for conditions where SOCK_STREAM is involved because both type of
sockets are connect oriented.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 108 +--
1 file changed
This replaces 'stream' to 'connect oriented' in comments as SEQPACKET is
also connect oriented.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 31 +--
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/net/vmw_vs
This adds some logic to current stream enqueue function for SEQPACKET
support:
1) Send record begin marker with length of record.
2) Return value from enqueue function is wholevrecord length or error for
SOCK_SEQPACKET.
Signed-off-by: Arseny Krasnov
---
include/net/af_vsock.h | 1 +
net
ov iterator(previous unfinished data is dropped).
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 4 +
include/uapi/linux/virtio_vsock.h | 9 ++
net/vmw_vsock/virtio_transport_common.c | 128
3 files changed, 141 insertions(+)
diff -
send
whole record to TAP interface. This could be done by allocating
new packet when whole record is received, data of record must be
copied to TAP packet.
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 7
net/vmw_vsock/virtio_transport.c| 4
This adds transport callback which tries to fetch record begin marker from
socket's rx queue. It is called from af_vsock.c before reading data
packets of record.
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 1 +
net/vmw_vsock/virtio_transport_common.c
then reset connection).
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/virtio_transport_common.c | 79 ++---
1 file changed, 58 insertions(+), 21 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c
b/net/vmw_vsock/virtio_transport_common.c
index fe1272e7
This adds transport ops and removes ignore of non-stream type of packets.
Signed-off-by: Arseny Krasnov
---
drivers/vhost/vsock.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 5e78fb719602..4d60a99aed14 100644
This adds two tests of SOCK_SEQPACKET socket: both transfer data and then
test MSG_EOR and MSG_TRUNC flags. Cases for connect(), bind(), etc. are
not tested, because it is same as for stream socket.
Signed-off-by: Arseny Krasnov
---
tools/testing/vsock/util.c | 32 ++--
tools
' flag is implemented with special value of 'flags'
field in packet header. When record is received with such flags,
'MSG_EOR' is set in 'recvmsg()' flags.
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 7 +
include/net/af_vsock.h
This patch simply adds transport ops and removes
ignore of non-stream type of packets.
Signed-off-by: Arseny Krasnov
---
drivers/vhost/vsock.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index a483cec31d5c
it waits until whole record is
received or error in found during receiving and it takes
care about 'MSG_TRUNC' flag.
3) Update some comments('stream' -> 'connect oriented').
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 4
On 25.03.2021 12:34, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:10:03PM +0300, Arseny Krasnov wrote:
>> This adds receive loop for SEQPACKET. It looks like receive loop for
>> STREAM, but there is a little bit difference:
>> 1) It doesn't call notify callba
On 25.03.2021 12:56, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:12:41PM +0300, Arseny Krasnov wrote:
>> This adds transport callback and it's logic for SEQPACKET dequeue.
>> Callback fetches RW packets from rx queue of socket until whole record
>> is copie
On 25.03.2021 13:08, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:12:55PM +0300, Arseny Krasnov wrote:
>> This adds transport callback which tries to fetch record begin marker
> >from socket's rx queue. It is called from af_vsock.c before reading data
>> packe
On 25.03.2021 13:18, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:13:29PM +0300, Arseny Krasnov wrote:
>> This adds rest of logic for SEQPACKET:
>> 1) SEQPACKET specific functions which send SEQ_BEGIN/SEQ_END.
>> Note that both functions may sleep to
On 25.03.2021 13:26, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:13:49PM +0300, Arseny Krasnov wrote:
>> This adds new virtio vsock specific feature bit which means
>> SOCK_SEQPACKET support. Guest negotiates this bit with vhost,
>> thus checking that vhost si
On 25.03.2021 13:39, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:14:03PM +0300, Arseny Krasnov wrote:
>> This adds SEQPACKET ops for virtio transport and 'seqpacket_allow()'
>> callback.
>>
>> Signed-off-by: Arseny Krasnov
>> -
On 25.03.2021 13:42, Stefano Garzarella wrote:
> On Tue, Mar 23, 2021 at 04:14:18PM +0300, Arseny Krasnov wrote:
>> This also removes ignore of non-stream type of packets and adds
>> 'seqpacket_allow()' callback.
>>
>> Signed-off-by: Arseny Krasnov
On 25.03.2021 13:52, Stefano Garzarella wrote:
> Hi Arseny,
>
> On Tue, Mar 23, 2021 at 04:07:13PM +0300, Arseny Krasnov wrote:
>> This patchset implements support of SOCK_SEQPACKET for virtio
>> transport.
>> As SOCK_SEQPACKET guarantees to save record boun
supports 'MSG_EOR' and 'MSG_TRUNC' flags.
Tests also implemented.
Thanks to st...@yandex.ru for encouragements and initial design
recommendations.
Arseny Krasnov (22):
af_vsock: update functions for connectible socket
af_vsock: separate wait data loop
This prepares af_vsock.c for SEQPACKET support: some functions such
as setsockopt(), getsockopt(), connect(), recvmsg(), sendmsg() are
shared between both types of sockets, so rename them in general
manner.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock
This moves wait loop for data to dedicated function, because later it
will be used by SEQPACKET data receive loop. While moving the code
around, let's update an old comment.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/af_vsock.c
Move STREAM specific data receive logic to '__vsock_stream_recvmsg()'
dedicated function, while checks, that will be same for both STREAM
and SEQPACKET sockets, stays in 'vsock_connectible_recvmsg()' shared
functions.
Signed-off-by: Arseny Krasnov
---
net/vmw_vs
in SEQPACKET case.
3) It waits until whole record is received or error is found during
receiving.
4) It processes and sets 'MSG_TRUNC' flag.
So to avoid extra conditions for two types of socket inside one loop, two
independent functions were created.
Signed-off-by: Arseny Krasnov
---
v6
so to avoid it, sender waits until
enough space will be ready.
Signed-off-by: Arseny Krasnov
---
include/net/af_vsock.h | 2 +
net/vmw_vsock/af_vsock.c | 99 +---
2 files changed, 63 insertions(+), 38 deletions(-)
diff --git a/include/net/af_vsock.h b/includ
This adds some logic to current stream enqueue function for SEQPACKET
support:
1) Use transport's seqpacket enqueue callback.
2) Return value from enqueue function is whole record length or error
for SOCK_SEQPACKET.
Signed-off-by: Arseny Krasnov
---
v6 -> v7:
'seqpacket_enqu
This does rest of SOCK_SEQPACKET support:
1) Adds socket ops for SEQPACKET type.
2) Allows to create socket with SEQPACKET type.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
include/net/af_vsock.h | 1 +
net/vmw_vsock/af_vsock.c | 36
This replaces 'stream' to 'connection oriented' in comments as
SEQPACKET is also connection oriented.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/af_vsock.c | 31 +--
1 file changed, 17 insertions(+), 14 deleti
ort_send_
pkt_info()', so callers don't need to set it.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/virtio_transport_common.c | 19 +--
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/net/vmw_vsock/virtio_
This function is static and 'hdr' arg was always NULL.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/virtio_transport_common.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c
b/net
This adds transport callback which tries to fetch record begin marker
from socket's rx queue. It is called from af_vsock.c before reading data
packets of record.
Signed-off-by: Arseny Krasnov
---
v6 -> v7:
1) Now 'virtio_transport_seqpacket_seq_get_len()' returns 0, if rx
ov iterator(previous unfinished data is dropped).
Signed-off-by: Arseny Krasnov
---
v6 -> v7:
1) 'struct virtio_vsock_seqpacket_state' now renamed to
'struct virtio_vsock_seq_state'.
2) Field 'seqpacket_state' of 'struct virtio_vsock_sock' now
n receive(if mismatch,
then reset connection).
Signed-off-by: Arseny Krasnov
---
v6 -> v7:
In 'virtio_transport_recv_pkt()', 'sock_put()' is added, when type of
received packet does not match to the type of socket.
net/vmw_vsock/virtio_transport_common.c | 64 ++
This adds SEQPACKET ops for virtio transport and 'seqpacket_allow()'
callback.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/virtio_transport.c | 12
1 file changed, 12 insertions(+)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transpo
packet type during send.
5) Set MSG_EOR in flags for SEQPACKET during send.
6) 'seqpacket_allow' flag to virtio transport.
Signed-off-by: Arseny Krasnov
---
v6 -> v7:
In 'virtio_transport_seqpacket_enqueue()', 'next_tx_msg_id' is updated
in both cases when m
This adds new virtio vsock specific feature bit which means
SOCK_SEQPACKET support. Guest negotiates this bit with vhost,
thus checking that vhost side supports SEQPACKET.
Signed-off-by: Arseny Krasnov
---
include/uapi/linux/virtio_vsock.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a
This also removes ignore of non-stream type of packets and adds
'seqpacket_allow()' callback.
Signed-off-by: Arseny Krasnov
---
drivers/vhost/vsock.c | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vso
This adds SEQPACKET ops for loopback transport and 'seqpacket_allow()'
callback.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/vsock_loopback.c | 12
1 file changed, 12 insertions(+)
diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c
index a4
This adds handling of SEQPACKET bit: if guest sets features with
this bit cleared, then SOCK_SEQPACKET support will be disabled.
Signed-off-by: Arseny Krasnov
---
drivers/vhost/vsock.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost
This adds handling of SEQPACKET bit: guest tries to negotiate it
with vhost.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/virtio_transport.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 83ae2078c847
This adds two tests of SOCK_SEQPACKET socket: both transfer data and
then test MSG_EOR and MSG_TRUNC flags. Cases for connect(), bind(),
etc. are not tested, because it is same as for stream socket.
Signed-off-by: Arseny Krasnov
---
tools/testing/vsock/util.c | 32 ++--
tools/testing
This updates current implementation for trace event of virtio vsock:
SEQPACKET socket's type, SEQPACKET specific ops and SEQPACKET 'msg_len'
and 'msg_id' fields are added.
Signed-off-by: Arseny Krasnov
---
.../events/vsock_virtio_transport_common.h| 48 +
On 03.03.2021 01:25, Steven Rostedt wrote:
> On Thu, 18 Feb 2021 08:42:15 +0300
> Arseny Krasnov wrote:
>
> Not sure if this was pulled in yet, but I do have a small issue with this
> patch.
No, it is in RFC state.
>
>> @@ -69,14 +82,19 @@ TRACE_EVENT(vi
On 15.03.2021 18:22, Arseny Krasnov wrote:
> On 15.03.2021 14:40, Stefano Garzarella wrote:
>> Hi Arseny,
>>
>> On Sun, Mar 07, 2021 at 08:57:19PM +0300, Arseny Krasnov wrote:
>>> This patchset implements support of SOCK_SEQPACKET for virtio
>>&g
initial design
recommendations.
Arseny Krasnov (19):
af_vsock: update functions for connectible socket
af_vsock: separate wait data loop
af_vsock: separate receive data loop
af_vsock: implement SEQPACKET receive loop
af_vsock: implement send logic for SEQPACKET
af_vsock: rest of SEQPAC
This prepares af_vsock.c for SEQPACKET support: some functions such
as setsockopt(), getsockopt(), connect(), recvmsg(), sendmsg() are
shared between both types of sockets, so rename them in general
manner.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock
This moves wait loop for data to dedicated function, because later it
will be used by SEQPACKET data receive loop. While moving the code
around, let's update an old comment.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/af_vsock.c
Move STREAM specific data receive logic to '__vsock_stream_recvmsg()'
dedicated function, while checks, that will be same for both STREAM
and SEQPACKET sockets, stays in 'vsock_connectible_recvmsg()' shared
functions.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano
in SEQPACKET case.
3) It waits until whole record is received or error is found during
receiving.
4) It processes and sets 'MSG_TRUNC' flag.
So to avoid extra conditions for two types of socket inside one loop, two
independent functions were created.
Signed-off-by: Arseny Krasnov
---
v
This does rest of SOCK_SEQPACKET support:
1) Adds socket ops for SEQPACKET type.
2) Allows to create socket with SEQPACKET type.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
include/net/af_vsock.h | 1 +
net/vmw_vsock/af_vsock.c | 36
This adds some logic to current stream enqueue function for SEQPACKET
support:
1) Use transport's seqpacket enqueue callback.
2) Return value from enqueue function is whole record length or error
for SOCK_SEQPACKET.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
in
This replaces 'stream' to 'connection oriented' in comments as
SEQPACKET is also connection oriented.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/af_vsock.c | 31 +--
1 file changed, 17 insertions(+), 14 deleti
This function is static and 'hdr' arg was always NULL.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/virtio_transport_common.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c
b/net
ort_send_
pkt_info()', so callers don't need to set it.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/virtio_transport_common.c | 19 +--
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/net/vmw_vsock/virtio_
This adds set of defines and constants for SOCK_SEQPACKET
support in vsock.
Signed-off-by: Arseny Krasnov
---
v7 -> v8:
- Things like SEQ_BEGIN, SEQ_END, 'msg_len' and 'msg_id' now removed.
Now only last RW packet of each message marked by 'VIRTIO_VSOCK_SEQ_EOR
will send credit update for rest of record, and sender will wait
for next enter of read syscall at receiver's side. So if user buffer is
full, we just send credit update and drop data.
Signed-off-by: Arseny Krasnov
---
v7 -> v8:
- Things like SEQ_BEGIN, SEQ_END, 'msg_len' and &
This modifies current receive logic for SEQPACKET support:
1) Inserts 'RW' packet to socket's rx queue, but without merging with
buffer of last packet in queue.
2) Performs check for packet and socket types on receive(if mismatch,
then reset connection).
Signed-off-by:
This adds rest of logic for SEQPACKET:
1) Send SHUTDOWN on socket close for SEQPACKET type.
2) Set SEQPACKET packet type during send.
3) 'seqpacket_allow' flag to virtio transport.
4) Set 'VIRTIO_VSOCK_SEQ_EOR' bit in flags for last
packet of message.
Signed-off-by: Ar
1 - 100 of 181 matches
Mail list logo