From patchwork Mon Jan 13 04:06:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahdi Arghavani X-Patchwork-Id: 13936695 X-Patchwork-Delegate: kuba@kernel.org Received: from sonic313-15.consmr.mail.bf2.yahoo.com (sonic313-15.consmr.mail.bf2.yahoo.com [74.6.133.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9213E14A0B7 for ; Mon, 13 Jan 2025 04:11:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.6.133.125 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736741478; cv=none; b=rrD0OQMHCERooIavYQk5ChVkqOK/BV2gzbsZEEf2MTuE/mERnadGCVX1VNidgO9xub7LmzVXwuEdyUu1rzZhiwTRyklV6o56xnJ9BS8JM3mTDy36VZ4PE/qV/rzCvQNvc+aqVlnyDFoJGgj5KNKW/WM/ZTU4XCueEmDuuhNNsrc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736741478; c=relaxed/simple; bh=VeVFsBj2QxdME0VrZ3xMek5E7CUQuGFqZj1EtNu9urA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:References; b=AWMYy0ys1yzbE3WHSo/iDu7It+3Cp2AmQdb8acHulQHM1/u359nZKDA5T22fQc9SntR689VpnpmpFd9DWnVGz4AhLNKRIznz6TJz0W0qxBmCnotQx8+yq6LfRlmMigY85m+waifVHbPhw2adG6J84+OmPdHsH/g70O9HsGJnSy8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=nCYwFgsb; arc=none smtp.client-ip=74.6.133.125 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="nCYwFgsb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1736741475; bh=QPt8HIeVJh8dcP5TCaQXUGbNj0NCzNHfAkHXujytotc=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=nCYwFgsb6jWKis3fgqgucGnA3Ds/mM93WwS3aqjQzW5AX0TAgP3YqfXQ3DVtdzgtKW/Q24gUADZdENsAglDW7kOaUYwSpbIBgzMvzMav0GcoylOptMbp8LnH6D0qeGt3CGM7waO7gSJYu9vhMB5zszseOLc7JuycJktwfzfPWQ6m2hF/65m4ZSK6vwR8SQrJ6mtB5Oukkao6g4riNmAZBahhlbLCLzFKaBcHRK/RHstzJlv2K0Mt9R0oUNl89iitUIdJaqtHwbNcNPwnFNZmU+cLmgMVLq/RNN4wcFW2BiNIE6AWLrRLND3f+E/YPl/sPh+XVMdZmkSNnpf1NYMMWQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1736741475; bh=LvmMg1dHcd3n4yAEpjWfZAj0x5TmTFUgIe2yLIibXZa=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=IFGAuw72HgEZIeLziOyvYMM1zxUFfcP2Di+bCVVivqXx90lmQfz/KKYdtaaClGUQG1l+8D2nOfZ7TWb6aNOnhyLQNiyZJVBra4vyWXEpjShUYHb92i/lP+BmzuEUDnAroCo2qIoTtz6IJ8Uc21NPPi5s+6tLyVEabV0B8zTYzb68kSfpGOMKanI3vjVuW5H9VIZ2JIddPUIDuFVEhMhfNXmIOVMOGeVcVrYCtcRicW9rt6tWPg934K9UjF4l7EqA/KXJp3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SkfJTdCxMyPxTl2TpMSSPu0MsaO8KYtU4BC0b5IReud7OqYkqCyuBicAC5HIIrthTL o66l28hcvbWt3Q3ziG2nETxzTa1jkaukLZ6yp3AUno5H5ymoKOTSD_w5lyZvuDiRus1D7eYPYOfm E2Dtzv12TmsBj5kywPJsIWZhdmEQjohecmo77oFFEP2APwnEhjzo2VPQgJiHremcWTTgpjzKlIuH KOXxr6YIQaizdWJKXnL6uu1kF1YBtncVB_w0WQMiS3Ml8U5BkzCbyvIPCGg-- X-Sonic-MF: X-Sonic-ID: f0b441b7-9587-487c-ac7c-c03144fe67ee Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.bf2.yahoo.com with HTTP; Mon, 13 Jan 2025 04:11:15 +0000 Received: by hermes--production-gq1-5dd4b47f46-5kxd4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 38b48d2bb23278eba059861bb4d63b73; Mon, 13 Jan 2025 04:11:10 +0000 (UTC) From: Mahdi Arghavani To: netdev@vger.kernel.org Cc: ncardwell@google.com, edumazet@google.com, haibo.zhang@otago.ac.nz, david.eyers@otago.ac.nz, abbas.arghavani@mdu.se, Mahdi Arghavani Subject: [PATCH net] Fixes: 4e1fddc98d25 ("tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows") Date: Mon, 13 Jan 2025 04:06:56 +0000 Message-ID: <20250113040656.3195-1-ma.arghavani@yahoo.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250113040656.3195-1-ma.arghavani.ref@yahoo.com> X-Patchwork-Delegate: kuba@kernel.org I noticed that HyStart incorrectly marks the start of rounds, resulting in inaccurate measurements of ACK train lengths. Since HyStart relies on ACK train lengths as one of two thresholds to terminate exponential cwnd growth during Slow-Start, this inaccuracy renders that threshold ineffective, potentially degrading TCP performance. The issue arises because the changes introduced in commit 4e1fddc98d25 ("tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows") move the caller of the `bictcp_hystart_reset` function inside the `hystart_update` function. This modification adds an additional condition for triggering the caller, requiring that (tcp_snd_cwnd(tp) >= hystart_low_window) must also be satisfied before invoking `bictcp_hystart_reset`. The proposed fix ensures that `bictcp_hystart_reset` is correctly called at the start of a new round, regardless of the congestion window size. This is achieved by moving the condition (tcp_snd_cwnd(tp) >= hystart_low_window) from before calling bictcp_hystart_reset to after it. Signed-off-by: Mahdi Arghavani Cc: Neal Cardwell Cc: Eric Dumazet Cc: Haibo Zhang Cc: David Eyers Cc: Abbas Arghavani --- Makefile | 2 +- net/ipv4/tcp_cubic.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7904d5d88088..e20a62ad397f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ VERSION = 6 PATCHLEVEL = 13 SUBLEVEL = 0 -EXTRAVERSION = -rc6 +EXTRAVERSION = -rc7 NAME = Baby Opossum Posse # *DOCUMENTATION* diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 5dbed91c6178..76c23675ae50 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c @@ -392,6 +392,10 @@ static void hystart_update(struct sock *sk, u32 delay) if (after(tp->snd_una, ca->end_seq)) bictcp_hystart_reset(sk); + /* hystart triggers when cwnd is larger than some threshold */ + if (tcp_snd_cwnd(tp) < hystart_low_window) + return; + if (hystart_detect & HYSTART_ACK_TRAIN) { u32 now = bictcp_clock_us(sk); @@ -467,9 +471,7 @@ __bpf_kfunc static void cubictcp_acked(struct sock *sk, const struct ack_sample if (ca->delay_min == 0 || ca->delay_min > delay) ca->delay_min = delay; - /* hystart triggers when cwnd is larger than some threshold */ - if (!ca->found && tcp_in_slow_start(tp) && hystart && - tcp_snd_cwnd(tp) >= hystart_low_window) + if (!ca->found && tcp_in_slow_start(tp) && hystart) hystart_update(sk, delay); }