From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RZjXJLGK; dkim-atps=neutral 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 EAE315A061E for ; Fri, 05 Dec 2025 02:20:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764897620; 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=LNLceWcXAH9//N9d9ddhNyM6GJTLqN1Kw24aWxEGqm8=; b=RZjXJLGK3U1+AJ6IryfVLffdGsRWRi/GUKW48oy4ivIl40zRpvpz68X1yltVM7/NKwoHZc qSKuWjtuusjUe9WEhT7+31aRCMtQ/L44maGEzEnzdisVxAIq8d+ZXOjVVm3vaG572qtzx9 rSKRT/+K8ZTs2BeX/k3sIZWU+UcBH84= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-119-1KPoG57QOyC-Yw12ldqJQg-1; Thu, 04 Dec 2025 20:20:19 -0500 X-MC-Unique: 1KPoG57QOyC-Yw12ldqJQg-1 X-Mimecast-MFC-AGG-ID: 1KPoG57QOyC-Yw12ldqJQg_1764897618 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-42e2e448d01so1465670f8f.1 for ; Thu, 04 Dec 2025 17:20:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764897618; x=1765502418; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LNLceWcXAH9//N9d9ddhNyM6GJTLqN1Kw24aWxEGqm8=; b=ErWn9qF6w5u9eSGdEugw1ncKjyofRddj8mXsDMKGfXGr2nLk544zcdndkoLFgenLPS nD5wmCtA1NB6s5hoX7dUSqBu0H8p0nWcQxSfmEL9lKBI0mSdXm3Q/bY50uK/WXgP8VCj 31ZOYEsYIl+7Fc+i7/hRKwcn8sL0VHNTatj+z8Vvk2yuVI94SATEJjaeNUmtkkeh3jR6 GzltEABJIpV3emMvHMrxKvqxRumZpPj4ETlLaHsXmFqomSizg9M2u/FmgigQnpXJmoBx JR393Vs2QQshYeph9rMD1KyrJMkmQ6ht0luOVY6i1ImI+hYjmjGguLOzXPHzFyI31lkD nu3w== X-Gm-Message-State: AOJu0YxgjormtM7PJQoLENZiL5SVNsiq6Qa8Mj4lh2LRNJeqDA5mjal1 vAVVqa+UD3hLWtX+oBuyAyW1tgVWawJ8x+2zvRQZjoYNyK8C+89BvlnG9r/FX+0WuNswD7WJmDf jsPLKHvwd6KrUcn7T6tDPpYexB0Pf1MyhfT0zyddngnrvt+eK1xbzOQ== X-Gm-Gg: ASbGnctnQNKx/tOl2PpKU/CNapkHtijLHO/aaUfBZQ+BjFXI/LztvHqMHGQXK8Qg7Kd AmR6ENxSyjLbCfZBytA5J0M5rw/p7g6W7AMdU0QqYs8N4Rwa3yFSSOBYQ9EWal1KiBMLq/GL/uQ q1rW4SjqF0YOimIRvZ9x7usD+W4QejX1KGT3/AMbemUr7GJbHogkr8nxwis8xNvIAiDlW3l2PzB chDTNbPPf5CDFVH70hCtlr9rqmp7KuJjmBVGrrezCOaC9M4x3om7GFy+eAUTsHmaMC2onjmW23A pb10h5zy0kjLObnX/4dzLaWI20z0RgqfZ+WaV0w51u113H18uLZZ8SbQUVMg3W6A+Uw1hwuKolX M4gSGqDgy9apTXlJN/fulIxEwmBZcR1vRQ6VgVg== X-Received: by 2002:a05:6000:18a8:b0:426:ee08:8ea9 with SMTP id ffacd0b85a97d-42f79851e39mr4700211f8f.44.1764897618428; Thu, 04 Dec 2025 17:20:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJs9Rs8rnqwTl9yOR27oSrj9K7K+ksOxYUxeGFoKEWn7aGwbzcXP42dVw8rQ6uTai/Qm9vAQ== X-Received: by 2002:a05:6000:18a8:b0:426:ee08:8ea9 with SMTP id ffacd0b85a97d-42f79851e39mr4700196f8f.44.1764897617904; Thu, 04 Dec 2025 17:20:17 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42f7d2231dfsm5957301f8f.26.2025.12.04.17.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 17:20:17 -0800 (PST) Date: Fri, 5 Dec 2025 02:20:16 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 5/8] tcp: Don't limit window to less-than-MSS values, use zero instead Message-ID: <20251205022016.4554e520@elisabeth> In-Reply-To: References: <20251204074542.2156548-1-sbrivio@redhat.com> <20251204074542.2156548-6-sbrivio@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 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: yEDk979VN775gqsjI8kNzLqNuBvQtNzFUl2iy8okFC4_1764897618 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: BHRKHOCXLMHHU4GBXATLB3CJYI23QCGX X-Message-ID-Hash: BHRKHOCXLMHHU4GBXATLB3CJYI23QCGX 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: passt-dev@passt.top, Max Chernoff 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 Fri, 5 Dec 2025 11:35:22 +1100 David Gibson wrote: > On Thu, Dec 04, 2025 at 08:45:38AM +0100, Stefano Brivio wrote: > > If the sender uses data clumping (including Nagle's algorithm) for > > Silly Window Syndrome (SWS) avoidance, advertising less than a MSS > > means the sender might stop sending altogether, and window updates > > after a low window condition are just as important as they are in > > a zero-window condition. > > > > For simplicity, approximate that limit to zero, as we have an > > implementation forcing window updates after zero-sized windows. > > > > Signed-off-by: Stefano Brivio > > The logic change looks good to me, so, > > Reviewed-by: David Gibson > > However, a couple of points about the description (both commit message > and comment). > > * Nagle's algorithm is certainly related, but it's not clear to me > it's quite the same thing as the sender-side SWS avoidance > algorithm - Nagle's exists for a different purpose, certainly. > RFC 813 doesn't name Nagle's algorithm anywhere, although that > could because the name wasn't as established at the time. Sure, Nagle's algorithm was published almost two years later (RFC 896). > * Since you're referencing RFC 813 anyway, it seems relevant that > what you're doing here is pretty similar to the receiver-side SWS > avoidance algorithm described in section 4. The practical problem I observed comes from the "clumping" Linux does while sending (and that's implemented as part of Nagle's algorithm). But yes I actually ignored section 4 in all this, I'll mention it explicitly. > > --- > > tcp.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/tcp.c b/tcp.c > > index fbf97a0..2220059 100644 > > --- a/tcp.c > > +++ b/tcp.c > > @@ -1140,6 +1140,18 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn, > > else > > limit = SNDBUF_GET(conn) - (int)sendq; > > > > + /* If the sender uses Nagle's algorithm to prevent Silly Window > > + * Syndrome (SWS, RFC 813 Section 3) it's critical that, should > > + * the window ever become less than the MSS, we advertise a new > > + * value once it increases again to be above it. > > + * > > + * To this end, for simplicity, approximate a window value below > > + * the MSS to zero, as we already have mechanisms in place to > > + * force updates after the window becomes zero. > > + */ > > + if (limit < MSS_GET(conn)) > > + limit = 0; > > + > > new_wnd_to_tap = MIN((int)tinfo->tcpi_snd_wnd, limit); > > } > > > > -- > > 2.43.0 -- Stefano