Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2017 19:41:38 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322900 - in head: . sys/netinet sys/sys usr.bin/netstat
Message-ID:  <201708251941.v7PJfcI5040915@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Fri Aug 25 19:41:38 2017
New Revision: 322900
URL: https://svnweb.freebsd.org/changeset/base/322900

Log:
  Use counter(9) for PLPMTUD counters.
  
  Remove unused PLPMTUD sysctl counters.
  
  Bump UPDATING and FreeBSD Version to indicate a rebuild is required.
  
  Submitted by:	kevin.bowling@kev009.com
  Reviewed by:	jtl
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D12003

Modified:
  head/UPDATING
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/tcp_var.h
  head/sys/sys/param.h
  head/usr.bin/netstat/inet.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Aug 25 19:06:36 2017	(r322899)
+++ head/UPDATING	Fri Aug 25 19:41:38 2017	(r322900)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ****************************** SPECIAL WARNING: ******************************
 
+20170825:
+	Move PMTUD blackhole counters to TCPSTATS and remove them from bare
+	sysctl values.  Minor nit, but requires a rebuild of both world/kernel
+	to complete.
+
 20170814:
 	"make check" behavior (made in ^/head@r295380) has been changed to
 	execute from a limited sandbox, as opposed to executing from

Modified: head/sys/netinet/tcp_timer.c
==============================================================================
--- head/sys/netinet/tcp_timer.c	Fri Aug 25 19:06:36 2017	(r322899)
+++ head/sys/netinet/tcp_timer.c	Fri Aug 25 19:41:38 2017	(r322900)
@@ -148,29 +148,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_de
     &VNET_NAME(tcp_pmtud_blackhole_detect), 0,
     "Path MTU Discovery Black Hole Detection Enabled");
 
-static VNET_DEFINE(int, tcp_pmtud_blackhole_activated);
-#define	V_tcp_pmtud_blackhole_activated \
-    VNET(tcp_pmtud_blackhole_activated)
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated,
-    CTLFLAG_RD|CTLFLAG_VNET,
-    &VNET_NAME(tcp_pmtud_blackhole_activated), 0,
-    "Path MTU Discovery Black Hole Detection, Activation Count");
-
-static VNET_DEFINE(int, tcp_pmtud_blackhole_activated_min_mss);
-#define	V_tcp_pmtud_blackhole_activated_min_mss \
-    VNET(tcp_pmtud_blackhole_activated_min_mss)
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated_min_mss,
-    CTLFLAG_RD|CTLFLAG_VNET,
-    &VNET_NAME(tcp_pmtud_blackhole_activated_min_mss), 0,
-    "Path MTU Discovery Black Hole Detection, Activation Count at min MSS");
-
-static VNET_DEFINE(int, tcp_pmtud_blackhole_failed);
-#define	V_tcp_pmtud_blackhole_failed	VNET(tcp_pmtud_blackhole_failed)
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_failed,
-    CTLFLAG_RD|CTLFLAG_VNET,
-    &VNET_NAME(tcp_pmtud_blackhole_failed), 0,
-    "Path MTU Discovery Black Hole Detection, Failure Count");
-
 #ifdef INET
 static VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200;
 #define	V_tcp_pmtud_blackhole_mss	VNET(tcp_pmtud_blackhole_mss)
@@ -772,7 +749,7 @@ tcp_timer_rexmt(void * xtp)
 			    tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) {
 				/* Use the sysctl tuneable blackhole MSS. */
 				tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss;
-				V_tcp_pmtud_blackhole_activated++;
+				TCPSTAT_INC(tcps_pmtud_blackhole_activated);
 			} else if (isipv6) {
 				/* Use the default MSS. */
 				tp->t_maxseg = V_tcp_v6mssdflt;
@@ -781,7 +758,7 @@ tcp_timer_rexmt(void * xtp)
 				 * minmss.
 				 */
 				tp->t_flags2 &= ~TF2_PLPMTU_PMTUD;
-				V_tcp_pmtud_blackhole_activated_min_mss++;
+				TCPSTAT_INC(tcps_pmtud_blackhole_activated_min_mss);
 			}
 #endif
 #if defined(INET6) && defined(INET)
