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
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 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
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
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
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 -
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
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 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 Tue, Dec 29, 2020 at 02:06:33PM +0300, Arseny Krasnov wrote:
>>> This patch simply adds transport ops and removes
>>> ignore of non-stream type of packets.
>>>
>>> Signed-off-by: Arseny Krasnov
>> How is this supposed to work? virtio vsock a
, 2020 at 02:04:51PM +0300, Arseny Krasnov wrote:
>> To preserve message boundaries, new packet operation was added:
>> to mark start of record(with record length in header). To send record,
>> packet with start marker is sent first, then all data is transmitted as
&g
As SOCK_SEQPACKET guarantees to save record boundaries, so to
do it, new packet operation was added: it marks start of record (with
record length in header). To send record, packet with start marker is
sent first, then all data is transmitted as 'RW' packets. On receiver's
side, length of r
This extends rx loop for SOCK_SEQPACKET packets and implements
callback which user calls to copy data to its buffer.
Signed-off-by: Arseny Krasnov
---
include/linux/virtio_vsock.h| 7 +
include/net/af_vsock.h | 4 +
include/uapi/linux/virtio_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
From: Arseniy Krasnov
For send, this patch adds:
1) Send of record begin marker with record length.
2) Return error if send of whole record is failed.
For receive, this patch adds another loop, it looks like
stream loop, but:
1) It doesn't call notify callbacks.
2) It doesn't care
From: Arseniy Krasnov
---
net/vmw_vsock/af_vsock.c | 107 +--
1 file changed, 91 insertions(+), 16 deletions(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 7ff00449a9a2..30caad9815f7 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/v
From: Arseniy Krasnov
Replace 'stream' to 'connect oriented' as SOCK_SEQPACKET
support is also connect oriented.
---
net/vmw_vsock/af_vsock.c | 31 +--
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_
> IMHO you can avoid this special-casing
> by introducing yet another outer loop just
> for draining the extra data from buffer.
> Admittedly that may also require an extra
> transport op.
I'm not sure that extra tranport op is needed, may be i'll
try to put drain code inside copy loop, because on
> Is ENODEV the right error here?
> Just a quick look at a man page, and
> I am under impression something like
> EPROTONOSUPPORT or ESOCKNOSUPPORT
> may suit?
I used ENODEV because this code is returned some
lines below when !new_transport(e.g. valid transport
not found). But i think you codes wi
> Hi Arseny, thanks for your work on this!
> I did a small review in a hope it helps.
> Also it may be cool to have the driver feature
> for that (so that the host can see if its supported).
> But I guess this was already said by Michael. :)
Hello, thank You for your review, i'll prepare
v2 as soo
> 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
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
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 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
>
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 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
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 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
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 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
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
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
'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/
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(+)
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
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 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 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 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 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 22.02.2021 13:50, Stefano Garzarella wrote:
> On Thu, Feb 18, 2021 at 08:36:03AM +0300, Arseny Krasnov wrote:
>> This prepares af_vsock.c for SEQPACKET support: some functions such
>> as setsockopt(), getsockopt(), connect(), recvmsg(), sendmsg() are
>> shared between
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 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
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
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
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
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 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 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 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 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 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
This adds
1) SEQPACKET ops for virtio transport and 'seqpacket_allow()' callback.
2) Handling of SEQPACKET bit: guest tries to negotiate it with vhost.
Signed-off-by: Arseny Krasnov
---
v7 -> v8:
- This patch merged with patch which adds SEQPACKET feature bit to
virtio tra
of guest's
rx queue, keep this bit set only when last piece of data is copied.
Signed-off-by: Arseny Krasnov
---
v7 -> v8:
- This patch merged with patch which adds SEQPACKET feature bit to
virtio transport.
- It now handles VIRTIO_VSOCK_SEQ_EOR bit(see commit msg).
drivers/
This adds SEQPACKET ops for loopback transport and 'seqpacket_allow()'
callback.
Signed-off-by: Arseny Krasnov
Reviewed-by: Stefano Garzarella
---
net/vmw_vsock/vsock_loopback.c | 12
1 file changed, 12 insertions(+)
diff --git a/net/vmw_vsock/vsock_loopback.c b/net
This adds test of SOCK_SEQPACKET socket: it transfer data and
then tests MSG_TRUNC flag. Cases for connect(), bind(), etc. are
not tested, because it is same as for stream socket.
Signed-off-by: Arseny Krasnov
---
v7 -> v8:
- Test for MSG_EOR flags now removed.
tools/testing/vsock/uti
This adds SEQPACKET socket's type for trace event of virtio vsock.
Signed-off-by: Arseny Krasnov
---
v7 -> v8:
- Code used for SEQ_BEGIN and SEQ_END removed.
include/trace/events/vsock_virtio_transport_common.h | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a
This implementation is PoC and not related to SEQPACKET close, so
i've placed it after whole patchset.
Signed-off-by: Arseny Krasnov
---
include/net/af_vsock.h | 1 +
net/vmw_vsock/af_vsock.c | 10 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/net/af
I'll fix some issues of this patch found by kernel test robot
On 13.04.2021 15:44, 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 copied(if user's buf
On 13.04.2021 15:47, Arseny Krasnov wrote:
> This add logic, that serializes write access to single socket
> by multiple threads. It is implemented be adding field with TID
> of current writer. When writer tries to send something, it checks
> that field is -1(free), else it sleep in
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: prepare for SOCK_SEQPACKET support
af_vsock: prepare 'vsock_connectible_recvms
This prepares 'vsock_connectible_recvmg()' to call SEQPACKET receive
loop:
1) Some shared check left in this function, then socket type
specific receive loop is called.
2) Stream receive loop is moved to separate function.
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vso
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 -
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
both types of sockets, so
rename them in general manner and create entry points for each type
of socket to call these functions(for stream in this patch, for
seqpacket in further patches).
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/af_vsock.c | 91
This also 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
--- a/drivers/vhost
This adds SEQPACKET ops for virtio transport
Signed-off-by: Arseny Krasnov
---
net/vmw_vsock/virtio_transport.c | 4
1 file changed, 4 insertions(+)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 2700a63ab095..5a7ab1befee8 100644
--- a/net/vmw_vsock
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_common.c | 55 +
2 files
n receive(if mismatch,
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_transpo
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 | 71
1 file changed, 71 insertions(+)
diff --git a/net/vmw_vsock
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
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 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
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
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
1 - 100 of 181 matches
Mail list logo