From nobody Tue Dec 31 16:32:08 2024 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 4YMz5N55Z5z5jkHj; Tue, 31 Dec 2024 16:32:08 +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 4YMz5N2N7Fz4cm1; Tue, 31 Dec 2024 16:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735662728; 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=vFy0NgjfWf3TndN5PwfVPXdqR4uNu9pgiMDeKBnerAM=; b=lCOPW9zwi0hIAZ4/OYUHYigDExknPlkuSukGc9s4wyyFAOdSUZUca6JQXmJ1HeegFR9ho8 9WdOO4ajaSQJS/7Pv2/cLVP7oBNbUd/8WrYQ/MeO4eh3Z6kzFbGhYEdBxzWiJFn8jxIikR xMJblm9Fdf77V357RIgY2UTYk4lSM5/3uXH11+U/46kgZbFkNtrJTt0o721Jr83gYUi0Gq 62H1kPkWV0cWYIQu5cXnCsfNGh4uBaPISWblBzrySkoUnBUk6s0vcIt7t8t4eqgTooRh6l eOiSoEbZYghsYLqg/WL2WXejsHMwrMri88zfO62lXL66Cqig+jjGd4SQL71u3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735662728; 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=vFy0NgjfWf3TndN5PwfVPXdqR4uNu9pgiMDeKBnerAM=; b=eec5HSSv0CnHWBT7mgVdo8PjG9toRtPXw7FsaagqzKJ2updN58WoAAyCse9V8x8DKbrKZD 0gcJBk1iG7Dl/NdEOjf125B6eh7X/4ppjm0/EZwahsB3cr0eB/LTL8GcCiDxt5B1yYqKuT 6OgTYiJ7TfBInXjld5Wmf9mjiXhaedZZsz6SxGU1vuiT7NdtTn0woN3AVXAVXsdBzyziwO kaRMzJeLhmWufgyWup1FzcUauaaEHrQFwfc6aEH6gSu093VxzOIE0NRMkX0SZVb/sMr4Jl 1bUbJCgCmgBDChtb/RwQa5e+LCFyLKIOvObUDQk3Dy2NKN0QryvzAwpVFGcwfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735662728; a=rsa-sha256; cv=none; b=OaRc2Ny5wepcaoak+/3qUWjeO6TkCBgR6UhdMQF4LV+MZu6NcAuHG4xkEpSowJ9ArdQOLn KdD/GtuCcYMIFIEZlHegERVAYDK83w1AKC7CYkUPcu5HDZ+6H+NHSGtA1rOkspdhZtHAtd bOBxBXXdV5x/tDLyEJ7HtiQ0XDLwvtn/79LxXcNNsFhZBb/dBiFfB2wDyWvep6ah7wcPnX YsoWMwU+gh0xkPaR5/2w0tiGykQOUijo4yad7bG8ZVnP69ZzP3OXNYNMDJlTq2dF1jo8Be LuH7nGSBm78iKGUmrzQRuCHSoKHvlryP3K8BVHz9RoEZavrlbxlvPMH12iWFjg== 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 4YMz5N1nMvzn4D; Tue, 31 Dec 2024 16:32:08 +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 4BVGW8db059831; Tue, 31 Dec 2024 16:32:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BVGW83Y059828; Tue, 31 Dec 2024 16:32:08 GMT (envelope-from git) Date: Tue, 31 Dec 2024 16:32:08 GMT Message-Id: <202412311632.4BVGW83Y059828@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: b47dcb4b1ff1 - main - TCP BBR: fix getsockopt() for TCP_BBR_USEDEL_RATE 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: b47dcb4b1ff16e6af2e07798f6fe06580b4eddf0 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b47dcb4b1ff16e6af2e07798f6fe06580b4eddf0 commit b47dcb4b1ff16e6af2e07798f6fe06580b4eddf0 Author: Michael Tuexen AuthorDate: 2024-12-31 16:29:04 +0000 Commit: Michael Tuexen CommitDate: 2024-12-31 16:29:04 +0000 TCP BBR: fix getsockopt() for TCP_BBR_USEDEL_RATE Actually implement the IPPROTO_TCP-level socket option TCP_BBR_USEDEL_RATE. Reviewed by: rrs CID: 1523813 CID: 1523814 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48261 --- sys/netinet/tcp_stacks/bbr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 24c3685f139a..f440573ace30 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -14587,6 +14587,7 @@ bbr_get_sockopt(struct tcpcb *tp, struct sockopt *sopt) { struct inpcb *inp = tptoinpcb(tp); struct tcp_bbr *bbr; + uint64_t loptval; int32_t error, optval; bbr = (struct tcp_bbr *)tp->t_fb_ptr; @@ -14647,7 +14648,7 @@ bbr_get_sockopt(struct tcpcb *tp, struct sockopt *sopt) optval = bbr->rc_loss_exit; break; case TCP_BBR_USEDEL_RATE: - error = EINVAL; + loptval = get_filter_value(&bbr->r_ctl.rc_delrate); break; case TCP_BBR_MIN_RTO: optval = bbr->r_ctl.rc_min_rto_ms; @@ -14731,7 +14732,10 @@ bbr_get_sockopt(struct tcpcb *tp, struct sockopt *sopt) break; } INP_WUNLOCK(inp); - error = sooptcopyout(sopt, &optval, sizeof optval); + if (sopt->sopt_name == TCP_BBR_USEDEL_RATE) + error = sooptcopyout(sopt, &loptval, sizeof loptval); + else + error = sooptcopyout(sopt, &optval, sizeof optval); return (error); }