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 v16 10/15] quic: add packet number space
Date: Wed, 07 Oct 2026 01:05:18 +0000 [thread overview]
Message-ID: <179133511883.434549.1095545154530968761@kernel.org> (raw)
In-Reply-To: <4e13764a900fab1fe886a34a3c05351262b9a585.1791227050.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 commit message of "quic: add packet number space" does not
mention ECN anywhere, yet much of the new API is ECN accounting and…
- [Low] The pn_map layout comment above struct quic_pnspace in
net/quic/pnspace.h gives the size-based trigger for advancing the map…
--
quic: add packet number space
This patch adds struct quic_pnspace to track per packet number space
state such as next PN, inflight bytes, loss and ACK timestamps, plus a
received-PN bitmap. It provides helpers to check and mark received packet
numbers and to build gap ACK blocks for ACK frames, with APP and EARLY
sharing one packet number space.
> It maintains the next packet number to assign, tracks the total length of
> frames currently in flight, and records the time when the next packet may
> be considered lost. It also keeps track of the largest acknowledged packet
> number, the time it was acknowledged, and when the most recent ack
> eliciting packet was sent. These fields are useful for loss detection,
> RTT estimation, and congestion control.
[Severity: Low]
This isn't a bug, but the commit message never mentions ECN. A good part
of the new API is ECN accounting and validation.
The patch adds:
- the ecn_count[QUIC_ECN_DIR_MAX][QUIC_ECN_MAX] array in struct
quic_pnspace
- the QUIC_ECN_LOCAL/PEER/ACKED enum
- the helpers quic_pnspace_inc_ecn_local(), quic_pnspace_inc_ecn_acked(),
quic_pnspace_reset_ecn_acked(), quic_pnspace_has_ecn_local(),
quic_pnspace_set_ecn_peer() and quic_pnspace_validate_ecn()
quic_pnspace_validate_ecn() implements the validation rules from
rfc9000#section-13.4.2.1.
The ECN history only appears in the changelog below the --- line, and
that part is dropped when the patch is applied.
Could a sentence be added along the lines of: "It also tracks
per-codepoint ECN counts (locally received, peer-reported, newly acked)
and provides helpers to validate peer ECN counts per
rfc9000#section-13.4.2.1."?
> diff --git a/net/quic/pnspace.h b/net/quic/pnspace.h
> new file mode 100644
> index 0000000000000..67981d5f1849c
> --- /dev/null
> +++ b/net/quic/pnspace.h
[ ... ]
> +/* Packet Number Map (pn_map) Layout:
> + *
> + * min_pn_seen -->++-----------------------+---------------------+---
> + * base_pn -----^ last_max_pn_seen --^ max_pn_seen --^
> + *
> + * Map Advancement Logic:
> + * - min_pn_seen = last_max_pn_seen;
> + * - base_pn = first zero bit after last_max_pn_seen;
> + * - last_max_pn_seen = max_pn_seen;
> + * - last_max_pn_time = max_pn_time;
> + *
> + * Conditions to Advance pn_map:
> + * - (max_pn_time - last_max_pn_time) >= max_time_limit, or
> + * - (max_pn_seen - last_max_pn_seen) > QUIC_PN_MAP_LIMIT
[Severity: Low]
Does the second condition match quic_pnspace_mark()? The code limits
the reference point to base_pn:
net/quic/pnspace.c:quic_pnspace_mark() {
...
last_max_pn_seen = min_t(s64, space->last_max_pn_seen, space->base_pn);
last_max_pn_time = space->last_max_pn_time;
if (space->max_pn_time < last_max_pn_time + space->max_time_limit &&
space->max_pn_seen <= last_max_pn_seen + QUIC_PN_MAP_LIMIT)
return 0;
...
}
So the map advances once max_pn_seen is more than QUIC_PN_MAP_LIMIT past
min(last_max_pn_seen, base_pn).
base_pn can be lower than last_max_pn_seen. During an advance,
quic_pnspace_move() only moves base_pn to the first zero bit after the
old last_max_pn_seen. Then last_max_pn_seen is set to max_pn_seen.
If a packet between those two points is missing, base_pn stays below
last_max_pn_seen. In that state the code advances earlier than this
comment says.
This base_pn limit is what keeps pn - base_pn inside the
QUIC_PN_MAP_SIZE bitmap. Could the comment be updated to show it, for
example (max_pn_seen - min(last_max_pn_seen, base_pn)) >
QUIC_PN_MAP_LIMIT?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1791227050.git.lucien.xin%40gmail.com
next reply other threads:[~2026-10-07 1:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 1:05 netdev-bot+sashiko [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-05 19:03 [PATCH net-next v16 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-10-05 19:04 ` [PATCH net-next v16 10/15] quic: add packet number space 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=179133511883.434549.1095545154530968761@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