From: Paolo Abeni <pabeni@redhat.com>
To: graf@amazon.com
Cc: vishnu.dasa@broadcom.com, stefanha@redhat.com,
virtualization@lists.linux.dev, kvm@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com, arnd@arndb.de,
netdev@vger.kernel.org, eperezma@redhat.com,
gregkh@linuxfoundation.org, mst@redhat.com, jasowang@redhat.com,
corbet@lwn.net, nh-open-source@amazon.com,
bryan-bt.tan@broadcom.com, syzbot@syzkaller.appspotmail.com,
sgarzare@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [net-next,v4] vsock: add G2H fallback for CIDs not owned by H2G transport
Date: Tue, 10 Mar 2026 10:26:59 +0100 [thread overview]
Message-ID: <ef3435b1-5d86-4137-903f-bddeca3deb91@redhat.com> (raw)
In-Reply-To: <20260310091843.101237-1-pabeni@redhat.com>
Hi,
On 3/10/26 10:18 AM, Paolo Abeni wrote:
> This is an AI-generated review of your patch. The human sending this
> email has considered the AI review valid, or at least plausible.
>
> For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
> ---
>> @@ -581,11 +585,21 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
>> case SOCK_SEQPACKET:
>> if (vsock_use_local_transport(remote_cid))
>> new_transport = transport_local;
>> - else if (remote_cid <= VMADDR_CID_HOST || !transport_h2g ||
>> + else if (remote_cid <= VMADDR_CID_HOST ||
>> (remote_flags & VMADDR_FLAG_TO_HOST))
>> new_transport = transport_g2h;
>> - else
>> + else if (transport_h2g &&
>> + (!transport_h2g->has_remote_cid ||
>> + transport_h2g->has_remote_cid(vsk, remote_cid)))
>> + new_transport = transport_h2g;
>> + else if (sock_net(sk)->vsock.g2h_fallback &&
>> + transport_g2h && transport_g2h->has_remote_cid &&
>> + transport_g2h->has_remote_cid(vsk, remote_cid)) {
>> + vsk->remote_addr.svm_flags |= VMADDR_FLAG_TO_HOST;
>> + new_transport = transport_g2h;
>> + } else {
>> new_transport = transport_h2g;
>> + }
>> break;
>
> The old code had `!transport_h2g` in the second else-if condition at line
> -583, which routed all CID > VMADDR_CID_HOST traffic to transport_g2h when
> no H2G transport was loaded. The new code removes this check.
>
> When transport_h2g is NULL (no H2G transport loaded) and the G2H transport
> does not implement has_remote_cid (as is the case for VMCI and Hyper-V
> transports), what happens?
>
> The G2H fallback branch at line +596 requires
> `transport_g2h->has_remote_cid` to be non-NULL. If it's NULL, the
> short-circuit evaluation skips this branch and executes the final else at
> line +601, setting `new_transport = transport_h2g` (which is NULL),
> ultimately returning -ENODEV.
>
> The commit message explicitly states the intent to preserve the existing
> no-H2G fallback behavior. Does this implementation break it for G2H
> transports that do not implement the new optional has_remote_cid callback?
>
> This affects VMCI and Hyper-V environments: when no H2G transport is
> loaded, CID > 2 connections that previously fell back to G2H now get
> ENODEV.
Other comments from AI looked like nit picking to me, but the above one
looks relevant. I forwarded verbatim all the feedback for completeness.
/P
next prev parent reply other threads:[~2026-03-10 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 23:00 [PATCH net-next v4] vsock: add G2H fallback for CIDs not owned by H2G transport Alexander Graf
2026-03-05 9:51 ` Stefano Garzarella
2026-03-10 9:30 ` Paolo Abeni
2026-03-10 9:18 ` [net-next,v4] " Paolo Abeni
2026-03-10 9:26 ` Paolo Abeni [this message]
2026-03-10 11:07 ` [net-next, v4] " Alexander Graf
2026-03-12 10:10 ` [PATCH net-next " patchwork-bot+netdevbpf
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=ef3435b1-5d86-4137-903f-bddeca3deb91@redhat.com \
--to=pabeni@redhat.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bryan-bt.tan@broadcom.com \
--cc=corbet@lwn.net \
--cc=eperezma@redhat.com \
--cc=graf@amazon.com \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nh-open-source@amazon.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=syzbot@syzkaller.appspotmail.com \
--cc=virtualization@lists.linux.dev \
--cc=vishnu.dasa@broadcom.com \
/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