From nobody Sun Jul 28 20:29:47 2024 X-Original-To: dev-commits-src-all@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 4WXClc0gH8z5RcFg; Sun, 28 Jul 2024 20:29:48 +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 4WXClb73Wvz4Dhj; Sun, 28 Jul 2024 20:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722198588; 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=Tro6EEGCjT6tXeFnW3SvkrXTBI1JVdz7z3ZHa8IxQjA=; b=mmVOvsk03CoP+Rbx/pDgSegJTkgqxhjAN8epKOet8k6qu/9dMtwVoGqdCqeQkDqGhX9rgg slsF9N01ngdP6M6IvSz8hiBV2N7QilG9fvsL4SR5gT20cb4ChmargT2+beS+uPeOYsXgHK XWj3jZ3cYfIwy8ty0TyDDt2jgKP79XxBdoIwTm3M6IcQcKABQvnVIEp+Zjew8ANPSYW/4p YhPgzhB9PmfM42tKURs22FFM0iDf4EWzSkfykWdJ8934MkVUQVQWwiqhYlsWY387zhqF5m 6tv/AXREit1UxdM4oYb3kHdyxuaRllnotNIPXyh62RhQzUsE+1EVi4ZbwP5glg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722198588; a=rsa-sha256; cv=none; b=uC/BIEPeqX7hXyzCBLTY017aTNzxpqepfQz8TgF4bnHbsRa+W/wDrukRGrP8behjD084Mz N30TzjbFTvGwCEfG+oBd0DP42MLtY57LvDBVnHHqVPaJ8NsGoZ7hpObiiiuuZ8+3Y5R0tn nP8Kcg2h0XMk+IsVxW7g+FV3KtaCRoxajcB88x/rdJkmWr/VOKvJ5klLZarhIINdb/VMu0 TdGd5+aBv5faidy5uJ3CzYHhWCjliUN5NB9hFdOTHBlu2m8XIOamZ+GogGV3s/HwllGt4s hZf1SN7c8xiFwaD6fBaUlUcvwHFXaNMHSoCsdzL2VTX+aFFMddMewDrKPkPO+w== 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=1722198588; 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=Tro6EEGCjT6tXeFnW3SvkrXTBI1JVdz7z3ZHa8IxQjA=; b=o7KfDsI1wtxh/yVGi9+LlpEY3p5rD9k8mPE3bS2AiNLL5PkyzJD7iG07dl8PiHvVXMicgI rdhcDInQwp5heEKVJw2ZD61XFHGM1inxYRmy0TmgOmD0QTPIY7vTMOrVUeWh9NKPOCrI3S UmRQkO5jsHOFtjJR6agt4ugXRJdcVTovm/FryHxiuNici4o50qZl+WRiL0+YftYhNTmhAY 5cIby22s98s/BxV928K1p8V+pUo9g7ADubrR3DPDOQLfBVZW5hV9pBVwROM199eOT8aVVE JDqPBv6ATW0FvuvES44cjMzfLnoAs8OAQchWcDyAZXU5U+s4hmX/2y91gGOQbA== 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 4WXClb6YZqz14Sy; Sun, 28 Jul 2024 20:29:47 +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 46SKTllV051237; Sun, 28 Jul 2024 20:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKTlKu051234; Sun, 28 Jul 2024 20:29:47 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:29:47 GMT Message-Id: <202407282029.46SKTlKu051234@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: 00d3b74406db - main - tcp cc: remove non-working sctp support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 00d3b74406db80084e8939450c6b86326dd1de30 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=00d3b74406db80084e8939450c6b86326dd1de30 commit 00d3b74406db80084e8939450c6b86326dd1de30 Author: Michael Tuexen AuthorDate: 2024-07-28 20:25:48 +0000 Commit: Michael Tuexen CommitDate: 2024-07-28 20:25:48 +0000 tcp cc: remove non-working sctp support As suggested by lstewart, remove the non-working SCTP support in the TCP congestion control modules. SCTP has a similar functionality (although not using kernel loadable modules), on which the TCP stuff was built on, but the integration was never done. No functional change intended. Reviewed by: Peter Lei, cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46142 --- sys/netinet/cc/cc.c | 8 ++++---- sys/netinet/cc/cc.h | 11 +---------- sys/netinet/cc/cc_cdg.c | 2 +- sys/netinet/cc/cc_chd.c | 2 +- sys/netinet/cc/cc_cubic.c | 12 ++++++------ sys/netinet/cc/cc_dctcp.c | 6 +++--- sys/netinet/cc/cc_htcp.c | 18 +++++++++--------- sys/netinet/cc/cc_module.h | 13 +------------ sys/netinet/cc/cc_newreno.c | 10 +++++----- sys/netinet/cc/cc_vegas.c | 2 +- sys/netinet/tcp_subr.c | 3 +-- sys/netinet/tcp_usrreq.c | 2 +- 12 files changed, 34 insertions(+), 55 deletions(-) diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index 9a8ca760fa28..16d27a868bd3 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -404,7 +404,7 @@ newreno_cc_post_recovery(struct cc_var *ccv) * XXXLAS: Find a way to do this without needing curack */ if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); else pipe = CCV(ccv, snd_max) - ccv->curack; if (pipe < CCV(ccv, snd_ssthresh)) @@ -440,7 +440,7 @@ newreno_cc_after_idle(struct cc_var *ccv) * maximum of the former ssthresh or 3/4 of the old cwnd, to * not exit slow-start prematurely. */ - rw = tcp_compute_initwnd(tcp_fixed_maxseg(ccv->ccvc.tcp)); + rw = tcp_compute_initwnd(tcp_fixed_maxseg(ccv->tp)); CCV(ccv, snd_ssthresh) = max(CCV(ccv, snd_ssthresh), CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2)); @@ -457,7 +457,7 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t cwin, factor, mss, pipe; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); /* * Other TCP congestion controls use newreno_cong_signal(), but * with their own private cc_data. Make sure the cc_data is used @@ -490,7 +490,7 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index aac0825e5fe1..63381f4b5ca3 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -87,21 +87,12 @@ int cc_deregister_algo(struct cc_algo *remove_cc); #endif /* _KERNEL */ #if defined(_KERNEL) || defined(_WANT_TCPCB) -/* - * Wrapper around transport structs that contain same-named congestion - * control variables. Allows algos to be shared amongst multiple CC aware - * transprots. - */ struct cc_var { void *cc_data; /* Per-connection private CC algorithm data. */ int bytes_this_ack; /* # bytes acked by the current ACK. */ tcp_seq curack; /* Most recent ACK. */ uint32_t flags; /* Flags for cc_var (see below) */ - int type; /* Indicates which ptr is valid in ccvc. */ - union ccv_container { - struct tcpcb *tcp; - struct sctp_nets *sctp; - } ccvc; + struct tcpcb *tp; /* Pointer to tcpcb */ uint16_t nsegs; /* # segments coalesced into current chain. */ uint8_t labc; /* Dont use system abc use passed in */ }; diff --git a/sys/netinet/cc/cc_cdg.c b/sys/netinet/cc/cc_cdg.c index 7ec9e8ca3ccc..997d9435870f 100644 --- a/sys/netinet/cc/cc_cdg.c +++ b/sys/netinet/cc/cc_cdg.c @@ -295,7 +295,7 @@ cdg_cb_init(struct cc_var *ccv, void *ptr) { struct cdg *cdg_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { cdg_data = malloc(sizeof(struct cdg), M_CC_MEM, M_NOWAIT); if (cdg_data == NULL) diff --git a/sys/netinet/cc/cc_chd.c b/sys/netinet/cc/cc_chd.c index 92fcf68c41f1..f48d1f0066e2 100644 --- a/sys/netinet/cc/cc_chd.c +++ b/sys/netinet/cc/cc_chd.c @@ -322,7 +322,7 @@ chd_cb_init(struct cc_var *ccv, void *ptr) { struct chd *chd_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { chd_data = malloc(sizeof(struct chd), M_CC_MEM, M_NOWAIT); if (chd_data == NULL) diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index 5141de86ef85..45f75efe5ae7 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -125,7 +125,7 @@ cubic_log_hystart_event(struct cc_var *ccv, struct cubic *cubicd, uint8_t mod, u if (hystart_bblogs == 0) return; - tp = ccv->ccvc.tcp; + tp = ccv->tp; if (tcp_bblogging_on(tp)) { union tcp_log_stackspecific log; struct timeval tv; @@ -385,7 +385,7 @@ cubic_cb_init(struct cc_var *ccv, void *ptr) { struct cubic *cubic_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { cubic_data = malloc(sizeof(struct cubic), M_CC_MEM, M_NOWAIT|M_ZERO); if (cubic_data == NULL) @@ -424,7 +424,7 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t mss, pipe; cubic_data = ccv->cc_data; - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); switch (type) { case CC_NDUPACK: @@ -478,7 +478,7 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) cubic_data->undo_W_max = cubic_data->W_max; cubic_data->undo_K = cubic_data->K; if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + @@ -549,7 +549,7 @@ cubic_post_recovery(struct cc_var *ccv) * XXXLAS: Find a way to do this without needing curack */ if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); else pipe = CCV(ccv, snd_max) - ccv->curack; @@ -590,7 +590,7 @@ cubic_record_rtt(struct cc_var *ccv) /* Ignore srtt until a min number of samples have been taken. */ if (CCV(ccv, t_rttupdated) >= CUBIC_MIN_RTT_SAMPLES) { cubic_data = ccv->cc_data; - t_srtt_usecs = tcp_get_srtt(ccv->ccvc.tcp, + t_srtt_usecs = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_USEC); /* * Record the current SRTT as our minrtt if it's the smallest diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c index 374db98c5e60..06b2de11fd46 100644 --- a/sys/netinet/cc/cc_dctcp.c +++ b/sys/netinet/cc/cc_dctcp.c @@ -201,7 +201,7 @@ dctcp_cb_init(struct cc_var *ccv, void *ptr) { struct dctcp *dctcp_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { dctcp_data = malloc(sizeof(struct dctcp), M_CC_MEM, M_NOWAIT|M_ZERO); if (dctcp_data == NULL) @@ -245,7 +245,7 @@ dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type) if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); switch (type) { case CC_NDUPACK: @@ -294,7 +294,7 @@ dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c index 41c552a3bfa0..49bf4d6142f1 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -253,7 +253,7 @@ htcp_cb_init(struct cc_var *ccv, void *ptr) { struct htcp *htcp_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { htcp_data = malloc(sizeof(struct htcp), M_CC_MEM, M_NOWAIT); if (htcp_data == NULL) @@ -284,7 +284,7 @@ htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t mss, pipe; htcp_data = ccv->cc_data; - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); switch (type) { case CC_NDUPACK: @@ -325,7 +325,7 @@ htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + @@ -383,7 +383,7 @@ htcp_post_recovery(struct cc_var *ccv) * XXXLAS: Find a way to do this without needing curack */ if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); else pipe = CCV(ccv, snd_max) - ccv->curack; @@ -451,7 +451,7 @@ htcp_recalc_alpha(struct cc_var *ccv) */ if (V_htcp_rtt_scaling) alpha = max(1, (min(max(HTCP_MINROWE, - (tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS) << HTCP_SHIFT) / + (tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) << HTCP_SHIFT) / htcp_rtt_ref), HTCP_MAXROWE) * alpha) >> HTCP_SHIFT); @@ -502,18 +502,18 @@ htcp_record_rtt(struct cc_var *ccv) * or minrtt is currently equal to its initialised value. Ignore SRTT * until a min number of samples have been taken. */ - if ((tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS) < htcp_data->minrtt || + if ((tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) < htcp_data->minrtt || htcp_data->minrtt == TCPTV_SRTTBASE) && (CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES)) - htcp_data->minrtt = tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS); + htcp_data->minrtt = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS); /* * Record the current SRTT as our maxrtt if it's the largest we've * seen. Ignore SRTT until a min number of samples have been taken. */ - if (tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS) > htcp_data->maxrtt + if (tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) > htcp_data->maxrtt && CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES) - htcp_data->maxrtt = tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS); + htcp_data->maxrtt = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS); } /* diff --git a/sys/netinet/cc/cc_module.h b/sys/netinet/cc/cc_module.h index e01d7a124ad4..606b2b66e7e5 100644 --- a/sys/netinet/cc/cc_module.h +++ b/sys/netinet/cc/cc_module.h @@ -43,18 +43,7 @@ #ifndef _NETINET_CC_MODULE_H_ #define _NETINET_CC_MODULE_H_ -/* - * Allows a CC algorithm to manipulate a commonly named CC variable regardless - * of the transport protocol and associated C struct. - * XXXLAS: Out of action until the work to support SCTP is done. - * -#define CCV(ccv, what) \ -(*( \ - (ccv)->type == IPPROTO_TCP ? &(ccv)->ccvc.tcp->what : \ - &(ccv)->ccvc.sctp->what \ -)) - */ -#define CCV(ccv, what) (ccv)->ccvc.tcp->what +#define CCV(ccv, what) (ccv)->tp->what #define DECLARE_CC_MODULE(ccname, ccalgo) \ static moduledata_t cc_##ccname = { \ diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index aa20e2c64f7d..56adb2d17601 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -135,7 +135,7 @@ newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod if (hystart_bblogs == 0) return; - tp = ccv->ccvc.tcp; + tp = ccv->tp; if (tcp_bblogging_on(tp)) { union tcp_log_stackspecific log; struct timeval tv; @@ -175,7 +175,7 @@ newreno_cb_init(struct cc_var *ccv, void *ptr) { struct newreno *nreno; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { ccv->cc_data = malloc(sizeof(struct newreno), M_CC_MEM, M_NOWAIT); if (ccv->cc_data == NULL) @@ -369,7 +369,7 @@ newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t beta, beta_ecn, cwin, factor, mss, pipe; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); nreno = ccv->cc_data; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta;; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; @@ -429,7 +429,7 @@ newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + @@ -456,7 +456,7 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) if (sopt->sopt_valsize != sizeof(struct cc_newreno_opts)) return (EMSGSIZE); - if (CC_ALGO(ccv->ccvc.tcp) != &newreno_cc_algo) + if (CC_ALGO(ccv->tp) != &newreno_cc_algo) return (ENOPROTOOPT); nreno = (struct newreno *)ccv->cc_data; diff --git a/sys/netinet/cc/cc_vegas.c b/sys/netinet/cc/cc_vegas.c index ecd42c1a0f53..45d6b646bcba 100644 --- a/sys/netinet/cc/cc_vegas.c +++ b/sys/netinet/cc/cc_vegas.c @@ -184,7 +184,7 @@ vegas_cb_init(struct cc_var *ccv, void *ptr) { struct vegas *vegas_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { vegas_data = malloc(sizeof(struct vegas), M_CC_MEM, M_NOWAIT); if (vegas_data == NULL) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 0665564955d2..cc9020f89a3a 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2243,8 +2243,7 @@ tcp_newtcpcb(struct inpcb *inp, struct tcpcb *listening_tcb) bzero(&tp->t_start_zero, t_zero_size); /* Initialise cc_var struct for this tcpcb. */ - tp->t_ccv.type = IPPROTO_TCP; - tp->t_ccv.ccvc.tcp = tp; + tp->t_ccv.tp = tp; rw_rlock(&tcp_function_lock); if (listening_tcb != NULL) { INP_LOCK_ASSERT(tptoinpcb(listening_tcb)); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index c43e4523f358..2ff7737a573b 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1957,7 +1957,7 @@ no_mem_needed: tp = intotcpcb(inp); if (ptr != NULL) memset(ptr, 0, mem_sz); - cc_mem.ccvc.tcp = tp; + cc_mem.tp = tp; /* * We once again hold a write lock over the tcb so it's * safe to do these things without ordering concerns.