mirror of https://lore.kernel.org/lkml/
 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 1/2] vsock: Make accept()ed sockets use custom setsockopt()
Date: Tue, 23 Dec 2025 12:09:51 +0100	[thread overview]
Message-ID: <ff469a0f-091b-4260-8a54-e620024e0ec9@rbox.co> (raw)
In-Reply-To: <aUptJ2ECAPbLEZNp@sgarzare-redhat>

On 12/23/25 11:26, Stefano Garzarella wrote:
> On Tue, Dec 23, 2025 at 10:15:28AM +0100, Michal Luczaj wrote:
...
>> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
>> index adcba1b7bf74..c093db8fec2d 100644
>> --- a/net/vmw_vsock/af_vsock.c
>> +++ b/net/vmw_vsock/af_vsock.c
>> @@ -1787,6 +1787,7 @@ static int vsock_accept(struct socket *sock, struct socket *newsock,
>> 		} else {
>> 			newsock->state = SS_CONNECTED;
>> 			sock_graft(connected, newsock);
>> +			set_bit(SOCK_CUSTOM_SOCKOPT, &newsock->flags);
> 
> I was a bit confused about next lines calling set_bit on 
> `connected->sk_socket->flags`, but after `sock_graft(connected, 
> newsock)` they are equivalent.
> 
> So, maybe I would move the new line before the sock_graft() call or use 
> `connected->sk_socket->flags` if you want to keep it after it.
...
>> 			if (vsock_msgzerocopy_allow(vconnected->transport))
>> 				set_bit(SOCK_SUPPORT_ZC,
>> 					&connected->sk_socket->flags);

Hmm, isn't using both `connected->sk_socket->flags` and `newsock->flags` a
bit confusing? `connected->sk_socket->flags` feels unnecessary long to me.
So how about a not-so-minimal-patch to have

	newsock->state = SS_CONNECTED;
	set_bit(SOCK_CUSTOM_SOCKOPT, &newsock->flags);
	if (vsock_msgzerocopy_allow(vconnected->transport))
		set_bit(SOCK_SUPPORT_ZC, &newsock->flags);
	sock_graft(connected, newsock);

?


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

Thread overview: 15+ 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 [this message]
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
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
2026-01-07 10:53                 ` Stefano Garzarella

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=ff469a0f-091b-4260-8a54-e620024e0ec9@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

all inboxes | Powered by JetHome®