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 ED6203559E8; Thu, 5 Mar 2026 21:14:07 +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=1772745248; cv=none; b=R3eCoMzJk/gxxwz85kF/D5n6XWc4AETNJV5q3BnaRRJcK1ri+j+oHT0pKGPLJOiNEZoXKUBIBcCHFsb8kAdhs9nuLK780lLPUJmm+jPTuHBJG2DVo0qyXVWkWM7ewbm54jWKu+dJdKGAAP6g1izQD6xy4WEsP4oDe39N0Oc0K8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772745248; c=relaxed/simple; bh=1KFHXJvAIpYRC1eh+fWAF3XZHvBnobDbnqAzEIN1eqk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dikPGMkf4LHmxEE7nwhLkw19+0o/Eu2A1hvo3f+5qSjtA7mOE7Z6Twuqq6YloubBuRMC8SwJuTM/74dnflsbbYio8n3skyd784J+YAYeVT2VLk67ymvokQZXBIBBF1d1MQYLYOP9gdqppj4bvfnqJbcESbZOlxJ0SYoeLOn0Wwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QTRBNPqI; 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="QTRBNPqI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B04BC116C6; Thu, 5 Mar 2026 21:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772745247; bh=1KFHXJvAIpYRC1eh+fWAF3XZHvBnobDbnqAzEIN1eqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QTRBNPqIT7rsXaTvGuCTLE4mFu8COf/bINkv2VSZVMVPtVBifd6gMX71iMk84f0sK Lf0T4eV6XAW6IxjRrHzMgVE7G/Pf8KM+S1h7QUsBGG5DkRttQtu2m+QjV9+mZVnr18 pCuIldLsJ8OpOv6RWNwX4cimgmVXSi4Mdb7QgTH/spEy1ng+5EQwnYIYCYYMEwhCjG KrTC1Yyo7rc3uVdJOnCdAV8h/QmCA2nsMByRvjTiZ0NyzATPLaqCIH+Mze0OoCQEMM BjZcXlGwHJtB0y/irZbTed9CWf/AmKEYK4miJFt4+kbyV0YN1hUBSZT3yGwC/qlTn9 py/0xuf7ThGWQ== From: Chuck Lever To: john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net Cc: , , Chuck Lever , Hannes Reinecke , Alistair Francis Subject: [PATCH v1 2/6] tls: Factor tls_strp_msg_release() from tls_strp_msg_done() Date: Thu, 5 Mar 2026 16:13:58 -0500 Message-ID: <20260305211402.39408-3-cel@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260305211402.39408-1-cel@kernel.org> References: <20260305211402.39408-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