From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8329E322B8B; Wed, 11 Mar 2026 00:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773188403; cv=none; b=MBqvdFE+JzNWYs+xr7fxVoLBtthKQxkcdZL7PR4g8poYvnnh2PqwFruWciO/uzRyJqZNekJGGO/El4ecDgFSqIivjHvhhO2eC3qGd3+X48oISjvv+F4IVdWHWW8aQI1G9MXP0kuzxkXj9zOFEMxU3Z5sWo63JR2U+1bwp7XNImo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773188403; c=relaxed/simple; bh=1KFHXJvAIpYRC1eh+fWAF3XZHvBnobDbnqAzEIN1eqk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GoD/4zbWcDikvXHzJxKOs8T1T/mssCcX755QcSpy6UDhMsMlgN2OyWY5fqPhUSbVFEPFTZyDB7e89VV8jfr7JAL+CQMCPDMQIKfu2TrPDlvDRzZ8yOnhTwTARSgZur99a0CKXNUammBVrVXiJ/fh+vqjz/oTkAV+UfFgiBICGrA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R60aDcg+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="R60aDcg+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98FCAC2BC87; Wed, 11 Mar 2026 00:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773188403; bh=1KFHXJvAIpYRC1eh+fWAF3XZHvBnobDbnqAzEIN1eqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R60aDcg+5SuvZTNOvgxSFeVS1eYBWzkkbN8Qbpl5ElGmgR5pb8YfzWQcdL4z82ved 9FCh04cjE71AZQ+7RBb1uvH1pApViQhnh2tKLwgQLJj6RgKwPQiJkczn5TYfiAkhXR 0eYXHxt0X7CKBVOwTShjelsp/714gMiBt3KPPjJcoA7/ihSUyvkamEsUliMqOe3JRa al+OwYEhe+gkzrjokRfnCOyD43o1TGfvhtdUmY76CCn08wUCoUCf+zF8zlSvlAzzJz /aKXhPZk0kCqXbFGsVRu8wfJpkXvYedE8iFBFFrQYZyciPrQi7i++TZKKyaeb5wg4Y lEckrcN7NxCOw== From: Chuck Lever To: john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net Cc: netdev@vger.kernel.org, kernel-tls-handshake@lists.linux.dev, Chuck Lever , Hannes Reinecke , Alistair Francis Subject: [PATCH v2 4/8] tls: Factor tls_strp_msg_release() from tls_strp_msg_done() Date: Tue, 10 Mar 2026 20:19:48 -0400 Message-ID: <20260311001952.57059-5-cel@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260311001952.57059-1-cel@kernel.org> References: <20260311001952.57059-1-cel@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever tls_strp_msg_done() conflates releasing the current record with checking for the next one via tls_strp_check_rcv(). Batch processing requires releasing a record without immediately triggering that check, so the release step is separated into tls_strp_msg_release(). tls_strp_msg_done() is preserved as a wrapper for existing callers. Reviewed-by: Hannes Reinecke Reviewed-by: Alistair Francis Signed-off-by: Chuck Lever --- net/tls/tls.h | 1 + net/tls/tls_strp.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/net/tls/tls.h b/net/tls/tls.h index e8f81a006520..a97f1acef31d 100644 --- a/net/tls/tls.h +++ b/net/tls/tls.h @@ -193,6 +193,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_release(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); diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c index 98e12f0ff57e..a7648ebde162 100644 --- a/net/tls/tls_strp.c +++ b/net/tls/tls_strp.c @@ -581,7 +581,16 @@ static void tls_strp_work(struct work_struct *w) release_sock(strp->sk); } -void tls_strp_msg_done(struct tls_strparser *strp) +/** + * tls_strp_msg_release - release the current strparser message + * @strp: TLS stream parser instance + * + * 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_release(struct tls_strparser *strp) { WARN_ON(!strp->stm.full_len); @@ -592,7 +601,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_release(strp); tls_strp_check_rcv(strp); } -- 2.53.0