From nobody Sat Aug 03 20:59:56 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 4Wbw7d1WFxz5T3V7; Sat, 03 Aug 2024 20:59:57 +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 4Wbw7d0t9Kz44nm; Sat, 3 Aug 2024 20:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722718797; 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=ayJEqj8EmbKSMPtZQm4bCQA0Po3r1qF4mNuGvuBPgj0=; b=A3KeP8U5pDZOLRX0nHvu1enVnHApAHTFQiy/3OgEzI5iRcy7Hr6VGlpZv6RgbokryR6iVa v60XOBD8LtGYwAN3FrqxfBvL3HRN7mkqzLSzOsAcZKjTSiBvt5ykMDKTUzw8ObawxBGWzB TkKyzFdyPSFM5h9KH3BDqe+v/5TuZjfyDjZKpoC4+DnrQ7nzxL6wxm8QORyb855NQOwL8Y JaG5zkFcLc9OAf1Z5+u26EvX9G6cuO5cV7bwQaPAyrmgzJ63apb437vVFZ0PEsrS9bPbRV IZ0W/sWfkcJ8CqXb5zOZ9djuB3EKxVvVKKpyjHqqkVzLHEJM0vWr03FrxfWPqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722718797; a=rsa-sha256; cv=none; b=NjeaLcZQsy9GqKATacy1MMwXsVByP1hHw87VEcPzK0m6uh4ZOIY7R6yTmvx3UeSyzycpOT g/2V/PYZZKhB2/B+4tJO4wxO3YdCpuhGiytsV8dQ5mvJvACNkOZD6NTOOPShbgaHgq1gW/ tBhhHpjZoYUYmkUaahtMcw2HobW9Q+2qrmQPcYCF5JKU3uzCGVDWfMRCO8xErq/B016R5d TapUNspNlSoc1H5OED8HGiXRqOdIdVcgtCIZyAYYJWnMBUFSBnnw67GwR/hh/MlX8zgiNs fgKspwFvwfJEtJGnEeCa60Dtpqvzavr/1/qGrqLGaUZGxSYuqkI0NZN2YfhWjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722718797; 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=ayJEqj8EmbKSMPtZQm4bCQA0Po3r1qF4mNuGvuBPgj0=; b=Oauiil+Znr9A63wJAejoeohQdyqqmgdbdduDobMhVih3hrQnluy+Beno0a/QDNCPPRAyo0 NBB9NBk+mLFrJ5TEIpWL3WRJY4EdWsOChzBidBQMWdkhCLSx6ePI6zSpEVo6hep9AVWz7m czwj/aqKFgK0Dr/J7Qp/WS/UksvW3OllgQdTGjOHkuBaOlNqWV7j+oECinj4ERwpbGqWnk vz0Rs6ihdPJetMzmxmzbnLJYrF4sDxdgjn/BjlfVvVu63Nt9nawfwE22lEncVxP5xH97CV 2BQQ72ctDCACUu6WO+afY2h+FDIxVxBR8Mz1tmqjdGNYB3fB33z0K+5TMzFQfQ== 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 4Wbw7d0Qq7zRfy; Sat, 3 Aug 2024 20:59:57 +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 473Kxu9r073327; Sat, 3 Aug 2024 20:59:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473Kxux2073324; Sat, 3 Aug 2024 20:59:56 GMT (envelope-from git) Date: Sat, 3 Aug 2024 20:59:56 GMT Message-Id: <202408032059.473Kxux2073324@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: d6fb9f8ca344 - main - tcp: inherit CC algorithm from listener 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: d6fb9f8ca344bfe47fc79d3ae81112a8bc036307 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d6fb9f8ca344bfe47fc79d3ae81112a8bc036307 commit d6fb9f8ca344bfe47fc79d3ae81112a8bc036307 Author: Michael Tuexen AuthorDate: 2024-08-03 20:56:39 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 20:56:39 +0000 tcp: inherit CC algorithm from listener Like any other parameter, the CC algorithm should be inherited from the listener. Reviewed by: cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46143 --- sys/netinet/tcp_subr.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 145496afa098..9e95a87b3596 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2259,11 +2259,20 @@ tcp_newtcpcb(struct inpcb *inp, struct tcpcb *listening_tcb) KASSERT((tp->t_fb->tfb_flags & TCP_FUNC_BEING_REMOVED) == 0, ("tcp_newtcpcb: using TFB being removed")); rw_runlock(&tcp_function_lock); - /* - * Use the current system default CC algorithm. - */ - cc_attach(tp, CC_DEFAULT_ALGO()); - + CC_LIST_RLOCK(); + if (listening_tcb != NULL) { + if (CC_ALGO(listening_tcb)->flags & CC_MODULE_BEING_REMOVED) { + CC_LIST_RUNLOCK(); + if (tp->t_fb->tfb_tcp_fb_fini) + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); + refcount_release(&tp->t_fb->tfb_refcnt); + return (NULL); + } + CC_ALGO(tp) = CC_ALGO(listening_tcb); + } else + CC_ALGO(tp) = CC_DEFAULT_ALGO(); + cc_refer(CC_ALGO(tp)); + CC_LIST_RUNLOCK(); if (CC_ALGO(tp)->cb_init != NULL) if (CC_ALGO(tp)->cb_init(&tp->t_ccv, NULL) > 0) { cc_detach(tp);