tls: Factor tls_strp_msg_consume() from tls_strp_msg_done()

tls_strp_msg_done() conflates releasing the current record with
checking for the next one via tls_strp_check_rcv(). A subsequent
patch needs to release a record without immediately triggering
that check, so the release step is separated into
tls_strp_msg_consume(). tls_strp_msg_done() is preserved as a
wrapper for existing callers.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20260604-tls-read-sock-v12-4-b114efa6e3e2@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Chuck Lever 2026-06-04 13:48:27 -04:00 committed by Jakub Kicinski
parent 524bc67509
commit 8cf0c70ec8
2 changed files with 11 additions and 1 deletions

View File

@ -194,6 +194,7 @@ int tls_strp_init(struct tls_strparser *strp, struct sock *sk);
void tls_strp_data_ready(struct tls_strparser *strp);
void tls_strp_check_rcv(struct tls_strparser *strp);
void tls_strp_msg_consume(struct tls_strparser *strp);
void tls_strp_msg_done(struct tls_strparser *strp);
int tls_rx_msg_size(struct tls_strparser *strp, struct sk_buff *skb);

View File

@ -581,7 +581,12 @@ static void tls_strp_work(struct work_struct *w)
release_sock(strp->sk);
}
void tls_strp_msg_done(struct tls_strparser *strp)
/* Release the current record without triggering a check for the
* next record. Callers must invoke tls_strp_check_rcv() before
* releasing the socket lock, or queued data will stall until the
* next tls_strp_data_ready() event.
*/
void tls_strp_msg_consume(struct tls_strparser *strp)
{
WARN_ON(!strp->stm.full_len);
@ -592,7 +597,11 @@ void tls_strp_msg_done(struct tls_strparser *strp)
WRITE_ONCE(strp->msg_ready, 0);
memset(&strp->stm, 0, sizeof(strp->stm));
}
void tls_strp_msg_done(struct tls_strparser *strp)
{
tls_strp_msg_consume(strp);
tls_strp_check_rcv(strp);
}