<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/vsock/util.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-02-12T12:14:57+00:00</updated>
<entry>
<title>vsock/test: verify socket options after setting them</title>
<updated>2026-02-12T12:14:57+00:00</updated>
<author>
<name>Konstantin Shkolnyy</name>
<email>kshk@linux.ibm.com</email>
</author>
<published>2024-12-03T15:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa9f6f353bcc3eb0ae96ff1bbaf77ced08a9b932'/>
<id>urn:sha1:aa9f6f353bcc3eb0ae96ff1bbaf77ced08a9b932</id>
<content type='text'>
commit 86814d8ffd55fd4ad19c512eccd721522a370fb2 upstream.

Replace setsockopt() calls with calls to functions that follow
setsockopt() with getsockopt() and check that the returned value and its
size are the same as have been set. (Except in vsock_perf.)

Signed-off-by: Konstantin Shkolnyy &lt;kshk@linux.ibm.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
[Stefano: patch needed to avoid vsock test build failure reported by
 Johan Korsnes after backporting commit 0a98de8013696 ("vsock/test: fix
 seqpacket message bounds test") in 6.12-stable tree]
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Tested-by: Johan Korsnes &lt;johan.korsnes@remarkable.no&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>vsock/test: add a final full barrier after run all tests</title>
<updated>2026-01-23T10:18:37+00:00</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2026-01-08T11:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b7e11383ef3cfd6462436a2ea99905a7de087c55'/>
<id>urn:sha1:b7e11383ef3cfd6462436a2ea99905a7de087c55</id>
<content type='text'>
[ Upstream commit c39a6a277e0e67ffff6a8efcbbf7e7e23ce9e38c ]

If the last test fails, the other side still completes correctly,
which could lead to false positives.

Let's add a final barrier that ensures that the last test has finished
correctly on both sides, but also that the two sides agree on the
number of tests to be performed.

Fixes: 2f65b44e199c ("VSOCK: add full barrier between test cases")
Reviewed-by: Luigi Leonardi &lt;leonardi@redhat.com&gt;
Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Link: https://patch.msgid.link/20260108114419.52747-1-sgarzare@redhat.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>test/vsock: add ioctl unsent bytes test</title>
<updated>2024-08-02T08:20:28+00:00</updated>
<author>
<name>Luigi Leonardi</name>
<email>luigi.leonardi@outlook.com</email>
</author>
<published>2024-07-30T19:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18ee44ce97c18ee72f5807140d07ff8cebe3cab5'/>
<id>urn:sha1:18ee44ce97c18ee72f5807140d07ff8cebe3cab5</id>
<content type='text'>
Introduce two tests, one for SOCK_STREAM and one for SOCK_SEQPACKET,
which use SIOCOUTQ ioctl to check that the number of unsent bytes is
zero after delivering a packet.

vsock_connect and vsock_accept are no longer static: this is to
create more generic tests, allowing code to be reused for SEQPACKET
and STREAM.

Signed-off-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&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/test: add '--peer-port' input argument</title>
<updated>2024-01-25T01:47:35+00:00</updated>
<author>
<name>Arseniy Krasnov</name>
<email>avkrasnov@salutedevices.com</email>
</author>
<published>2024-01-23T07:27:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e18c709230cb05886fdcf6b90ef21a0a733079d7'/>
<id>urn:sha1:e18c709230cb05886fdcf6b90ef21a0a733079d7</id>
<content type='text'>
Implement port for given CID as input argument instead of using
hardcoded value '1234'. This allows to run different test instances
on a single CID. Port argument is not required parameter and if it is
not set, then default value will be '1234' - thus we preserve previous
behaviour.

Signed-off-by: Arseniy Krasnov &lt;avkrasnov@salutedevices.com&gt;
Reviewed-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Link: https://lore.kernel.org/r/20240123072750.4084181-1-avkrasnov@salutedevices.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>test/vsock: add dobule bind connect test</title>
<updated>2023-11-07T22:27:07+00:00</updated>
<author>
<name>Filippo Storniolo</name>
<email>f.storniolo95@gmail.com</email>
</author>
<published>2023-11-03T17:55:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d80f63f690257b04b4fe3731b90dbf34a9ebb93f'/>
<id>urn:sha1:d80f63f690257b04b4fe3731b90dbf34a9ebb93f</id>
<content type='text'>
This add bind connect test which creates a listening server socket
and tries to connect a client with a bound local port to it twice.

Co-developed-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&gt;
Signed-off-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&gt;
Signed-off-by: Filippo Storniolo &lt;f.storniolo95@gmail.com&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: refactor vsock_accept</title>
<updated>2023-11-07T22:27:07+00:00</updated>
<author>
<name>Filippo Storniolo</name>
<email>f.storniolo95@gmail.com</email>
</author>
<published>2023-11-03T17:55:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84d5fb9741316ca53f0f7c23b82f30e0bb33c38e'/>
<id>urn:sha1:84d5fb9741316ca53f0f7c23b82f30e0bb33c38e</id>
<content type='text'>
This is a preliminary patch to introduce SOCK_STREAM bind connect test.
vsock_accept() is split into vsock_listen() and vsock_accept().

Co-developed-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&gt;
Signed-off-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&gt;
Signed-off-by: Filippo Storniolo &lt;f.storniolo95@gmail.com&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 fix: add missing check on socket creation</title>
<updated>2023-11-07T22:27:07+00:00</updated>
<author>
<name>Filippo Storniolo</name>
<email>f.storniolo95@gmail.com</email>
</author>
<published>2023-11-03T17:55:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bfada5a7672fea5465d81bba3d05fca6024a244e'/>
<id>urn:sha1:bfada5a7672fea5465d81bba3d05fca6024a244e</id>
<content type='text'>
Add check on socket() return value in vsock_listen()
and vsock_connect()

Co-developed-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&gt;
Signed-off-by: Luigi Leonardi &lt;luigi.leonardi@outlook.com&gt;
Signed-off-by: Filippo Storniolo &lt;f.storniolo95@gmail.com&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: MSG_ZEROCOPY flag tests</title>
<updated>2023-10-15T12:19:42+00:00</updated>
<author>
<name>Arseniy Krasnov</name>
<email>avkrasnov@salutedevices.com</email>
</author>
<published>2023-10-10T19:15:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bc36442ef3b776ee6d5148a4e175c367af057ce1'/>
<id>urn:sha1:bc36442ef3b776ee6d5148a4e175c367af057ce1</id>
<content type='text'>
This adds three tests for MSG_ZEROCOPY feature:
1) SOCK_STREAM tx with different buffers.
2) SOCK_SEQPACKET tx with different buffers.
3) SOCK_STREAM test to read empty error queue of the socket.

