πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5153

Re: [PATCH net-next v17 06/15] quic: add stream management

#5153
From: netdev-bot+sashiko
Date: Mon, 19 Oct 2026 21:29
81 lines
11403 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] The comment above quic_stream_max_streams_update()
  (net/quic/stream.c:313-319) says it "Recalculates the max_uni and…

--

quic: add stream management

This patch adds struct quic_stream_table and struct quic_stream to manage
QUIC streams per socket. It adds quic_stream_get() and quic_stream_put() to
acquire and release send and receive streams. It also adds
quic_stream_id_exceeds() and quic_stream_max_streams_update() to track
stream limits.

> diff --git a/net/quic/stream.c b/net/quic/stream.c
> new file mode 100644
> index 0000000000000..29c9f3568b287
> --- /dev/null
> +++ b/net/quic/stream.c
> @@ -0,0 +1,427 @@

[ ... ]

> +/* Updates the maximum allowed incoming stream IDs if any streams were recently
> + * closed.  Recalculates the max_uni and max_bidi stream ID limits based on the
> + * number of open streams and whether any were marked for deletion.
> + *
> + * Returns true if either max_uni or max_bidi was updated, indicating that a
> + * MAX_STREAMS_UNI or MAX_STREAMS_BIDI frame should be sent to the peer.
> + */
> +bool quic_stream_max_streams_update(struct quic_stream_table *streams,
> +				    s64 *max_uni, s64 *max_bidi)
> +{
> +	s64 max, rem;
> +
> +	*max_uni = 0;
> +	*max_bidi = 0;
> +	if (streams->recv.uni_pending) {
> +		rem = streams->recv.max_streams_uni - streams->recv.streams_uni;
> +		max = streams->recv.next_uni_stream_id - QUIC_STREAM_ID_STEP +
> +		      (rem << QUIC_STREAM_TYPE_BITS);
> +
> +		streams->recv.max_uni_stream_id = max;
> +		*max_uni = quic_stream_id_to_streams(max);

[Severity: Low]
This isn't a bug, but does the comment above
quic_stream_max_streams_update() describe max_uni and max_bidi correctly?

The comment says the function "Recalculates the max_uni and max_bidi stream
ID limits". max_uni and max_bidi are the names of the output parameters, but
those parameters receive stream counts:

    *max_uni = quic_stream_id_to_streams(max);
    ...
    *max_bidi = quic_stream_id_to_streams(max);

Here quic_stream_id_to_streams() returns (stream_id >> 2) + 1. The stream ID
limits are only stored in streams->recv.max_uni_stream_id and
streams->recv.max_bidi_stream_id.

The code itself is correct, because MAX_STREAMS frames carry a count. Nothing
in the series calls this function yet. A future caller that follows the
comment and encodes *max_uni and *max_bidi as stream IDs would advertise the
wrong MAX_STREAMS value.

Could the comment say that the output parameters are stream counts?

> +		streams->recv.uni_pending = 0;
> +	}

[ ... ]

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1792164438.git.lucien.xin%40gmail.com
Technical Details
Message-ID: <179244539310.3135.8921542260670507924@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-348856-linux-kernel-netdev=dewy.ru
References: <a92cd8233a031c412bf8b709ba98ed8e9477b74d.1792164438.git.lucien.xin@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-348856-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v17 06/15] quic: add stream management
Date: Mon, 19 Oct 2026 21:29:53 +0000
Organization: Usenet Network
Message-ID: <179244539310.3135.8921542260670507924@kernel.org>
References: <a92cd8233a031c412bf8b709ba98ed8e9477b74d.1792164438.git.lucien.xin@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3717327"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:KVremL1cDuplK4NptxY5YhEGIMc= sha256:9e0vFJuA6FYEJhml6H1aqnR/e5hH2oUrtjDGwxjI2QY=
	sha1:zIUCir+Ja8ZZ9y2QmAQHLIJQb0M= sha256:+7lz/JqH9Q+Bbv52yQ/wQOlYmJcu570cw7b8UxvDP4E=
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 967FD110B44; Tue, 20 Oct 2026 00:32:35 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.729
X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-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 kYKWcc2n5IOt;
	Tue, 20 Oct 2026 00:32:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-348856-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 3F0DA110B41; Tue, 20 Oct 2026 00:32:24 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 565E94489D; Mon, 19 Oct 2026 21:29:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792445397;
	b=TAZ+QeG1vfeF6dW+eth8fAaRJsyp1pcpIGVuw+rn6h0EAayGtFaPW7KUGMeCXiAPyhJD
	 E1/y6Ss7NwdXW2FAXGyjsk/MKT2YeN3n2brnhJZbS+iktiJVo5vElff0cmfuCtsIN/Z4n
	 rgeKCTX2FoEHJUa8nyQAUYckvc+ebQNLQe4VOrmJ9YptPEq+Zh6H2swxAPbKAz/Qy7ZRb
	 utKChNJ8vKdE4rq1wqrVr3aJb46AJod9ECzBWmkVmKg9IiPmXyjgD8gsrp165/NByoXxf
	 Bt5Y/FkV5Wv93hRC57CYGbpLXVOoM//fm3vQ5s3qM95luWsvXh7tkmH+fNz2Zx84/xg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792445397;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=V1SKqgXsrplLlDz06eFww2PKsFDxp6WP2CMViFGG9y4=;
	b=e3TJALFaZLmYVcnrV9tSy3RzXpd7fk2ZLf+1Jnbg+d6Z1Y89Y2E11UGj13MMvXyp94sa
	 lnhBRrFBTnHENpsvEEeH9XrK8jUR9bwt1DZZiTVNenKl+ft+/OnyqdtRfNPL8OLcv2YPV
	 ADckL+Lz9PJEfYYlNCUAEI3Dnsd5OmdqK5iqlKS3N3wuOaTkbJFxX03/JqiJQQj5mDTxP
	 aAHHQAKaPeOI+fP33iQx0VBJCLmIsfE93rhOMXjcPqUWSM3QrAoP3jE+hOxW0h1PPXBgO
	 EEYoAaWABNTraRSlXtySZT9CQzb7pcIoyNQJGd5LkTlQsSUGDIZmaD72YyZHYU/nqrg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=heJgehEC;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A563606A326;
	Mon, 19 Oct 2026 21:29:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=heJgehEC
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792445396;
	b=j/e38DJZOSUkFF9M/wf1JrnF7D4o2dI7aAGI0TnGVqDWMRo7vG0h+CjEd3oUKT4yRUQ0
	 uwlzFCCZtr2WUr+MLxy7Juvw/jAmFBq4QXNIJDzbxPyi4V//mr3udJ1uif7QY9esYJW7n
	 FuCuVp+JTi/NjLDdR4ol9B3fG0JZpQVYL3hFfMlGKRObazbiQlBiVREaVqfJMPX5/kkVd
	 rroaHPJBzIgsGBxnBUHwrOh++w5mWUHEWLZZycnhBl3ta/CwN9XhjVshW6rdeaA4lMeiq
	 js3M8P75Pw8GRwkW9nrBVYhuJ+L3aMOncyiPA6n8PuaItQacdzfby+0hqHoxuR//+pg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792445396;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=V1SKqgXsrplLlDz06eFww2PKsFDxp6WP2CMViFGG9y4=;
	b=kHaGJGF60ZeqP+pXT8IX0qXMzEalXAg/4+6aooENz6B5Z0Vsl4kD+7xrUOjR+HqfhCkY
	 glcxvpsIj+UFseKbJdsWocDpIzUyS0dPyGFBNtsdPcy3DDXqCl0I4wHg+kAuPVoQzFxgh
	 vcMYoQRNfXa5gsFF3dgTezVQcQ+cgtAfSdEee+wlOWdzLXVY0ZZbGItRz95Sx10MmPgfC
	 JgrBithD/kzkC6+mDQLYRYn3pmJp4VHrp/RoJMoJDgKRahUHWJiNbFWjYymqwRmau7VBS
	 oAfCCZo5dKygEYN7LUuDFde6dmUgy7ikS8jFoWYS9RxM+eeij99GUNMqpKKsdwrRCXw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=heJgehEC;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D3DB606A31D;
	Mon, 19 Oct 2026 21:29:55 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C9701F000C5;
	Mon, 19 Oct 2026 21:29:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792445395;
	bh=V1SKqgXsrplLlDz06eFww2PKsFDxp6WP2CMViFGG9y4=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=heJgehECDE3wC00XKNuh5KTLi5FNL+/+u55oMozDqmzbiDw8JL4kE/qUYScpZ5MaI
	 nr1GlwXZWZcIFuNSmxRItuKfXeAzDwtuwldJu/P7VzKxviODYWA/mZ6jAQsKz/Lsm2
	 0TCG2pLvxboVLyGhEefw6GRpB1wYacFecLa1WHBBdA0wJC9HRzJm9Ypn1h0MWH5MEN
	 6kHQlnKswpT903Ah9hbeulO7c8W+K2yZp5LY3m0xeb245oFMNjueFc7Ci6Zg7zXJmX
	 4iJ8GKyN571/N6L/uxltwC2khpv4XQ2EyH+DVB+vaBXHHt1A7jaDm3JnKbnCBp/C0G
	 dFISMWb/NlqRw==
X-Cc: netdev@vger.kernel.org, quic@lists.linux.dev, davem@davemloft.net,
 kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, horms@kernel.org,
 metze@samba.org, mbuhl@openbsd.org, tfanelli@redhat.com, hepengtao@xiaomi.com,
 dreibh@simula.no, linux-cifs@vger.kernel.org, pc@manguebit.org,
 linkinjeon@kernel.org, tom@talpey.com, kernel-tls-handshake@lists.linux.dev,
 chuck.lever@oracle.com, jlayton@kernel.org, steved@redhat.com, hare@suse.de,
 aahringo@redhat.com, dhowells@redhat.com, matttbe@kernel.org,
 mail@johnericson.me, xiyou.wangcong@gmail.com, alibuda@linux.alibaba.com,
 jbaron@akamai.com, illiliti@protonmail.com, sd@queasysnail.net,
 marcelo.leitner@gmail.com, daniel@haxx.se, andrew.gospodarek@broadcom.com,
 mef@scarletmail.rutgers.edu, paul@jakma.org, kuniyu@google.com
X-In-Reply-To: <a92cd8233a031c412bf8b709ba98ed8e9477b74d.1792164438.git.lucien.xin@gmail.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list