summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UPDATING5
-rw-r--r--sys/netinet/tcp_timer.c33
-rw-r--r--sys/netinet/tcp_var.h5
-rw-r--r--sys/sys/param.h2
-rw-r--r--usr.bin/netstat/inet.c14
5 files changed, 29 insertions, 30 deletions
diff --git a/UPDATING b/UPDATING
index b50ab45fa1c5a..4bc987f7c4097 100644
--- a/UPDATING
+++ b/UPDATING
@@ -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
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 0687b718ec6a3..69e71241dd698 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -148,29 +148,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_detection,
&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.
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 2e2f88acbcbcb..48305788d0976 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -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 */
};
diff --git a/sys/sys/param.h b/sys/sys/param.h
index c1d8a6539a8cc..df5cfda47d51b 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -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,
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index f238a26c4a15d..d0c56006b0e34 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -752,12 +752,24 @@ tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
"{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");