From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id D57B05A0965; Thu, 04 Dec 2025 08:45:42 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 8/8] tcp: Skip redundant ACK on partial sendmsg() failure Date: Thu, 4 Dec 2025 08:45:41 +0100 Message-ID: <20251204074542.2156548-9-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251204074542.2156548-1-sbrivio@redhat.com> References: <20251204074542.2156548-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: FAQGLNDULJIWL5C4HISZN2RLZHPIE3B7 X-Message-ID-Hash: FAQGLNDULJIWL5C4HISZN2RLZHPIE3B7 X-MailFrom: sbrivio@passt.top 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: Max Chernoff , David Gibson 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: ...we'll send a duplicate ACK right away in this case, and this redundant, earlier check is not just useless, but it might actually be harmful as we'll now send a triple ACK which might cause two retransmissions. Signed-off-by: Stefano Brivio --- tcp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tcp.c b/tcp.c index 76a9daf..fc986a2 100644 --- a/tcp.c +++ b/tcp.c @@ -1972,13 +1972,10 @@ eintr: return -1; } - if (n < (int)(seq_from_tap - conn->seq_from_tap)) { + if (n < (int)(seq_from_tap - conn->seq_from_tap)) partial_send = 1; - conn->seq_from_tap += n; - tcp_send_flag(c, conn, ACK_IF_NEEDED); - } else { - conn->seq_from_tap += n; - } + + conn->seq_from_tap += n; out: if (keep != -1 || partial_send) { -- 2.43.0