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.129.124]) by passt.top (Postfix) with ESMTPS id 972705A0272 for ; Fri, 04 Dec 2026 13:14:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796386472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gQ3L28PIwEkQOc0AYNzoNyWtNXmHqB+V/xUfwlPyLaQ=; b=McmGITA/wKDfUUf3rtZvF3onrUlrybhYEEh7oqBLFbG5K7pXDlAyvut5ejwbuwW8w86qqt Sd/yb5r590xylsDrw+Vg9HJo+1D8jo2N0Oi5GWQeEugrWg8LggCXHUq1Ug6MomUm76svu4 KQDrmjECCEPyKaTFp1l53GY3gJ801aE= X-MC-Rep: binary re single Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-VLe39RRtMwqc2XDGQi51aA-1; Fri, 4 Dec 2026 12:14:30 +0000 X-MC-Unique: VLe39RRtMwqc2XDGQi51aA-1 X-Mimecast-MFC-AGG-ID: VLe39RRtMwqc2XDGQi51aA_1796386469 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4bbe929886dso3919305e9.2 for ; Fri, 04 Dec 2026 04:14:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796386469; x=1796991269; h=date:content-transfer-encoding:content-type:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type;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XUnyuY= X-Received: by 2002:a05:600c:354f:b0:4bb:be79:2d with SMTP id 5b1f17b1804b1-4bbeb8cafc3mr36613525e9.12.1796386469156; Fri, 04 Dec 2026 04:14:29 -0800 (PST) X-Received: by 2002:a05:600c:354f:b0:4bb:be79:2d with SMTP id 5b1f17b1804b1-4bbeb8cafc3mr36612885e9.12.1796386468582; Fri, 04 Dec 2026 04:14:28 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d174ef2372sm5248896f8f.59.2026.12.04.04.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 04:14:27 -0800 (PST) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v2] migrate, tcp: Account for bytes acknowledged before migration Message-ID: <20261204131426.31b9296a@elisabeth> In-Reply-To: <20261204104948.1211558-1-lvivier@redhat.com> References: <20261204104948.1211558-1-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Fri, 04 Dec 2026 13:14:27 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YrlMpLp0xaeAuMBu6hZtqhV4cRtl-xff5j8840G7T14_1796386469 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: CEWK73LXL3LXDW2HVHJNOMG5CVZGAT7U X-Message-ID-Hash: CEWK73LXL3LXDW2HVHJNOMG5CVZGAT7U X-MailFrom: sbrivio@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 CC: passt-dev@passt.top 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 Fri, 4 Dec 2026 11:49:48 +0100 Laurent Vivier wrote: > The repaired socket starts with tcpi_bytes_acked at zero. Even though > seq_ack_to_tap is migrated, ACKs computed afterward from tcpi_bytes_acked > are missing the progress made on the source. > > If the target uses this counter, it can send an ACK older than the last > ACK the guest received before migration. The guest keeps retransmitting > the first segment it is still waiting for passt to acknowledge, and > rampstream_out can stall. > > A bug in tcp_rtt_dst_check() hid this in our tests. On a repaired > socket, tcpi_min_rtt is ~0U until the first RTT sample. The cast to > int turned ~0U into -1, so the target added the peer to low_rtt_dst[] > and used seq_from_tap for ACKs. > > To fix that, we set seq_init_from_tap on the target using the state > already sent by the source: > > seq_init_from_tap = seq_from_tap - t.sndq > > seq_from_tap is the next sequence number passt expects from the guest. > t.sndq includes both unsent bytes and sent bytes awaiting an ACK, so > subtracting it gives the guest sequence at the head of the restored > send queue. tcp_update_seqack_wnd() adds the repaired socket's > tcpi_bytes_acked to this base when computing the ACK sent to the guest. > > This also works when migrating from an older passt using the v2 format. > > Signed-off-by: Laurent Vivier > --- > > Notes: > v2: Reuse seq_init_from_tap on the target and drop bytes_acked Thanks, I haven't tested this yet but it all looks reasonable to me now. Would you have a chance to resend with all relevant Cc's, that is, Jon as he reviewed v1, Lynxes as their patch is blocked on it, and David as well? -- Stefano