From patchwork Wed Aug 14 15:08:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Peixoto X-Patchwork-Id: 1972453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WkWqz4T5Vz1yXl for ; Thu, 15 Aug 2024 01:09:19 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1seFce-0005hV-EU; Wed, 14 Aug 2024 15:09:12 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1seFcc-0005gJ-ML for kernel-team@lists.ubuntu.com; Wed, 14 Aug 2024 15:09:10 +0000 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id ED5D03F6B5 for ; Wed, 14 Aug 2024 15:09:06 +0000 (UTC) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1fc53227f21so66144475ad.2 for ; Wed, 14 Aug 2024 08:09:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723648144; x=1724252944; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/oQ65+b3vM2YTFNVnibojcINxWrsH3nXXFFGi5XQZSc=; b=HwTaaGtVaZBkH4WFoC58xTdYBbkjDRf0t3tmFQYRpss/FDvZoK7pHtWkdd/875QcJO ap3lBCLuNjw1ZWKPfbdBlE3YGBG07Gk7F0iUeSIUR8n9q5dB+1dla7yruQmXtyOokJpw IIL4GIvlTmUIdm0wCQvz92DzZDMUWOFxqWsIaq9nIzR0CQ3QPFBipvw0E0krGTyIP529 x7fPUVoFcIZT3Dwu5zPisjMMVqVXGOQY47JCeq35I5tr+6QAtvWbWYZzihjeKkWIlE6Q /gEGFalFJXoTLNIPm+rhVnWs4M40rpeTyQ0nVMpfkIJUz1au6gteH9+3i/H/qV7emJZr VDnQ== X-Gm-Message-State: AOJu0Yy5NsPi1LzLUDXj6RHDsMLt/ui/xUz651CRPqQFMhMRXP7rpnuX beKT+taZgbCmCyWSHqzhMTGkZQ0SSZ5R6sKGKMf3ZjaVjzbM6xRkyaN3IsY4ZUe+r7OwvWuIu1E /oqzP1mmf2haXUM0HCvnJKMc1tf0g99F/4Bad+VnLH0/3P/LBPKihl7gUVpS/PggZNcfDd9CJui pjv9M2p90Seg== X-Received: by 2002:a17:902:e544:b0:1fc:6a13:a394 with SMTP id d9443c01a7336-201d63bacdfmr46355735ad.23.1723648144613; Wed, 14 Aug 2024 08:09:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHM4oPr4zzayOJAOjo4GGWxqW9idAqUtFBUYmkFNe/KbOp2LUci3o0by0BtSi5FZRTwdvaoaw== X-Received: by 2002:a17:902:e544:b0:1fc:6a13:a394 with SMTP id d9443c01a7336-201d63bacdfmr46355235ad.23.1723648144075; Wed, 14 Aug 2024 08:09:04 -0700 (PDT) Received: from canonical.com ([2804:1b3:a700:3d2c:3248:f628:658d:3fd4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201e6614035sm5012895ad.25.2024.08.14.08.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 08:09:03 -0700 (PDT) From: Vinicius Peixoto To: kernel-team@lists.ubuntu.com Subject: [SRU][jammy:linux-gcp][PATCH v2 2/3] tcp: derive delack_max with tcp_rto_min helper Date: Wed, 14 Aug 2024 12:08:53 -0300 Message-ID: <20240814150854.476152-3-vinicius.peixoto@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814150854.476152-1-vinicius.peixoto@canonical.com> References: <20240814150854.476152-1-vinicius.peixoto@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kevin Yang BugLink: https://bugs.launchpad.net/bugs/2076950 Rto_min now has multiple sources, ordered by preprecedence high to low: ip route option rto_min, icsk->icsk_rto_min. When derive delack_max from rto_min, we should not only use ip route option, but should use tcp_rto_min helper to get the correct rto_min. Signed-off-by: Kevin Yang Reviewed-by: Neal Cardwell Reviewed-by: Yuchung Cheng Reviewed-by: Eric Dumazet Reviewed-by: Tony Lu Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller (cherry-picked from commit 512bd0f9f926a05c724a9fd72bc4e14213845e01) Signed-off-by: Vinicius Peixoto --- net/ipv4/tcp_output.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 5ccced7e72d1..6fb5629c1db3 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3913,16 +3913,9 @@ EXPORT_SYMBOL(tcp_connect); u32 tcp_delack_max(const struct sock *sk) { - const struct dst_entry *dst = __sk_dst_get(sk); - u32 delack_max = inet_csk(sk)->icsk_delack_max; - - if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) { - u32 rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN); - u32 delack_from_rto_min = max_t(int, 1, rto_min - 1); + u32 delack_from_rto_min = max(tcp_rto_min(sk), 2) - 1; - delack_max = min_t(u32, delack_max, delack_from_rto_min); - } - return delack_max; + return min(inet_csk(sk)->icsk_delack_max, delack_from_rto_min); } /* Send out a delayed ack, the caller does the policy checking