From nobody Mon Jan 06 20:44:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRmPq2XrJz5kBjg; Mon, 06 Jan 2025 20:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRmPq197Rz4Zmr; Mon, 6 Jan 2025 20:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736196271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7z2ZGKCBo70/5rvF849l7mU7ZjvxBozmKi7J2oK2PaY=; b=aCzQC/LHNbzAapYgyxEa3Naxv0FYJnZPGuaxg/m0iunymzlbvyq2ybVxioiQvJD+z1o3pK bbPODrYTIQmzcJuuZQUMFcbyooFDZZK8LpqFu0mKPk7+Bvvq7SKAfg+GTa/yBqk1w6NUAd EJLO/Vw/LofeUHicofpHKY1XeO7dtQZj32rFUDkAS7fOexTPVTNxBbotbnYHW/5mlSzdOb LKNdt5Ig+2oJ0XhTMqESNY1t42CyLGbeTRrVkeTvsJq+jdGBirmaVwalXQClLpF9mVNL2+ 20V6/P7ysWqdIFFUKK6nH+X4vuTl3/latNC5Ng9MPPEePOtCEVd7joTzbqdXgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736196271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7z2ZGKCBo70/5rvF849l7mU7ZjvxBozmKi7J2oK2PaY=; b=QxIU/rcQ1gWWp9xFf/Boka3GbA0lNEmsj9grWbQ/l+8QeqbZB0danNIUsxytvsduY0Be7p s+GWcfn5lY3jMpmu8hgm1r9RAgPg5T0Vp5XSBPNqFvuN9tLsGpdMFvJkiqlpr6eH/97Tty Wx1x3209MHJO/CdZWQdSUYOJrUuUC/Ws+fJ9Qj/SsvV4soGr7Qt7d6k/BEjDxaFIu6hOLe +JLtScc1VDUx/BwaIGtKIfKVwiuxpPJNSpjxORS+YpydP0kRE3dLj5jbSYQayezIMC6UdI KEc8YZdoH6r3cPXD/NhGgTyySPba2aMauD2jhq5R/lZ8hs9Mm9uyWVvJXmkuAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736196271; a=rsa-sha256; cv=none; b=dH2WIQX5z5jyn9E+BvZXf2DrCkYhOZpIA3CZbbdIt1Vipu0oV8pMqHY22bUWDvceyF9lzW 9504NYT0APcqpHMLyuVLUN2SzYwD5ZEa/lmk9arNV5RqP7D2ssgqnIIkxBodMOo9BGZTv5 wUWywVrjTBzW0BNKXRXZ5p43CjK/+gZ59y8m0lBMhC3a3dJAr9y0Fq5RT059uFFcsZMEDz OqjIaeaFteSon9n8O0UslCVJmIrHriwEZ2DBkek1LJtHPe4jlgvKA3CT3rT8z6kZDAmxn4 S3NuUms90O16VwdMvgPHI3Sv2RCs0+KZGWnaj7GpJBtkCJ4dLw6v88/ViWYyww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRmPq0NF0zgCd; Mon, 06 Jan 2025 20:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506KiUJ7006414; Mon, 6 Jan 2025 20:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506KiUB7006411; Mon, 6 Jan 2025 20:44:30 GMT (envelope-from git) Date: Mon, 6 Jan 2025 20:44:30 GMT Message-Id: <202501062044.506KiUB7006411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e8ec28047df5 - main - TCP RACK: fix TCP_RACK_PACING_BETA socket option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8ec28047df5185582a95c5211ed75682fad5ec5 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e8ec28047df5185582a95c5211ed75682fad5ec5 commit e8ec28047df5185582a95c5211ed75682fad5ec5 Author: Michael Tuexen AuthorDate: 2025-01-06 20:38:34 +0000 Commit: Michael Tuexen CommitDate: 2025-01-06 20:38:34 +0000 TCP RACK: fix TCP_RACK_PACING_BETA socket option Bring back the code, which was accidentally removed. While there, indent a comment correctly. Reviewed by: rrs CID: 1540026 Fixes: e18b97bd63a8 ("Update to bring the rack stack with all its fixes in.") MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48340 --- sys/netinet/tcp_stacks/rack.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 7baf1a626787..f590edd71d9d 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -24486,15 +24486,29 @@ rack_get_sockopt(struct tcpcb *tp, struct sockopt *sopt) * when you exit recovery. */ case TCP_RACK_PACING_BETA: + if (strcmp(tp->t_cc->name, CCALGONAME_NEWRENO) != 0) + error = EINVAL; + else if (rack->rc_pacing_cc_set == 0) + optval = rack->r_ctl.rc_saved_beta.beta; + else { + /* + * Reach out into the CC data and report back what + * I have previously set. Yeah it looks hackish but + * we don't want to report the saved values. + */ + if (tp->t_ccv.cc_data) + optval = ((struct newreno *)tp->t_ccv.cc_data)->beta; + else + error = EINVAL; + } break; - /* - * Beta_ecn is the congestion control value for NewReno that influences how - * much of a backoff happens when a ECN mark is detected. It is normally set - * to 80 for 80% i.e. the cwnd is reduced by 20% of its previous value when - * you exit recovery. Note that classic ECN has a beta of 50, it is only - * ABE Ecn that uses this "less" value, but we do too with pacing :) - */ - + /* + * Beta_ecn is the congestion control value for NewReno that influences how + * much of a backoff happens when a ECN mark is detected. It is normally set + * to 80 for 80% i.e. the cwnd is reduced by 20% of its previous value when + * you exit recovery. Note that classic ECN has a beta of 50, it is only + * ABE Ecn that uses this "less" value, but we do too with pacing :) + */ case TCP_RACK_PACING_BETA_ECN: if (strcmp(tp->t_cc->name, CCALGONAME_NEWRENO) != 0) error = EINVAL;