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=N/U42W2Y; 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 B8FBD5A061C for ; Fri, 05 Dec 2025 02:20:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764897617; 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=t7hqLQNJ+f1OalytnJNoT6B3rSJIodl7mcxHv4twGuA=; b=N/U42W2YlccEDaS7DmBg3wbGXaVoxNesNECFHRHWKEP7Tar6k9EOQ6Tj2FlxCQVXOy5HBL 4YlRM/IBYfyGX12+q4LtY3+PxwRdmH173R+6Q3FBI2UtgrYo1QVtKWaWxLb6LZPMOH01sc PqnPRIb7TcbeRM/uIk3VYVU1riVwh8E= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-XgrdsHTsO8uwPCHfeA6J1A-1; Thu, 04 Dec 2025 20:20:16 -0500 X-MC-Unique: XgrdsHTsO8uwPCHfeA6J1A-1 X-Mimecast-MFC-AGG-ID: XgrdsHTsO8uwPCHfeA6J1A_1764897615 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-47775585257so10519235e9.1 for ; Thu, 04 Dec 2025 17:20:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764897615; x=1765502415; 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=t7hqLQNJ+f1OalytnJNoT6B3rSJIodl7mcxHv4twGuA=; b=lY4nJ+jxlzELmhxAID223Kx+Lx7XnyTPy5pgOPJJanaVtn+8kzGw/zvXdDtQw+Fw4h YoyLGi+xzYDKO/8kRNGVj6MGSU0zQZtW+lEhyTRZAyvanNt4/BnjuW9GA7ANacjUKMy3 2VtJlk/seT4mSBNqVvSJ0xSK15gRRWCYZPWQlJL7u54k/AupS8pMG3JwEpcDxMIK0IKf ZrXcbPJ4MPmYLta5ifuKYqIvSvbFR4nD5IvTaRoVNjNk5zVnpHJsMp5gVOW7KuYCG1J0 GeJuz7bEC7PtDgOS3Uxiv0Pr1Vzxmypz1GJT6KP+GfLlkKJWn3qVWWBGOBPb0wJROKn1 ya4Q== X-Gm-Message-State: AOJu0YwGlYcvI32HhEGt7uCLRvg/9CIovNmcecKwO6orZnfxibPkfqL0 l1/yiF245b1lLG9ycCAMd3iahCoTNSephaxilZKG/Jqr3vR3TTB04OwpWQD4V8CVf6SWnOjOv9k Tko50uS3+M0Nqp4MbJF8WiyxVQLa9wyQTFNKuGEFU28P1amnjExfSyoa3bv45WA== X-Gm-Gg: ASbGnctbKnWbhZNcBzYPOj0MFDIfMsn2VzivTelyuwyeS3E3grI1fxeMk7pw8LRiqUU ELPLChad1HSq8lKV/9+r5zVFltOHQAXPtwnO0ttff7vy+mOZx/lpda3XvlttOoG3uHGks5Xnthx jfbmGnYG70XC8jX1y2NnV8efC2eeO6FRGgx0gh+yVW99mJIpwrh4ZXnqt9If/hTPmmz0mxiSiu3 aIF0K+Wgm6SXVYKRKRQ9FFhqLpD5ihmz9ASAipL3fstF1CVCuu6tYDsfp8QwWntPbUfPUJgNsmy BKzZGCcRA0esAkRERC/57viDBmHZryupQj2Cah+6Fhzo3uvc4X3salottD1TirnUoTg08+5L7Yc D7p/HY/kFzW5suCqcMfI241eguIzPbcAS5XPd0A== X-Received: by 2002:a05:600c:35c4:b0:477:a977:b8a7 with SMTP id 5b1f17b1804b1-4792af1b164mr100620315e9.19.1764897614816; Thu, 04 Dec 2025 17:20:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFEml7T23q9axpzQCaU8736N7pkPC7d81geteWiihGiNajlXg4k3+wdL29g6C/LV05l072/Q== X-Received: by 2002:a05:600c:35c4:b0:477:a977:b8a7 with SMTP id 5b1f17b1804b1-4792af1b164mr100620165e9.19.1764897614423; Thu, 04 Dec 2025 17:20:14 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-479310b693csm55051115e9.4.2025.12.04.17.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 17:20:13 -0800 (PST) Date: Fri, 5 Dec 2025 02:20:12 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 4/8] tcp: Acknowledge everything if sending buffer is less than SNDBUF_BIG Message-ID: <20251205022012.2acceb8e@elisabeth> In-Reply-To: References: <20251204074542.2156548-1-sbrivio@redhat.com> <20251204074542.2156548-5-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: UNiJC6f41ftBTcg4npAR4fk9RHyEoEfuDjxaMIEyH4Q_1764897615 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: GG4IS242ENXB5JBPS7L46QWZMKIE6XMV X-Message-ID-Hash: GG4IS242ENXB5JBPS7L46QWZMKIE6XMV 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:08:06 +1100 David Gibson wrote: > On Thu, Dec 04, 2025 at 08:45:37AM +0100, Stefano Brivio wrote: > > ...instead of checking if it's less than SNDBUF_SMALL, because this > > isn't simply an optimisation to coalesce ACK segments: we rely on > > having enough data at once from the sender to make the buffer grow > > by means of TCP buffer size tuning implemented in the Linux kernel. > > > > Use SNDBUF_BIG: above that, we don't need auto-tuning (even though > > it might happen). SNDBUF_SMALL is too... small. > > Do you have an idea of how often sndbuf exceeds SNDBUF_BIG? I'm > wondering if by making this change we might have largely eliminated > the first branch in practice. Before this series, or after 6/8 in this series, it happens quite often. It depends on the bandwidth * delay product of course, but at 1 Gbps and 20 ms RTT we get there in a couple of seconds. Maybe 1 MiB would make more sense for typical conditions, but I'd defer this to a more adaptive implementation of the whole thing. I think it should also depend on the RTT, ideally. > > > Signed-off-by: Stefano Brivio > > --- > > tcp.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tcp.c b/tcp.c > > index e4c5a5b..fbf97a0 100644 > > --- a/tcp.c > > +++ b/tcp.c > > @@ -1079,7 +1079,7 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn, > > if (bytes_acked_cap && !force_seq && > > !CONN_IS_CLOSING(conn) && > > !(conn->flags & LOCAL) && !tcp_rtt_dst_low(conn) && > > - (unsigned)SNDBUF_GET(conn) >= SNDBUF_SMALL) { > > + (unsigned)SNDBUF_GET(conn) >= SNDBUF_BIG) { > > if (!tinfo) { > > tinfo = &tinfo_new; > > if (getsockopt(s, SOL_TCP, TCP_INFO, tinfo, &sl)) > > -- > > 2.43.0 -- Stefano