From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202512 header.b=v0B21+k2; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 8613E5A0626 for ; Fri, 06 Feb 2026 07:17:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1770358661; bh=Uro1IVcKwBnh31WA4WrID2W/O3DfdIlXNTkonYErrlY=; h=From:To:Cc:Subject:Date:From; b=v0B21+k2LyyBZFSBQu0L+a2LV9Yt4zNOMBcNBkkfKLxJWESQvrmznIyuKm/FDd6td o/LoiuAKYG9KOarSgBMll/WYJH0nrhf0nTUYIDM95P8/P/+eE2O/EXJCoZ7++EPkkS f0YeBBCVwob3Bq7Gnqh2ElmrlLElTgT7sp20nOG5kBGm9iJWd7F+MdVgrHJ3h78JBo juF8a7iYi5eI3fCkW0YwGsDxBou8uiwfvxGiQ7qy3I24VBUvL4rtjv3Pryvq4iSKKT R9VovfLoRfoQTMQQyNuul+vyBr9bDhz++5p143MTyeMRbcN8C6cLNe5w5EPKrHASLP JHxxzl7coHFeQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4f6kQs2Ndfz4w9T; Fri, 06 Feb 2026 17:17:41 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 0/4] Reworks and improvements to TCP activity timers Date: Fri, 6 Feb 2026 17:17:35 +1100 Message-ID: <20260206061739.33648-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: CD3J7YLU5YBGZXZN5LFOJLBJYUU6QXXQ X-Message-ID-Hash: CD3J7YLU5YBGZXZN5LFOJLBJYUU6QXXQ X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Here's a bunch of patches aimed at fixing bug 179, and reworking the currently broken inactivity timer along the way. I believe patches 1..2/4 are ready to go - I've tested them, and I'm happy with how they're behaving. Patches 3..4/4 I think are correct, but I've been getting bogged down in details trying to test them in the specific FIN_WAIT_2 situation that occurs in bug 179. I'm sending this out for comment, while I look at some other things to clear my head. Caveats: * Currently the inactivity timer uses an interval of 2h to match the intended behaviour of the existing non-working activity timeout. Arguably it should be much longer (several days), like the kernel NAT timeout for idle connection tracking. * This introduces two new fields in the connection structure, as the clock values for the two new timers. These are new 1-bit bool fields slotted into a 3-bit gap. Arguably these would be cleaner as new bits in the 'flags' field. However, since we only have one spare bit there at the moment, that would require some more complex reorganization which I didn't want to tackle right now. Changes in v2: * Set keepalive interval to 300s * Fix an inordinate number of typos and other cosmetic errors David Gibson (4): tcp: Remove non-working activity timeout mechanism tcp: Re-introduce inactivity timeouts based on a clock algorithm tcp: Extend tcp_send_flag() to send TCP keepalive segments tcp: Send TCP keepalive segments after a period of tap-side inactivity tcp.c | 118 ++++++++++++++++++++++++++++++++++++++----------- tcp.h | 6 ++- tcp_buf.c | 4 ++ tcp_conn.h | 5 +++ tcp_internal.h | 2 + tcp_vu.c | 3 ++ 6 files changed, 112 insertions(+), 26 deletions(-) -- 2.53.0