git: b59753f1d55d - main - tcp: provide a useful comment for struct tcpstat
Date: Tue, 17 Jun 2025 16:53:56 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=b59753f1d55da6c6d4b73252444212e6895ce913
commit b59753f1d55da6c6d4b73252444212e6895ce913
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-06-17 16:46:41 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-06-17 16:52:51 +0000
tcp: provide a useful comment for struct tcpstat
---
sys/netinet/tcp_var.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index d8822c40b17e..da4094b8ea4c 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -927,9 +927,12 @@ struct in_conninfo;
+ (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
/*
- * TCP statistics.
- * Many of these should be kept per connection,
- * but that's inconvenient at the moment.
+ * Global (per-VNET) TCP statistics. The below structure represents what we
+ * export to the userland, but in the kernel we have an array of counter_u64_t
+ * with as many elements as there are members in the structure. The counters
+ * shall be increased by TCPSTAT_INC() or KMOD_TCPSTAT_INC(). Adding new a
+ * new counter also requires adding corresponding SDT probes into in_kdtrace.h
+ * and into in_kdtrace.c.
*/
struct tcpstat {
uint64_t tcps_connattempt; /* connections initiated */