mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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:
parent
524bc67509
commit
8cf0c70ec8
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user