<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/vsock, branch v6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-03-30T08:47:48Z</updated>
<entry>
<title>test/vsock: new skbuff appending test</title>
<updated>2023-03-30T08:47:48Z</updated>
<author>
<name>Arseniy Krasnov</name>
<email>avkrasnov@sberdevices.ru</email>
</author>
<published>2023-03-28T11:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25209a3209ecc44f93300b7ee5287f451be1d6ff'/>
<id>urn:sha1:25209a3209ecc44f93300b7ee5287f451be1d6ff</id>
<content type='text'>
This adds test which checks case when data of newly received skbuff is
appended to the last skbuff in the socket's queue. It looks like simple
test with 'send()' and 'recv()', but internally it triggers logic which
appends one received skbuff to another. Test checks that this feature
works correctly.

This test is actual only for virtio transport.

Signed-off-by: Arseniy Krasnov &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>test/vsock: copy to user failure test</title>
<updated>2023-03-16T17:28:23Z</updated>
<author>
<name>Arseniy Krasnov</name>
<email>avkrasnov@sberdevices.ru</email>
</author>
<published>2023-03-14T11:09:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7e699d2a4e8104d304e921ac5e0a0c73f0f7b623'/>
<id>urn:sha1:7e699d2a4e8104d304e921ac5e0a0c73f0f7b623</id>
<content type='text'>
This adds SOCK_STREAM and SOCK_SEQPACKET tests for invalid buffer case.
It tries to read data to NULL buffer (data already presents in socket's
queue), then uses valid buffer. For SOCK_STREAM second read must return
data, because skbuff is not dropped, but for SOCK_SEQPACKET skbuff will
be dropped by kernel, and 'recv()' will return EAGAIN.

Signed-off-by: Arseniy Krasnov &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>test/vsock: vsock_perf utility</title>
<updated>2023-01-12T11:53:54Z</updated>
<author>
<name>Arseniy Krasnov</name>
<email>AVKrasnov@sberdevices.ru</email>
</author>
<published>2023-01-10T10:18:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8abbffd27cedd0f89f69e5ee2ff6841ea01511eb'/>
<id>urn:sha1:8abbffd27cedd0f89f69e5ee2ff6841ea01511eb</id>
<content type='text'>
This adds utility to check vsock rx/tx performance.

Usage as sender:
./vsock_perf --sender &lt;cid&gt; --port &lt;port&gt; --bytes &lt;bytes to send&gt;
Usage as receiver:
./vsock_perf --port &lt;port&gt; --rcvlowat &lt;SO_RCVLOWAT&gt;

Signed-off-by: Arseniy Krasnov &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>test/vsock: add big message test</title>
<updated>2023-01-12T11:53:54Z</updated>
<author>
<name>Arseniy Krasnov</name>
<email>AVKrasnov@sberdevices.ru</email>
</author>
<published>2023-01-10T10:17:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=685a21c314a8aec3549f25cb3f9d872e92245210'/>
<id>urn:sha1:685a21c314a8aec3549f25cb3f9d872e92245210</id>
<content type='text'>
This adds test for sending message, bigger than peer's buffer size.
For SOCK_SEQPACKET socket it must fail, as this type of socket has
message size limit.

Signed-off-by: Arseniy Krasnov &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>test/vsock: rework message bounds test</title>
<updated>2023-01-12T11:53:54Z</updated>
<author>
<name>Arseniy Krasnov</name>
<email>AVKrasnov@sberdevices.ru</email>
</author>
<published>2023-01-10T10:15:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c338112e48ab1937f99e4a8990a82c999fda126'/>
<id>urn:sha1:5c338112e48ab1937f99e4a8990a82c999fda126</id>
<content type='text'>
This updates message bound test making it more complex. Instead of
sending 1 bytes messages with one MSG_EOR bit, it sends messages of
random length(one half of messages are smaller than page size, second
half are bigger) with random number of MSG_EOR bits set. Receiver
also don't know total number of messages.

Signed-off-by: Arseniy Krasnov &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>vsock_test: POLLIN + SO_RCVLOWAT test</title>
<updated>2022-08-23T08:43:12Z</updated>
<author>
<name>Arseniy Krasnov</name>
<email>AVKrasnov@sberdevices.ru</email>
</author>
<published>2022-08-19T05:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1346338fbaefac1b796a50478f8e8070b54e9e4'/>
<id>urn:sha1:b1346338fbaefac1b796a50478f8e8070b54e9e4</id>
<content type='text'>
This adds test to check, that when poll() returns POLLIN, POLLRDNORM bits,
next read call won't block.

