From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (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 63FD43A4F4B for ; Thu, 28 May 2026 09:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779959717; cv=none; b=RsuYizZAtdu+3/ES+nCwRObEwiWxL5fAMiShphtIcHosp+ww924u27yANMqETrNSy165rXea4nrDnkN0uii+R7bRbVd+jXjU8hwwXdVBwSv4FsnV4EcZtZo+0kNIUwS1bDqT4kmhrSyIeqBRMYo8wyZyU4zf6Jlo4yRZ5bc+/p0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779959717; c=relaxed/simple; bh=rsKE2ntFZgsoNAYlxykrOehP1Ly+cVLd31XcodFdt3c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S7++jBuM5UAPQ/Wt4owGnSHHsLUy4WOdReH0Be1ui/bTqixYL4L+HS2OEdcK3oEunCuVYuhziy+H0HlqSdqzW+IV6P7ELJAh3D/wqDy3Xp9b/pKfYTZPmHhVEDvdarftB6Rrt9YVjxg27aQsMgmUKL19ikXyQVE9P9XBIUZhNoU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net; spf=pass smtp.mailfrom=queasysnail.net; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b=g0Nu1mcV; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gkuKP4RU; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b="g0Nu1mcV"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gkuKP4RU" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id A9399140015F; Thu, 28 May 2026 05:15:14 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 28 May 2026 05:15:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=queasysnail.net; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1779959714; x= 1780046114; bh=8TKMosZtoNCLawfUgM4vlnC/yxtsCh7j5xlUZtgwYJs=; b=g 0Nu1mcV/Gov7UYaASYQMC6LFRABAM1tMc+wqUfH1XUHGhknYbRcmfONc7RbWJwkk W7DwX72mjX5n0PrJCt2od2tqO48wkCrW8WmgyGCAUujXYP+RfRGPwl9o1ngu1bl7 7Toc7wBpOAnOfQnz182+lvkCwMt0c+pNtBtl2mm2aB0k2lsU6aND/kg9mu3TBRtL gdF3e3MOVNL/Y4msFsTTphq8vIU80WOHAdCAQspjAF7mNqCbxngDYyEnqVhGoWIp jqIRT35vW4hjsic37OWvb4Co7A54deYTf34qJo8TLMQNJ0efmB2cyhsQ2RPSzLkZ k597AcGB5e2dT7Yfu7Acg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1779959714; x=1780046114; bh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iCcHYh4EE3ZfWtzStdyY8HvFvtcJsm3vob0QtPX4ZmPnkB6Fg X-ME-Proxy: Feedback-ID: i934648bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 May 2026 05:15:13 -0400 (EDT) Date: Thu, 28 May 2026 11:15:12 +0200 From: Sabrina Dubroca To: Chuck Lever Cc: John Fastabend , Jakub Kicinski , Eric Dumazet , Simon Horman , Paolo Abeni , netdev@vger.kernel.org, kernel-tls-handshake@lists.linux.dev, Chuck Lever Subject: Re: [PATCH net-next v11 5/6] tls: Suppress spurious saved_data_ready on all receive paths Message-ID: References: <20260526-tls-read-sock-v11-0-244fe1dc4abd@oracle.com> <20260526-tls-read-sock-v11-5-244fe1dc4abd@oracle.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260526-tls-read-sock-v11-5-244fe1dc4abd@oracle.com> 2026-05-26, 10:21:35 -0400, Chuck Lever wrote: > From: Chuck Lever > > 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 > --- > 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: Sabrina Dubroca -- Sabrina