summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2016-05-17 23:14:17 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2016-05-17 23:14:17 +0000
commitf59d975e10cc6ca8fd14384de61758bf41654617 (patch)
tree5424b473dec1e0597c6604b5e62562a8cbf18042
parent0ac974ec78f39a1aac05628c736310802314f2f2 (diff)
Notes
-rw-r--r--sys/netinet/tcp_input.c4
-rw-r--r--sys/netinet/tcp_subr.c4
-rw-r--r--sys/netinet/tcp_var.h5
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index cd400f5d896b..330d3059af03 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -250,7 +250,7 @@ static void
tcp_vnet_init(const void *unused)
{
- COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK);
+ COUNTER_ARRAY_ALLOC(V_tcps_states, TCP_NSTATES, M_WAITOK);
VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK);
}
VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
@@ -261,7 +261,7 @@ static void
tcp_vnet_uninit(const void *unused)
{
- COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES);
+ COUNTER_ARRAY_FREE(V_tcps_states, TCP_NSTATES);
VNET_PCPUSTAT_FREE(tcpstat);
}
VNET_SYSUNINIT(tcp_vnet_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 64d71244ffa1..03526df6dc6b 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1642,7 +1642,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
*/
if (req->oldptr == NULL) {
n = V_tcbinfo.ipi_count +
- counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]);
+ counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]);
n += imax(n / 8, 10);
req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb);
return (0);
@@ -1659,7 +1659,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
n = V_tcbinfo.ipi_count;
INP_LIST_RUNLOCK(&V_tcbinfo);
- m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]);
+ m = counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]);
error = sysctl_wire_old_buffer(req, 2 * (sizeof xig)
+ (n + m) * sizeof(struct xtcpcb));
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 3540b2511c1b..2bbd5e348108 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -629,8 +629,9 @@ void kmod_tcpstat_inc(int statnum);
* Running TCP connection count by state.
*/
VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]);
-#define TCPSTATES_INC(state) counter_u64_add(VNET(tcps_states)[state], 1)
-#define TCPSTATES_DEC(state) counter_u64_add(VNET(tcps_states)[state], -1)
+#define V_tcps_states VNET(tcps_states)
+#define TCPSTATES_INC(state) counter_u64_add(V_tcps_states[state], 1)
+#define TCPSTATES_DEC(state) counter_u64_add(V_tcps_states[state], -1)
/*
* TCP specific helper hook point identifiers.