Patch also works as preparation for the next patches for tools in this
patchset: vsock_perf and vsock_uring_test:
1) Adds several new functions to util.c - they will be also used by
   vsock_uring_test.
2) Adds two new functions for MSG_ZEROCOPY handling to a new source
   file - such source will be shared between vsock_test, vsock_perf and
   vsock_uring_test, thus avoiding code copy-pasting.

Signed-off-by: Arseniy Krasnov &lt;avkrasnov@salutedevices.com&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/test: add send_buf() utility function</title>
<updated>2023-09-17T16:42:37+00:00</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2023-09-15T12:14:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=12329bd51fdcde211fd9c76015ded4db3458ba8a'/>
<id>urn:sha1:12329bd51fdcde211fd9c76015ded4db3458ba8a</id>
<content type='text'>
Move the code of send_byte() out in a new utility function that
can be used to send a generic buffer.

This new function can be used when we need to send a custom
buffer and not just a single 'A' byte.

Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Reviewed-by: Arseniy Krasnov &lt;avkrasnov@salutedevices.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>vsock/test: add recv_buf() utility function</title>
<updated>2023-09-17T16:42:37+00:00</updated>
<author>
<name>Stefano Garzarella</name>
<email>sgarzare@redhat.com</email>
</author>
<published>2023-09-15T12:14:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a8ed71a27ef524c808b518031feac811ed3e741c'/>
<id>urn:sha1:a8ed71a27ef524c808b518031feac811ed3e741c</id>
<content type='text'>
Move the code of recv_byte() out in a new utility function that
can be used to receive a generic buffer.

This new function can be used when we need to receive a custom
buffer and not just a single 'A' byte.

Signed-off-by: Stefano Garzarella &lt;sgarzare@redhat.com&gt;
Reviewed-by: Arseniy Krasnov &lt;avkrasnov@salutedevices.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
