public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v2] migrate, tcp: Account for bytes acknowledged before migration
Date: Fri, 04 Dec 2026 13:14:27 +0100 (CET)	[thread overview]
Message-ID: <20261204131426.31b9296a@elisabeth> (raw)
In-Reply-To: <20261204104948.1211558-1-lvivier@redhat.com>

On Fri,  4 Dec 2026 11:49:48 +0100
Laurent Vivier <lvivier@redhat.com> 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 <lvivier@redhat.com>
> ---
> 
> 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

  reply	other threads:[~2026-12-04 12:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 10:49 Laurent Vivier
2026-12-04 12:14 ` Stefano Brivio [this message]
2026-12-04 12:28 Laurent Vivier
2026-12-04 19:24 ` Jon Maloy
2026-12-04 20:56   ` Stefano Brivio
2026-12-04 21:15     ` Jon Maloy
2026-12-04 22:31 ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204131426.31b9296a@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).