@@ -791,7 +768,7 @@ tcp_timer_rexmt(void * xtp)
 			if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) {
 				/* Use the sysctl tuneable blackhole MSS. */
 				tp->t_maxseg = V_tcp_pmtud_blackhole_mss;
-				V_tcp_pmtud_blackhole_activated++;
+				TCPSTAT_INC(tcps_pmtud_blackhole_activated);
 			} else {
 				/* Use the default MSS. */
 				tp->t_maxseg = V_tcp_mssdflt;
@@ -800,7 +777,7 @@ tcp_timer_rexmt(void * xtp)
 				 * minmss.
 				 */
 				tp->t_flags2 &= ~TF2_PLPMTU_PMTUD;
-				V_tcp_pmtud_blackhole_activated_min_mss++;
+				TCPSTAT_INC(tcps_pmtud_blackhole_activated_min_mss);
 			}
 #endif
 			/*
@@ -823,7 +800,7 @@ tcp_timer_rexmt(void * xtp)
 				tp->t_flags2 |= TF2_PLPMTU_PMTUD;
 				tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE;
 				tp->t_maxseg = tp->t_pmtud_saved_maxseg;
-				V_tcp_pmtud_blackhole_failed++;
+				TCPSTAT_INC(tcps_pmtud_blackhole_failed);
 				/*
 				 * Reset the slow-start flight size as it
 				 * may depend on the new MSS.

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Fri Aug 25 19:06:36 2017	(r322899)
+++ head/sys/netinet/tcp_var.h	Fri Aug 25 19:41:38 2017	(r322900)
@@ -580,6 +580,11 @@ struct	tcpstat {
 	uint64_t tcps_sig_err_sigopt;	/* No signature expected by socket */
 	uint64_t tcps_sig_err_nosigopt;	/* No signature provided by segment */
 
+	/* Path MTU Discovery Black Hole Detection related stats */
+	uint64_t tcps_pmtud_blackhole_activated;	 /* Black Hole Count */
+	uint64_t tcps_pmtud_blackhole_activated_min_mss; /* BH at min MSS Count */
+	uint64_t tcps_pmtud_blackhole_failed;		 /* Black Hole Failure Count */
+
 	uint64_t _pad[12];		/* 6 UTO, 6 TBD */
 };
 

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Fri Aug 25 19:06:36 2017	(r322899)
+++ head/sys/sys/param.h	Fri Aug 25 19:41:38 2017	(r322900)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200041	/* Master, propagated to newvers */
+#define __FreeBSD_version 1200042	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c	Fri Aug 25 19:06:36 2017	(r322899)
+++ head/usr.bin/netstat/inet.c	Fri Aug 25 19:41:38 2017	(r322900)
@@ -752,12 +752,24 @@ tcp_stats(u_long off, const char *name, int af1 __unus
 	    "{N:/time%s unexpected signature received}\n");
 	p(tcps_sig_err_nosigopt, "\t{:no-signature-provided/%ju} "
 	    "{N:/time%s no signature provided by segment}\n");
+
+	xo_close_container("tcp-signature");
+	xo_open_container("pmtud");
+
+	p(tcps_pmtud_blackhole_activated, "\t{:pmtud-activated/%ju} "
+	    "{N:/Path MTU discovery black hole detection activation%s}\n");
+	p(tcps_pmtud_blackhole_activated_min_mss,
+	    "\t{:pmtud-activated-min-mss/%ju} "
+	    "{N:/Path MTU discovery black hole detection min MSS activation%s}\n");
+	p(tcps_pmtud_blackhole_failed, "\t{:pmtud-failed/%ju} "
+	    "{N:/Path MTU discovery black hole detection failure%s}\n");
  #undef p
  #undef p1a
  #undef p2
  #undef p2a
  #undef p3
-	xo_close_container("tcp-signature");
+	xo_close_container("pmtud");
+
 
 	xo_open_container("TCP connection count by state");
 	xo_emit("{T:/TCP connection count by state}:\n");



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