public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Jon Maloy <jmaloy@redhat.com>
Cc: david@gibson.dropbear.id.au, passt-dev@passt.top
Subject: Re: [PATCH] tcp_buf: Don't fill the slot reserved for duplicate ACKs with data
Date: Fri, 27 Nov 2026 09:29:15 +0100 (CET)	[thread overview]
Message-ID: <20261127092914.342cf24f@elisabeth> (raw)
In-Reply-To: <20261126001327.4136475-1-jmaloy@redhat.com>

On Wed, 25 Nov 2026 19:13:27 -0500
Jon Maloy <jmaloy@redhat.com> wrote:

> Since commit db7fb06f710e ("tcp_buf: Always reserve slot for possible
> duplicate ACK flag in the same batch"), tcp_data_to_tap() flushes the
> batch when only one free slot is left. However, in passt mode,
> tcp_buf_data_from_sock() can still receive into all TCP_FRAMES_MEM
> buffers at once, meaning that if it gets more than TCP_FRAMES_MEM - 1
> segments, tcp_data_to_tap() flushes after the second last one, and
> then continues with building the last frame in slot 0. This has
> the consequence that the last segment is forwarded to the guest
> with the payload of the first segment, which we just sent, instead
> of the one we received into the last slot.
> 
> We limit the number of buffers we receive into to TCP_FRAMES_MEM - 1,
> so that a whole batch of data frames always fits before the reserved
> slot.
> 
> This also fixes a clang-tidy 23 warning in tcp_buf_data_from_sock(),
> as the check on available slots there can now be false.
> 
> Fixes: db7fb06f710e ("tcp_buf: Always reserve slot for possible duplicate ACK flag in the same batch")

Whoops.

> Signed-off-by: Jon Maloy <jmaloy@redhat.com>

Applied.

-- 
Stefano


      reply	other threads:[~2026-11-27  8:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  0:13 Jon Maloy
2026-11-27  8:29 ` 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=20261127092914.342cf24f@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).