From owner-svn-src-stable-10@freebsd.org Sat Dec 29 00:30:18 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CF614276DF; Sat, 29 Dec 2018 00:30:18 +0000 (UTC) (envelope-from jhb@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) server-signature RSA-PSS (4096 bits) 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 3E02B72575; Sat, 29 Dec 2018 00:30:18 +0000 (UTC) (envelope-from jhb@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 31654279E; Sat, 29 Dec 2018 00:30:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBT0UIt2004022; Sat, 29 Dec 2018 00:30:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBT0UIV5004021; Sat, 29 Dec 2018 00:30:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812290030.wBT0UIV5004021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 29 Dec 2018 00:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342583 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 342583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E02B72575 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 00:30:18 -0000 Author: jhb Date: Sat Dec 29 00:30:17 2018 New Revision: 342583 URL: https://svnweb.freebsd.org/changeset/base/342583 Log: MFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module. r254889 added tcp_state_change() as a centralized place to log state changes in TCP connections for DTrace. r294869 and r296881 took advantage of this central location to manage per-state counters. However, TOE sockets were still performing some (but not all) state change updates via direct assignments to t_state. This resulted in state counters underflowing when TOE was in use. Fix by using tcp_state_change() when changing a TOE connection's state. Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:06:41 2018 (r342582) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:30:17 2018 (r342583) @@ -310,7 +310,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn CTR4(KTR_CXGBE, "%s: tid %d, toep %p, inp %p", __func__, toep->tid, toep, inp); - tp->t_state = TCPS_ESTABLISHED; + tcp_state_change(tp, TCPS_ESTABLISHED); tp->t_starttime = ticks; TCPSTAT_INC(tcps_connects); @@ -1138,11 +1138,11 @@ do_peer_close(struct sge_iq *iq, const struct rss_head /* FALLTHROUGH */ case TCPS_ESTABLISHED: - tp->t_state = TCPS_CLOSE_WAIT; + tcp_state_change(tp, TCPS_CLOSE_WAIT); break; case TCPS_FIN_WAIT_1: - tp->t_state = TCPS_CLOSING; + tcp_state_change(tp, TCPS_CLOSING); break; case TCPS_FIN_WAIT_2: @@ -1223,7 +1223,7 @@ release: case TCPS_FIN_WAIT_1: if (so->so_rcv.sb_state & SBS_CANTRCVMORE) soisdisconnected(so); - tp->t_state = TCPS_FIN_WAIT_2; + tcp_state_change(tp, TCPS_FIN_WAIT_2); break; default: