Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Dec 2018 00:30:18 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
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
Message-ID:  <201812290030.wBT0UIV5004021@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812290030.wBT0UIV5004021>