From owner-svn-src-stable@freebsd.org Thu Sep 10 13:27:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48EBD3D726E; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKSp1DwFz41D3; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F2C01391B; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ADRrRO075320; Thu, 10 Sep 2020 13:27:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADRr88075318; Thu, 10 Sep 2020 13:27:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101327.08ADRr88075318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365572 - in stable/12/sys/netinet: . cc X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . cc X-SVN-Commit-Revision: 365572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 13:27:54 -0000 Author: tuexen Date: Thu Sep 10 13:27:53 2020 New Revision: 365572 URL: https://svnweb.freebsd.org/changeset/base/365572 Log: MFC r356235: Fix delayed ACK generation for DCTCP. Manually changed to use TF_ECN_SND_ECE. Modified: stable/12/sys/netinet/cc/cc_dctcp.c stable/12/sys/netinet/tcp_input.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 13:17:23 2020 (r365571) +++ stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 13:27:53 2020 (r365572) @@ -272,9 +272,9 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->bytes_total = 0; dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); } else - CCV(ccv, snd_ssthresh) = + CCV(ccv, snd_ssthresh) = max((cwin - (((uint64_t)cwin * - dctcp_data->alpha) >> (DCTCP_SHIFT+1))), + dctcp_data->alpha) >> (DCTCP_SHIFT+1))), 2 * mss); CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); @@ -316,46 +316,43 @@ dctcp_post_recovery(struct cc_var *ccv) } /* - * Execute an additional ECN processing using ECN field in IP header and the CWR - * bit in TCP header. - * - * delay_ack == 0 - Delayed ACK disabled - * delay_ack == 1 - Delayed ACK enabled + * Execute an additional ECN processing using ECN field in IP header + * and the CWR bit in TCP header. */ - static void dctcp_ecnpkt_handler(struct cc_var *ccv) { struct dctcp *dctcp_data; uint32_t ccflag; - int delay_ack; + int acknow; dctcp_data = ccv->cc_data; ccflag = ccv->flags; - delay_ack = 1; + acknow = 0; /* * DCTCP responds with an ACK immediately when the CE state * in between this segment and the last segment has changed. */ if (ccflag & CCF_IPHDR_CE) { - if (!dctcp_data->ce_prev && (ccflag & CCF_DELACK)) - delay_ack = 0; - dctcp_data->ce_prev = 1; - CCV(ccv, t_flags) |= TF_ECN_SND_ECE; + if (!dctcp_data->ce_prev) { + acknow = 1; + dctcp_data->ce_prev = 1; + CCV(ccv, t_flags2) |= TF_ECN_SND_ECE; + } } else { - if (dctcp_data->ce_prev && (ccflag & CCF_DELACK)) - delay_ack = 0; - dctcp_data->ce_prev = 0; - CCV(ccv, t_flags) &= ~TF_ECN_SND_ECE; + if (dctcp_data->ce_prev) { + acknow = 1; + dctcp_data->ce_prev = 0; + CCV(ccv, t_flags2) &= ~TF_ECN_SND_ECE; + } } - /* DCTCP sets delayed ack when this segment sets the CWR flag. */ - if ((ccflag & CCF_DELACK) && (ccflag & CCF_TCPHDR_CWR)) - delay_ack = 1; - - if (delay_ack == 0) + if ((acknow) || (ccflag & CCF_TCPHDR_CWR)) { ccv->flags |= CCF_ACKNOW; + } else { + ccv->flags &= ~CCF_ACKNOW; + } } /* Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:17:23 2020 (r365571) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:27:53 2020 (r365572) @@ -516,15 +516,12 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, else tp->ccv->flags &= ~CCF_TCPHDR_CWR; - if (tp->t_flags & TF_DELACK) - tp->ccv->flags |= CCF_DELACK; - else - tp->ccv->flags &= ~CCF_DELACK; - CC_ALGO(tp)->ecnpkt_handler(tp->ccv); - if (tp->ccv->flags & CCF_ACKNOW) + if (tp->ccv->flags & CCF_ACKNOW) { tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); + tp->t_flags |= TF_ACKNOW; + } } }