From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 842855A0269 for ; Fri, 20 Nov 2026 20:48:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795204132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4pdZC2jtbHa3eNPDwj5R+GbwD1v3igDGT9UPcSrU9RM=; b=cJib/NPXbcWbQmZyjUI6oHty5eqq3Iu5pJJ3RaqD5FywOD6CBMxSt2nnR8z0bTeqPL5H7K 9S94P2hzVLr1QhgDVRlQi1Box9XKvcEICCHTfyFy6EbIRUo5pe3FhUsxO4L9sEewac++fR d7TfUENelW4aZNv5J4WuRz/9JSjOXs8= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-sFU-bg5RN2uzi-0ILsw25A-1; Fri, 20 Nov 2026 19:48:50 +0000 X-MC-Unique: sFU-bg5RN2uzi-0ILsw25A-1 X-Mimecast-MFC-AGG-ID: sFU-bg5RN2uzi-0ILsw25A_1795204130 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-921286add9fso23464846d6.3 for ; Fri, 20 Nov 2026 11:48:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795204130; x=1795808930; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4pdZC2jtb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KVPcR6 ylJnTZbUfyVjI/yFbUAq8xp0JwOaKQf4w77XzzKEiR X-Received: by 2002:ad4:5dcc:0:b0:91e:76a7:187 with SMTP id 6a1803df08f44-92134a9e8bcmr67791686d6.43.1795204129832; Fri, 20 Nov 2026 11:48:49 -0800 (PST) X-Received: by 2002:ad4:5dcc:0:b0:91e:76a7:187 with SMTP id 6a1803df08f44-92134a9e8bcmr67791356d6.43.1795204129278; Fri, 20 Nov 2026 11:48:49 -0800 (PST) Received: from [192.168.2.15] (lnsm6-montreal02-142-122-43-105.internet.virginmobile.ca. [142.122.43.105]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349f2186sm35540316d6.29.2026.11.20.11.48.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Nov 2026 11:48:48 -0800 (PST) Message-ID: <7875d8c3-7d95-4986-a2f5-2c4a8618f328@redhat.com> Date: Fri, 20 Nov 2026 14:48:48 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] tcp: Limit fast retransmit to one per loss event To: passt-dev@passt.top References: <20261120173756.2000624-1-anskuma@redhat.com> From: Jon Maloy In-Reply-To: <20261120173756.2000624-1-anskuma@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8lkG2YeiPeRd3KbPFcw3gEx_RCQUTEAR6gwUHdoi3Tg_1795204130 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: 6DUGUQOEKKKJZND2NEFCDN7VU55FN66J X-Message-ID-Hash: 6DUGUQOEKKKJZND2NEFCDN7VU55FN66J X-MailFrom: jmaloy@redhat.com 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 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: On 2026-11-20 12:37, Anshu Kumari wrote: > Every duplicate ACK unconditionally triggered a fast retransmit, > even when the ACK sequence hadn't advanced. > > Guard fast retransmit on !conn->retries, and increment retries > after the first retransmit. This is a quick fix to stop the > amplification storm. Full compliance with RFC 5681 Section 3.2 > (three duplicate ACKs) is left to a later patch. > > Link: https://bugs.passt.top/show_bug.cgi?id=224 > Signed-off-by: Anshu Kumari > --- > tcp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tcp.c b/tcp.c > index 95f4f3e1..d3d65f76 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -2082,7 +2082,9 @@ static int tcp_data_from_tap(const struct ctx *c, struct tcp_tap_conn *conn, > > tcp_tap_window_update(c, conn, max_ack_seq_wnd, now); > > - if (retr) { > + if (retr && !conn->retries) { > + conn->retries++; > + > flow_trace(conn, > "fast re-transmit, ACK: %u, previous sequence: %u", > conn->seq_ack_from_tap, conn->seq_to_tap); > @@ -2443,7 +2445,9 @@ int tcp_tap_handler(const struct ctx *c, uint8_t pif, sa_family_t af, > tcp_update_seqack_from_tap(c, conn, ntohl(th->ack_seq), > now); > > - if (retr) { > + if (retr && !conn->retries) { > + conn->retries++; > + > flow_trace(conn, > "fast re-transmit, ACK: %u, previous sequence: %u", > ntohl(th->ack_seq), conn->seq_to_tap); This looks correct to me, and matches what Stefano suggested for v2. Two minor things: - Missing changelog for v3 below the '---' line. - In the TAP_FIN_RCVD path, tcp_data_from_sock() is still called if 'retr' is set but we skip the retransmission because conn->retries is non-zero. It's probably harmless (no rewind, so we just send what the window allows), but it might be cleaner to fold the !conn->retries check into 'retr' there, so that both uses agree. It might also be worth mentioning in the commit message that, as we now account a fast retransmit in conn->retries, the next RTO is doubled (tcp_timer_ctl() uses it as backoff exponent), and the retransmission counts towards TCP_MAX_RETRIES. With or without those changes: Reviewed-by: Jon Maloy