Re: [PATCH net-next v7 06/16] quic: add stream management
Xin Long <[email protected]> Tue, 20 Jan 2026 09:58:18 -0500
| Newsgroups | dev.linux.lists.quic,dev.linux.lists.kernel-tls-handshake,org.kernel.vger.linux-cifs,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CADvbK_dh-O9NuNE4XL2ic2WUy9ysWc1NzbsJ99kv0ZciAw7ttQ@mail.gmail.com> |
On Tue, Jan 20, 2026 at 7:32 AM Paolo Abeni <[email protected]> wrote: > > On 1/15/26 4:11 PM, Xin Long wrote: > > +struct quic_stream { > > + struct hlist_node node; > > + s64 id; /* Stream ID as defined in RFC 9000 Section 2.1 */ > > + struct { > > + /* Sending-side stream level flow control */ > > + u64 last_max_bytes; /* Maximum send offset advertised by peer at last update */ > > + u64 max_bytes; /* Current maximum offset we are allowed to send to */ > > + u64 bytes; /* Bytes already sent to peer */ > > + > > + u32 errcode; /* Application error code to send in RESET_STREAM */ > > + u32 frags; /* Number of sent STREAM frames not yet acknowledged */ > > + u8 state; /* Send stream state, per rfc9000#section-3.1 */ > > + > > + u8 data_blocked:1; /* True if flow control blocks sending more data */ > > + u8 done:1; /* True if application indicated end of stream (FIN sent) */ > > Minor nit: AFAICS with the current struct layout the bitfield above does > not save any space, compared to plain u8 and will lead to worse code. > Makes sense, will change to plain u8. Thanks. > > + } send; > > + struct { > > + /* Receiving-side stream level flow control */ > > + u64 max_bytes; /* Maximum offset peer is allowed to send to */ > > + u64 window; /* Remaining receive window before advertise a new limit */ > > + u64 bytes; /* Bytes consumed by application from the stream */ > > + > > + u64 highest; /* Highest received offset */ > > + u64 offset; /* Offset up to which data is in buffer or consumed */ > > + u64 finalsz; /* Final size of the stream if FIN received */ > > + > > + u32 frags; /* Number of received STREAM frames pending reassembly */ > > + u8 state; /* Receive stream state, per rfc9000#section-3.2 */ > > + > > + u8 stop_sent:1; /* True if STOP_SENDING has been sent */ > > + u8 done:1; /* True if FIN received and final size validated */ > > ... same here... > > > + } recv; > > +}; > > + > > +struct quic_stream_limits { > > + /* Stream limit parameters defined in rfc9000#section-18.2 */ > > + u64 max_stream_data_bidi_remote; /* initial_max_stream_data_bidi_remote */ > > + u64 max_stream_data_bidi_local; /* initial_max_stream_data_bidi_local */ > > + u64 max_stream_data_uni; /* initial_max_stream_data_uni */ > > + u64 max_streams_bidi; /* initial_max_streams_bidi */ > > + u64 max_streams_uni; /* initial_max_streams_uni */ > > + > > + s64 next_bidi_stream_id; /* Next bidi stream ID to open or accept */ > > + s64 next_uni_stream_id; /* Next uni stream ID to open or accept */ > > + s64 max_bidi_stream_id; /* Highest allowed bidi stream ID */ > > + s64 max_uni_stream_id; /* Highest allowed uni stream ID */ > > + s64 active_stream_id; /* Most recently opened stream ID */ > > + > > + u8 bidi_blocked:1; /* STREAMS_BLOCKED_BIDI sent, awaiting ACK */ > > + u8 uni_blocked:1; /* STREAMS_BLOCKED_UNI sent, awaiting ACK */ > > + u8 bidi_pending:1; /* MAX_STREAMS_BIDI needs to be sent */ > > + u8 uni_pending:1; /* MAX_STREAMS_UNI needs to be sent */ > > ... and here. > > Other than that LGTM. With the bitfield replaced with plain u8 feel free > to add my > > Acked-by: Paolo Abeni <[email protected]> >