Re: [PATCH net-next v11 5/6] tls: Suppress spurious saved_data_ready on all receive paths
Hannes Reinecke <[email protected]> Wed, 27 May 2026 11:51:22 +0200
| Newsgroups | dev.linux.lists.kernel-tls-handshake,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
On 5/26/26 16:21, Chuck Lever wrote: > From: Chuck Lever <[email protected]> > > Each record release via tls_strp_msg_done() triggered > tls_strp_check_rcv(), which called tls_rx_msg_ready() and > fired saved_data_ready(). During a multi-record receive, the > first N-1 wakeups are pure overhead: the caller is already > running and will pick up subsequent records on the next loop > iteration. The recvmsg and splice_read paths share this waste. > > Suppress per-record notifications and emit a single one on > reader exit. tls_rx_rec_done() releases the current record > and parses the next without announcing; tls_strp_check_rcv() > gains a bool announce parameter so callers can request the > quiet form. tls_rx_reader_release() fires the deferred > announce on exit through tls_rx_msg_maybe_announce(), an > idempotent helper that calls saved_data_ready() only when a > record is parsed and has not yet been announced. > > To keep the final notification idempotent against records that > the BH or the worker has already announced, tls_strparser gains > a msg_announced bit. tls_rx_msg_maybe_announce() sets the bit > when firing saved_data_ready(); the bit is cleared whenever > the parsed record is wiped, by tls_strp_msg_consume() on > consumption or by tls_strp_msg_load() when the lower socket > loses bytes from under the parse. A second call for the same > parsed record -- as when recvmsg() satisfies the request from > ctx->rx_list without touching the strparser -- becomes a > no-op. > > With no remaining callers, tls_strp_msg_done() is removed. > > Signed-off-by: Chuck Lever <[email protected]> > --- > include/net/tls.h | 5 +++++ > net/tls/tls.h | 5 ++--- > net/tls/tls_main.c | 2 +- > net/tls/tls_strp.c | 23 ++++++++++++----------- > net/tls/tls_sw.c | 27 ++++++++++++++++++++++++--- > 5 files changed, 44 insertions(+), 18 deletions(-) > Reviewed-by: Hannes Reinecke <[email protected]> Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich