public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top, jmaloy@redhat.com
Subject: Re: [PATCH] tcp: Fix subtle bug in fast re-transmit path
Date: Mon, 12 Feb 2024 00:16:47 +0100	[thread overview]
Message-ID: <20240212001647.19ca7e2e@elisabeth> (raw)
In-Reply-To: <20240207125721.1593836-1-david@gibson.dropbear.id.au>

On Wed,  7 Feb 2024 23:57:21 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> When a duplicate ack from the tap side triggers a fast re-transmit, we set
> both conn->seq_ack_from_tap and conn->seq_to_tap to the sequence number of
> the duplicate ack.  Setting seq_to_tap is correct: this is what triggers
> the retransmit from this point onwards.  Setting seq_ack_from_tap is
> not correct, though.
> 
> In most cases setting seq_ack_from_tap will be redundant but harmless:
> it will have already been updated to the same value by
> tcp_update_seqack_from_tap() a few lines above.  However that call can
> be skipped if tcp_sock_consume() fails, which is rare but possible.  In
> that case this update will cause problems.
> 
> We use seq_ack_from_tap to track two logically distinct things: how much of
> the stream has been acked by the guest, and how much of the stream from the
> socket has been read and discarded (as opposed to MSG_PEEKed).  We attempt
> to keep those values the same, because we discard data exactly when it is
> acked by the guest.  However tcp_sock_consume() failing means we weren't
> able to disard the acked data.  To handle that case, we skip the usual
> update of seq_ack_from_tap, effectively ignoring the ack assuming we'll get
> one which supersedes it soon enough.  Setting seq_ack_from_tap in the
> fast retransmit path, however, means we now really will have the
> read/discard point in the stream out of sync with seq_ack_from_tap.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

-- 
Stefano


      reply	other threads:[~2024-02-11 23:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 12:57 [PATCH] tcp: Fix subtle bug in fast re-transmit path David Gibson
2024-02-11 23:16 ` Stefano Brivio [this message]

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=20240212001647.19ca7e2e@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=jmaloy@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).