πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #1947

Re: [PATCH net-next v2 1/5] vsock/virtio: split socket lookup from locked RX processing

#1947
From: netdev-bot+sashiko
Date: Sun, 11 Oct 2026 14:25
66 lines
8354 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] Commit message concern: the message for "vsock/virtio: split
  socket lookup from locked RX processing" lists what the refactor does…

--

vsock/virtio: split socket lookup from locked RX processing

This commit splits virtio_transport_recv_pkt() into two helpers. One
does the socket lookup. The other runs the receive state machine under
the socket lock. The decoded source and destination addresses and the
network namespace reach the locked helper through a new struct
virtio_transport_rx_pkt_ctx.

> Keep virtio_transport_recv_pkt() on its existing per-packet locking path.
> Pass the source and destination addresses used for lookup to the locked
> receive path so they are decoded only once.

[Severity: Low]
This isn't a bug, but does "decoded only once" describe this patch on
its own? The old virtio_transport_recv_pkt() also decoded src and dst
once with vsock_addr_init(). It then reused them for the lookup and for
vsock_check_source().

> Preserve source validation and failure handling. Keep the lookup reference
> separate from the skb owner reference so the locked receive path can manage
> the two lifetimes independently.

In this patch, virtio_transport_recv_pkt_locked() doesn't touch either
reference. The caller still calls skb_set_owner_sk_safe(),
release_sock(), sock_put() and kfree_skb() in the same order as before:

    free_pkt = virtio_transport_recv_pkt_locked(t, skb, sk, &ctx);
    release_sock(sk);
    ...
    sock_put(sk);
    if (free_pkt)
        kfree_skb(skb);

Also, struct virtio_transport_rx_pkt_ctx has only one user here.

These statements seem to describe the next patch in the series,
"vsock/virtio: amortize RX socket locking for stream packets". That
patch adds virtio_transport_recv_pkt_batch() as a second caller of
virtio_transport_recv_pkt_find_socket() and
virtio_transport_recv_pkt_locked().

It also adds batchable, batch and defer_data_ready to the ctx struct.
It keeps the lookup reference for the life of the batch and takes the
skb owner reference per packet.

The diff reorders one thing: on a type mismatch, sock_put() now runs
before virtio_transport_reset_no_sock(). This has no effect, because
virtio_transport_reset_no_sock() uses skb->sk and not the looked-up sk.

Could the commit message say that this is preparation for the batched
RX work, and add a "No functional change intended" line?

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261010142247.99223-1-physicalmtea%40gmail.com
Technical Details
Message-ID: <179172874905.434549.15262603111137504099@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344521-linux-kernel-netdev=dewy.ru
References: <20261010142247.99223-2-physicalmtea@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344521-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 1/5] vsock/virtio: split socket lookup from
 locked RX processing
Date: Sun, 11 Oct 2026 14:25:49 +0000
Organization: Usenet Network
Message-ID: <179172874905.434549.15262603111137504099@kernel.org>
References: <20261010142247.99223-2-physicalmtea@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1556550"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:LQ3uqtDz75hdVd5GFI7DM7bvAbM= sha256:DhzKsn74UokzGRCVS/tz0/FbaOUVfk3o3i55GRk1V8A=
	sha1:t4yWhG0KpB+VdaOP30pcuz+BIcM= sha256:RG4R/2/63j1OfG9NnBf408tJ78KoDyzEZy9OoLm8/hM=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 770DA10FA18; Sun, 11 Oct 2026 17:31:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.34
X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 73qfR0amxnFv;
	Sun, 11 Oct 2026 17:31:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344521-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 2983C10F7C9; Sun, 11 Oct 2026 17:31:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id F13B53023A; Sun, 11 Oct 2026 14:25:52 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id CD9D845A2AB;
	Sun, 11 Oct 2026 14:25:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HmuvGUNh"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C24B47E792;
	Sun, 11 Oct 2026 14:25:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791728751; cv=none; b=psZrrAq97OSzrsShy9c0KHuzF1MToNSpwn9zgatWxFNOqFzcqeQlRc3F8iDW1Zfjks2QBA0PWGpwJLTkFt4V5c/V+6VMOckDHfVoHmtnZDhdFDg4VGgqCZu1r1KdmS3OHGfqDnEXTWFLSeXPUBlcWBD0XsxvzyRyjFJ+DxDOVzk=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791728751; c=relaxed/simple;
	bh=4ckeA/SIeG5+ddnnV7RUphNs+eM3SDYw8WWRGPMZPtA=;
	h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 Content-Type:MIME-Version; b=Yyo80iVXiEf4aQ8fEVxf9DsnxUxi0blaAlfSPoZTxo1HxFA8VQm0g3TZaB0oBIQuKcYKbn75Pk8j24B0Dq8QCVvScz0LK9Jgg2IIyps+Qfu60JeVlvkEn2xJ6BG3e2FqIddW26gd1vTNmYilhzpLBmBsmE59tD2F8f3EfEWB9Kw=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HmuvGUNh; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C9A11F0089B;
	Sun, 11 Oct 2026 14:25:49 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791728750;
	bh=eVWxZPC3pTpsZn7iTHsDs5kC9m9kUC1hvTf+hzyUtA8=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=HmuvGUNhfwJbv2hNWEl/R6kO5Q+HkNd8AwxBfdEpt+9CROiiycvyrvH0Yywpa1a1C
	 REP2Gs6YsH5pq1uOQCqOXuuX2S57sTxRPlJwf5fzIeUt6giO/wRvC0z04nagw2Q6pZ
	 WMwETsJQ7lgz78SKx683b49b8Bqr+g58zSYFBsDGot4jQ7z28CjvYrC0fgZ81LPmG0
	 F4CsUN9v8Jce3Hdez70763j2lkqAJCoQa7ojjEYdEx0seNUqTfWWQHr2aEkqo27yrp
	 KnOogDoB1h/wRDw1pCIMGhdILaVHOHQajpjtqPWKwunoBpKj4zaa8+jmQf50BijQ2N
	 b35eAgM/ZHGFA==
X-Cc: stefanha@redhat.com, sgarzare@redhat.com, netdev@vger.kernel.org,
 virtualization@lists.linux.dev, kvm@vger.kernel.org, mst@redhat.com,
 jasowangio@gmail.com, eperezma@redhat.com, xuanzhuo@linux.alibaba.com,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 horms@kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org
X-In-Reply-To: <20261010142247.99223-2-physicalmtea@gmail.com>
X-sashiko-severity: Low
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>