Signed-off-by: Arseniy Krasnov &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>af_vsock: SOCK_SEQPACKET broken buffer test</title>
<updated>2022-03-18T15:13:19Z</updated>
<author>
<name>Krasnov Arseniy Vladimirovich</name>
<email>AVKrasnov@sberdevices.ru</email>
</author>
<published>2022-03-17T08:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e89600ebeeb14d18c0b062837a84196f72542830'/>
<id>urn:sha1:e89600ebeeb14d18c0b062837a84196f72542830</id>
<content type='text'>
Add test where sender sends two message, each with own
data pattern. Reader tries to read first to broken buffer:
it has three pages size, but middle page is unmapped. Then,
reader tries to read second message to valid buffer. Test
checks, that uncopied part of first message was dropped
and thus not copied as part of second message.

Signed-off-by: Krasnov Arseniy Vladimirovich &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>af_vsock: SOCK_SEQPACKET receive timeout test</title>
<updated>2022-03-18T15:13:18Z</updated>
<author>
<name>Krasnov Arseniy Vladimirovich</name>
<email>AVKrasnov@sberdevices.ru</email>
</author>
<published>2022-03-17T08:31:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=efb3719f4ab0c4646ce2fe16c610e6a9bb0e1b08'/>
<id>urn:sha1:efb3719f4ab0c4646ce2fe16c610e6a9bb0e1b08</id>
<content type='text'>
Test for receive timeout check: connection is established,
receiver sets timeout, but sender does nothing. Receiver's
'read()' call must return EAGAIN.

Signed-off-by: Krasnov Arseniy Vladimirovich &lt;AVKrasnov@sberdevices.ru&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vsock_diag_test: remove free_sock_stat() call in test_no_sockets</title>
<updated>2021-10-16T00:21:34Z</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2021-10-14T15:20:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba95a6225b02c24d99f39fd930b6a388e5fd7b48'/>
<id>urn:sha1:ba95a6225b02c24d99f39fd930b6a388e5fd7b48</id>
<content type='text'>
In `test_no_sockets` we don't expect any sockets, indeed
check_no_sockets() prints an error and exits if `sockets` list is
not empty, so free_sock_stat() call is unnecessary since it would
only be called when the `sockets` list is empty.

This was discovered by a strange warning printed by gcc v11.2.1:
  In file included from ../../include/linux/list.h:7,
                   from vsock_diag_test.c:18:
  vsock_diag_test.c: In function ‘test_no_sockets’:
  ../../include/linux/kernel.h:35:45: error: array subscript ‘struct vsock_stat[0]’ is partly outside array bound
  s of ‘struct list_head[1]’ [-Werror=array-bounds]
     35 |         const typeof(((type *)0)-&gt;member) * __mptr = (ptr);     \
        |                                             ^~~~~~
  ../../include/linux/list.h:352:9: note: in expansion of macro ‘container_of’
    352 |         container_of(ptr, type, member)
        |         ^~~~~~~~~~~~
  ../../include/linux/list.h:393:9: note: in expansion of macro ‘list_entry’
    393 |         list_entry((pos)-&gt;member.next, typeof(*(pos)), member)
        |         ^~~~~~~~~~
  ../../include/linux/list.h:522:21: note: in expansion of macro ‘list_next_entry’
    522 |                 n = list_next_entry(pos, member);                       \
        |                     ^~~~~~~~~~~~~~~
  vsock_diag_test.c:325:9: note: in expansion of macro ‘list_for_each_entry_safe’
    325 |         list_for_each_entry_safe(st, next, sockets, list) {
        |         ^~~~~~~~~~~~~~~~~~~~~~~~
  In file included from vsock_diag_test.c:18:
  vsock_diag_test.c:333:19: note: while referencing ‘sockets’
    333 |         LIST_HEAD(sockets);
        |                   ^~~~~~~
  ../../include/linux/list.h:23:26: note: in definition of macro ‘LIST_HEAD’
     23 |         struct list_head name = LIST_HEAD_INIT(name)

It seems related to some compiler optimization and assumption
about the empty `sockets` list, since this warning is printed
only with -02 or -O3. Also removing `exit(1)` from
check_no_sockets() makes the warning disappear since in that
case free_sock_stat() can be reached also when the list is
not empty.

Reported-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20211014152045.173872-1-sgarzare@redhat.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>vsock_test: update message bounds test for MSG_EOR</title>
<updated>2021-09-06T06:25:16Z</updated>
<author>
<name>Arseny Krasnov</name>
<email>arseny.krasnov@kaspersky.com</email>
</author>
<published>2021-09-03T12:33:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e115c45ee0b86172d910588dd41632f1a2c0199'/>
<id>urn:sha1:0e115c45ee0b86172d910588dd41632f1a2c0199</id>
<content type='text'>
Set 'MSG_EOR' in one of message sent, check that 'MSG_EOR'
is visible in corresponding message at receiver.

Signed-off-by: Arseny Krasnov &lt;arseny.krasnov@kaspersky.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://lore.kernel.org/r/20210903123321.3273866-1-arseny.krasnov@kaspersky.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
</feed>
