From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67F603DDB0A for ; Fri, 9 Oct 2026 05:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791522100; cv=none; b=ZCQufabY8HnnWrflhMaOdD0ckmW3YfOo9JphC7MNP1wDHL2sbllV4LKz95/C+PB5yQpPz6qB1xhWB+IuMlfzqMu5EYqi3KkN1YQM1jbNAc5juFoVz8Zo40n44wSXKrXePLxHudb8xf4Mlcq8dl8AvgpocwNrNPXtm1gdJfBIyvE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791522100; c=relaxed/simple; bh=2aOVtGKiBak+YEir9vGEflIXTY/GKD/mvSiVxOknZJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D6+QfiVk7R3HuG9egspSubLgA1s7xIizNlvpH+YTs4UOVeFxkvMPY0skPBFrNeaoQmUtearkZgRrNecV+G//VwthL/l/b+OApuxzpFsSmt6OEZBdDt6YM2+Sktips0+Q51wEXNSWovrOYOokOI3DohOrvM99KRd2wEkN36tB/Og= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=openai.com; spf=pass smtp.mailfrom=openai.com; dkim=pass (1024-bit key) header.d=openai.com header.i=@openai.com header.b=MgLGgqMd; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=openai.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=openai.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=openai.com header.i=@openai.com header.b="MgLGgqMd" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-4b28d7c729fso3261293b6e.0 for ; Thu, 08 Oct 2026 22:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openai.com; s=google; t=1791522097; x=1792126897; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MNccfgSxjshaBl7aTQNEsVLhpMSJOchAidbbwac3i2I=; b=MgLGgqMd7s8eaBFTHr/8Sl92WVRbdwIqnwduMfDbG5pAYuDs+RQVw4bg9+ao8utSJv DZ/LWX1stxVpp0xIVA1QVDHlDfsFnZT9jOkzmhbYW6dLy6ZLae4I36xl+WMwr2FA1OG4 dtSiFjn/KEdaKXmi7kTdV/aSOQhqs+ETs5R30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791522097; x=1792126897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=MNccfgSxjshaBl7aTQNEsVLhpMSJOchAidbbwac3i2I=; b=eqcqe4ZSRInRPmEZFKuAZObWy8dnIb3clMrhPJdqnrDVYMJQmp8tvMkGvZKgWKgtLO vH+JLT1e7ePWRfbs/YAFLM5jcIaYwYWkv6hxPcHbLjI46okIR1VyBI51jNr3Ww/u0Nsw sq0ICwoSKlUyUZzCLZ0rZyWdKlMgI8C9P3y+VCdJyY8yvW6G7W9ml9Oz4DKgo91cxx11 dmppArJc+FRRq8d9fG5o8qgalIZWi3zIWUXo2fJPMAR0fywtT2XKsGEzytxKt7q7x309 P8PGCVqxx2qQy0NXOkrX8rz/A7iAmNhjUtEIyP2MrY+cHBKcpjRHGV8YGA+r6l1+pMZm apTw== X-Forwarded-Encrypted: i=1; AKwUvBwWmruyVlg9sUHEugKgiNRM+EpFcLapgF1fcKHQgkT8tKE0dKSkncGnGbmu7OEeu9yJDYk2Ujy/xUny5hw=@vger.kernel.org X-Gm-Message-State: AFuF++lBlhJjwymuavoETHAXEM/ZAabNarMOb5wrlRZbsbZD/B427haA FisobJBZvuOdiQ1jGYwPZJoNzs1uJQZKCMTwEbXggkffZvhHfkPxHa8Zxa4H5aG922g= X-Gm-Gg: AYBFou12tjdcx1Fs2syZDTNz3/445cwYGVbJ+BmSB8c7K4oYQqi6xBzAY9SOlEdrr/X qh78CujiN2LSdoyWeCb4BnzjLSoJQGeaYX/LIu5U/buV/5EwGnxBqTCICPGwpDTBF/ji0qYci+f FFhka8B1evZIkfH0BuBfyuYgUMpVlbLfSX5FCvdQx8yaG1uySKZLHu3vvx6W463DnppTjZIiCWK NS7jVHxwLcatm1RC63dKZJlSrQgvRQftfN4lcuhwm+xJXGResW+gezo8RzEjWeTDcTWP+K8WgFs lODxck5YEHc+DZG/HnSkvHqDp82qZKReLVCpRorMk5+LmR9Nn+fUW7IS80pCjD+sOMu81wmZNMt CdxEQG7oYVPihZdc+5JWgvIMt6hCyKUPZw6rmtGae8/fwHq0wMlxtHybpJNcPRauYrON007OW2D 36yCvoKT9xd5O2La4bM1+LexXb1HuFE2IL8CAgLuPoqYDTdr96e+pSPLck7Gu4AlmYRRV/JENiH fH2WqgKscmWbahyTjZn3i0EvGzj2ue53V1BKUcthuH3NdE6ZsHohjFOdlhs72PWLla3v6wVWiAL ako= X-Received: by 2002:a05:6808:50a5:b0:4e8:2150:299 with SMTP id 5614622812f47-50c50f2ea06mr735024b6e.23.1791522097155; Thu, 08 Oct 2026 22:01:37 -0700 (PDT) Received: from com-68297.corp.openai.org ([199.47.143.0]) by smtp.gmail.com with ESMTPSA id 5614622812f47-50c1c1246cbsm944574b6e.18.2026.10.08.22.01.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Oct 2026 22:01:36 -0700 (PDT) From: nramaswamy@openai.com To: netdev@vger.kernel.org Cc: Neil Ramaswamy , Eric Dumazet , Neal Cardwell , Neal Cardwell , Kuniyuki Iwashima , Yuchung Cheng , Jiayuan Chen , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH net v3 2/3] selftests: net: packetdrill: test RACK after partial undo Date: Thu, 8 Oct 2026 22:00:33 -0700 Message-ID: X-Mailer: git-send-email 2.55.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Neil Ramaswamy Reproduces a partial undo bug where a segment is unmarked as lost but is never returned to RACK's timestamp sorted list, which makes it ineligible for future fast retransmission. Signed-off-by: Neil Ramaswamy Assisted-by: LLM sparse --- ...tcp_partial_undo-restores-to-rack-list.pkt | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tools/testing/selftests/net/packetdrill/tcp_partial_undo-restores-to-rack-list.pkt diff --git a/tools/testing/selftests/net/packetdrill/tcp_partial_undo-restores-to-rack-list.pkt b/tools/testing/selftests/net/packetdrill/tcp_partial_undo-restores-to-rack-list.pkt new file mode 100644 index 000000000000..e37e1e679e02 --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/tcp_partial_undo-restores-to-rack-list.pkt @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Test that a segment unmarked as lost during partial undo is eligible +// for future fast retransmission. + +`./defaults.sh` + +// Establish a connection with a 100 ms RTT and a 1000-byte payload MSS. +// Linux subtracts the 12-byte timestamp options from the advertised MSS. + 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 + +0 bind(3, ..., ...) = 0 + +0 listen(3, 1) = 0 + + +.1 < S 0:0(0) win 20000 + +0 > S. 0:0(0) ack 1 + +.1 < . 1:1(0) ack 1 win 20000 + +0 accept(3, ..., ...) = 4 + +// Send A, B, C and D, then E 47 ms after D. + +.01 write(4, ..., 1000) = 1000 + +0 > P. 1:1001(1000) ack 1 ++.001 write(4, ..., 1000) = 1000 + +0 > P. 1001:2001(1000) ack 1 <...> ++.001 write(4, ..., 1000) = 1000 + +0 > P. 2001:3001(1000) ack 1 <...> ++.001 write(4, ..., 1000) = 1000 + +0 > P. 3001:4001(1000) ack 1 <...> ++.047 write(4, ..., 1000) = 1000 + +0 > P. 4001:5001(1000) ack 1 <...> + +// SACK C and E together. RACK marks A, B and D lost. D is old enough +// to be retransmitted, but this ACK reports only two newly delivered +// segments, allowing A and B to be retransmitted while D waits. + +.12 < . 1:1(0) ack 1 win 20000 + +0 > P. 1:1001(1000) ack 1 <...> + +0 > P. 1001:2001(1000) ack 1 <...> + +0 %{ +assert tcpi_ca_state == TCP_CA_Recovery, tcpi_ca_state +assert tcpi_lost == 3, tcpi_lost +assert tcpi_retrans == 2, tcpi_retrans +}% + +// Deliver retransmitted B and then the original A. D stays missing, +// and we ACK through C with A's original timestamp, which is before +// retransmission started. This triggers partial undo, but since D +// is not EVER_RETRANS, partial undo should add it back to the RACK list. +// Critically, we test that the RTO retry counter should stay 0. + +.07 < . 1:1(0) ack 3001 win 20000 + +0~+.05 > P. 3001:4001(1000) ack 1 + +0 %{ assert tcpi_retransmits == 0, tcpi_retransmits }% + +// Acknowledge all five segments. + +.01 < . 1:1(0) ack 5001 win 20000 -- 2.55.0