Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: lucien.xin@gmail.com
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
Subject: Re: [PATCH net-next v17 07/15] quic: add connection id management
Date: Mon, 19 Oct 2026 21:29:55 +0000	[thread overview]
Message-ID: <179244539578.3135.2545046427986099445@kernel.org> (raw)
In-Reply-To: <e444094df836a7945028f960a458f520effdf221.1792164438.git.lucien.xin@gmail.com>

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 on the `count` field of `struct quic_conn_id_set`
  (net/quic/connid.h:46) does not match the code.

--

quic: add connection id management

This patch adds struct quic_conn_id_set to manage QUIC source and
destination connection IDs. It provides helpers to add, remove and find
connection IDs in a set, and inserts source connection IDs into a global
RCU-protected hash table. It also adds helpers for RX path lookup and for
checking stateless reset tokens.

> diff --git a/net/quic/connid.h b/net/quic/connid.h
> new file mode 100644
> index 0000000000000..105c2b4b0f2ec
> --- /dev/null
> +++ b/net/quic/connid.h
> @@ -0,0 +1,184 @@

[ ... ]

> +struct quic_conn_id_set {
> +	/* Connection ID in use on the current path */
> +	struct quic_common_conn_id *active;
> +	/* Connection ID to use for a new path (e.g., after migration) */
> +	struct quic_common_conn_id *alt;
> +	struct list_head head; /* List head of available connection IDs */
> +	u8 entry_size; /* Size of each connection ID entry in the list */
> +	u8 max_count;  /* active_connection_id_limit in rfc9000#section-18.2 */
> +	u8 count;      /* Current number of connection IDs in the list */

[Severity: Low]

This isn't a bug, but is this comment accurate?

quic_conn_id_add() links every new entry into the list. It only increments
count when the new number extends the consecutive run:

	list_add_tail(&common->list, list);

	if (number == quic_conn_id_last_number(id_set) + 1) {
		if (!id_set->active)
			id_set->active = common;
		id_set->count++;

For example, after adding numbers 0 and 5 to an empty set, the list holds
two entries but count is 1.

The consumers rely on count being the length of the consecutive run that
starts at the first entry:

	return quic_conn_id_first_number(id_set) + id_set->count - 1;

The WARN_ON_ONCE() guard in quic_conn_id_remove() and the
active->number != last_number check in quic_conn_id_select_alt() both
depend on that meaning.

Could the comment describe count as the number of consecutive connection
IDs starting from the first entry in the list? Otherwise a later caller
that compares count against max_count (active_connection_id_limit) would
be comparing a run length against a list-size limit.

> +	bool source;   /* true if this is a source conn_id set, false if dest */
> +};
> +
> +static inline u32 quic_conn_id_first_number(struct quic_conn_id_set *id_set)
> +{

[ ... ]

> +static inline u32 quic_conn_id_last_number(struct quic_conn_id_set *id_set)
> +{
> +	return quic_conn_id_first_number(id_set) + id_set->count - 1;
> +}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1792164438.git.lucien.xin%40gmail.com

             reply	other threads:[~2026-10-19 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 21:29 netdev-bot+sashiko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-10-16 15:27 [PATCH net-next v17 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-10-16 15:27 ` [PATCH net-next v17 07/15] quic: add connection id management Xin Long

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=179244539578.3135.2545046427986099445@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aahringo@redhat.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=chuck.lever@oracle.com \
    --cc=daniel@haxx.se \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dreibh@simula.no \
    --cc=edumazet@google.com \
    --cc=hare@suse.de \
    --cc=hepengtao@xiaomi.com \
    --cc=horms@kernel.org \
    --cc=illiliti@protonmail.com \
    --cc=jbaron@akamai.com \
    --cc=jlayton@kernel.org \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=mail@johnericson.me \
    --cc=marcelo.leitner@gmail.com \
    --cc=matttbe@kernel.org \
    --cc=mbuhl@openbsd.org \
    --cc=mef@scarletmail.rutgers.edu \
    --cc=metze@samba.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul@jakma.org \
    --cc=pc@manguebit.org \
    --cc=quic@lists.linux.dev \
    --cc=sd@queasysnail.net \
    --cc=steved@redhat.com \
    --cc=tfanelli@redhat.com \
    --cc=tom@talpey.com \
    --cc=xiyou.wangcong@gmail.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