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 0992F341A5 for ; Mon, 9 Oct 2023 13:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VJaxNCor" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BFF3C433CA; Mon, 9 Oct 2023 13:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696859381; bh=JMGS+8ACQDkPX7HdnWs5wS7CY1GgcU4y5CVh9xdAKNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VJaxNCorGSdY17V59S9+0MQmwrkbZdbXst5K22SFeFIwKZMDLpCDutx0Rp387Es/W WopmEZ9z25lZfcRyFahC9xR4pjVUKs9CJ6/bS4sgHM1bW+hHk/wkkpynSE0WOJDJe3 2V7FdV30QmY85mM2NeVSjO8Vhl5PCBMZ00rkZkQ0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xin Long , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 49/55] sctp: update hb timer immediately after users change hb_interval Date: Mon, 9 Oct 2023 15:06:48 +0200 Message-ID: <20231009130109.576925975@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009130107.717692466@linuxfoundation.org> References: <20231009130107.717692466@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 1f4e803cd9c9166eb8b6c8b0b8e4124f7499fc07 ] Currently, when hb_interval is changed by users, it won't take effect until the next expiry of hb timer. As the default value is 30s, users have to wait up to 30s to wait its hb_interval update to work. This becomes pretty bad in containers where a much smaller value is usually set on hb_interval. This patch improves it by resetting the hb timer immediately once the value of hb_interval is updated by users. Note that we don't address the already existing 'problem' when sending a heartbeat 'on demand' if one hb has just been sent(from the timer) mentioned in: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg590224.html Signed-off-by: Xin Long Reviewed-by: Simon Horman Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://lore.kernel.org/r/75465785f8ee5df2fb3acdca9b8fafdc18984098.1696172660.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sctp/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index e5c3c37108e4e..fe26395690f33 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -2479,6 +2479,7 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, if (trans) { trans->hbinterval = msecs_to_jiffies(params->spp_hbinterval); + sctp_transport_reset_hb_timer(trans); } else if (asoc) { asoc->hbinterval = msecs_to_jiffies(params->spp_hbinterval); -- 2.40.1