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=JOKWAZl1; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 28B795A0657 for ; Wed, 04 Feb 2026 12:42:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1770205359; bh=Au3Ge9M5BKgpDPkSFw7oQe/JMPcgZTsQDgjPISw+xYk=; h=From:To:Cc:Subject:Date:From; b=JOKWAZl1xdtgMoEpREPwGM7UM21zQjpR7t+lFZs9OZZbmF+hZ4xIB/EHuSiT160cZ /t3KGUhtAuVM0FD3fzqI5lYIo2E3wdCNWPu8UN/Zdk+LohlW4Z5vZhEtk6UNCF1I2Y tONA1kHC7qos2EiDImd4FyoLdmkEtTHSJjTblANuJOzlPUtLt+ufF4nTe3u0e/9h3B vug8XasUy8Z+MbAwLicgl2XncsXw6FG3TcAruHOYnznGf2dDVpNPUhfFCRXuzqWJHb 9vweS8NSjadwzU+Ri0sw5G+IXBtmISlBvC7BwggM6lmdhTbPeqcsETBHP7fMS4GJxP 2a9AejHg24oFQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4f5dkl092qz4wpJ; Wed, 04 Feb 2026 22:42:39 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 0/4] RFC: Reworks and improvements to TCP activity timers Date: Wed, 4 Feb 2026 21:41:33 +1000 Message-ID: <20260204114137.2784090-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.52.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: VSKMAVIMLBJBPSOUIOBEZWIZBCA22VSO X-Message-ID-Hash: VSKMAVIMLBJBPSOUIOBEZWIZBCA22VSO 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 existig non-working activity timeout. Arguably it should be much longer (several days), like the kernel NAT timeout for idle connection tracking. * The keepalive interval is currently 30s. That's too short - I have it there just for testing. I was intending to change it to 300s (5m) for "real", but that's certainly open to discussion. * 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. 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 | 115 ++++++++++++++++++++++++++++++++++++++----------- tcp.h | 6 ++- tcp_buf.c | 4 ++ tcp_conn.h | 5 +++ tcp_internal.h | 2 + tcp_vu.c | 3 ++ 6 files changed, 109 insertions(+), 26 deletions(-) -- 2.52.0