netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Luczaj <mhal@rbox.co>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Arseniy Krasnov <avkrasnov@salutedevices.com>,
	virtualization@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 2/2] vsock/test: Test setting SO_ZEROCOPY on accept()ed socket
Date: Tue, 23 Dec 2025 12:10:25 +0100	[thread overview]
Message-ID: <1c877a67-778e-424c-8c23-9e4d799fac2f@rbox.co> (raw)
In-Reply-To: <aUpualKwJbT9W1ia@sgarzare-redhat>

On 12/23/25 11:27, Stefano Garzarella wrote:
> On Tue, Dec 23, 2025 at 10:15:29AM +0100, Michal Luczaj wrote:
>> Make sure setsockopt(SOL_SOCKET, SO_ZEROCOPY) on an accept()ed socket is
>> handled by vsock's implementation.
>>
>> Signed-off-by: Michal Luczaj <mhal@rbox.co>
>> ---
>> tools/testing/vsock/vsock_test.c | 33 +++++++++++++++++++++++++++++++++
>> 1 file changed, 33 insertions(+)
>>
>> diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c
>> index 9e1250790f33..8ec8f0844e22 100644
>> --- a/tools/testing/vsock/vsock_test.c
>> +++ b/tools/testing/vsock/vsock_test.c
>> @@ -2192,6 +2192,34 @@ static void test_stream_nolinger_server(const struct test_opts *opts)
>> 	close(fd);
>> }
>>
>> +static void test_stream_accepted_setsockopt_client(const struct test_opts *opts)
>> +{
>> +	int fd;
>> +
>> +	fd = vsock_stream_connect(opts->peer_cid, opts->peer_port);
>> +	if (fd < 0) {
>> +		perror("connect");
>> +		exit(EXIT_FAILURE);
>> +	}
>> +
>> +	vsock_wait_remote_close(fd);
>> +	close(fd);
>> +}
>> +
>> +static void test_stream_accepted_setsockopt_server(const struct test_opts *opts)
>> +{
>> +	int fd;
>> +
>> +	fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL);
>> +	if (fd < 0) {
>> +		perror("accept");
>> +		exit(EXIT_FAILURE);
>> +	}
>> +
>> +	enable_so_zerocopy_check(fd);
> 
> This test is passing on my env also without the patch applied.
> 
> Is that expected?

Oh, no, definitely not. It fails for me:
36 - SOCK_STREAM accept()ed socket custom setsockopt()...36 - SOCK_STREAM
accept()ed socket custom setsockopt()...setsockopt err: Operation not
supported (95)
setsockopt SO_ZEROCOPY val 1

I have no idea what's going on :)


  reply	other threads:[~2025-12-23 11:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23  9:15 [PATCH net 0/2] vsock: Fix SO_ZEROCOPY on accept()ed vsocks Michal Luczaj
2025-12-23  9:15 ` [PATCH net 1/2] vsock: Make accept()ed sockets use custom setsockopt() Michal Luczaj
2025-12-23 10:26   ` Stefano Garzarella
2025-12-23 11:09     ` Michal Luczaj
2025-12-23 13:15       ` Stefano Garzarella
2025-12-29 19:45         ` Michal Luczaj
2025-12-23  9:15 ` [PATCH net 2/2] vsock/test: Test setting SO_ZEROCOPY on accept()ed socket Michal Luczaj
2025-12-23 10:27   ` Stefano Garzarella
2025-12-23 11:10     ` Michal Luczaj [this message]
2025-12-23 13:20       ` Stefano Garzarella
2025-12-23 16:50         ` Stefano Garzarella
2025-12-23 20:38           ` Michal Luczaj
2025-12-24  9:15             ` Stefano Garzarella
2025-12-29 19:40               ` Michal Luczaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c877a67-778e-424c-8c23-9e4d799fac2f@rbox.co \
    --to=mhal@rbox.co \
    --cc=avkrasnov@salutedevices.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).