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 3FC2C5A0271 for ; Fri, 27 Nov 2026 09:29:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795768160; 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=jt/oa0nzI9RDUi4WEmv+tZcrBEtnp0Fbk8fcNld5tmo=; b=DqlpGlXYl/JzkgKW1aD36So+vRIFOsy1qJRw1v6y4LHgSlDZddcqPIXPB+PEpszjoFlBQs h+UPksWl5RX2TZoN/4WTLV9qqfgU1P3wd8kK7qpXs4+YQeJ02+WhRs8XXqWgoAU/94nTcq q4qpQWwQ4Q/DSGo7lJ6nISrGjCc89H8= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-yRHBmNb8OeKE7GXS3xpQ-A-1; Fri, 27 Nov 2026 08:29:18 +0000 X-MC-Unique: yRHBmNb8OeKE7GXS3xpQ-A-1 X-Mimecast-MFC-AGG-ID: yRHBmNb8OeKE7GXS3xpQ-A_1795768157 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48fcb657f32so4611186f8f.2 for ; Fri, 27 Nov 2026 00:29:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795768157; x=1796372957; 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-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4dl837GVBklxD0H2UfXxiM i0bZTz/bivxlCvE5bjB6yeOqcY/QOxUCHmzVTykxvaxg2ydkgb7BwcIk5qw0giIBHh9Q= X-Received: by 2002:a5d:5c05:0:b0:4b7:760c:71ac with SMTP id ffacd0b85a97d-4b7760c729emr22717636f8f.24.1795768156565; Fri, 27 Nov 2026 00:29:16 -0800 (PST) X-Received: by 2002:a5d:5c05:0:b0:4b7:760c:71ac with SMTP id ffacd0b85a97d-4b7760c729emr22717577f8f.24.1795768156052; Fri, 27 Nov 2026 00:29:16 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4bef07f9e0dsm2469255f8f.53.2026.11.27.00.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2026 00:29:15 -0800 (PST) From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH] tcp_buf: Don't fill the slot reserved for duplicate ACKs with data Message-ID: <20261127092914.342cf24f@elisabeth> In-Reply-To: <20261126001327.4136475-1-jmaloy@redhat.com> References: <20261126001327.4136475-1-jmaloy@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, 27 Nov 2026 09:29:15 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: s2CF9xXKFAtIgQeRr_u_66A8xhGzLiuLDiRfh_9bxf0_1795768157 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 5WU7R6PMCEYDVHDX5T7KB4ODQQOFMP2M X-Message-ID-Hash: 5WU7R6PMCEYDVHDX5T7KB4ODQQOFMP2M 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: david@gibson.dropbear.id.au, 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 Wed, 25 Nov 2026 19:13:27 -0500 Jon Maloy 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 Applied. -- Stefano