diff options
author | ae <ae@FreeBSD.org> | 2013-07-09 09:50:15 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2013-07-09 09:50:15 +0000 |
commit | 705a50a05300cbec6176269dfe8b9e5ae0b12dab (patch) | |
tree | ef65cdea87ebd2ddc7dce18e0f6bd4aa6c63c183 /sys/netinet/udp_usrreq.c | |
parent | 1b1e1de2b2e27f692afabbf18eee1f7a70caa049 (diff) | |
download | FreeBSD-src-705a50a05300cbec6176269dfe8b9e5ae0b12dab.zip FreeBSD-src-705a50a05300cbec6176269dfe8b9e5ae0b12dab.tar.gz |
Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU
counters.
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 6bc94c3..982a2db 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -143,11 +143,14 @@ static VNET_DEFINE(uma_zone_t, udpcb_zone); #define UDBHASHSIZE 128 #endif -VNET_DEFINE(struct udpstat, udpstat); /* from udp_var.h */ -SYSCTL_VNET_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RW, - &VNET_NAME(udpstat), udpstat, - "UDP statistics (struct udpstat, netinet/udp_var.h)"); +VNET_PCPUSTAT_DEFINE(struct udpstat, udpstat); /* from udp_var.h */ +VNET_PCPUSTAT_SYSINIT(udpstat); +SYSCTL_VNET_PCPUSTAT(_net_inet_udp, UDPCTL_STATS, stats, struct udpstat, + udpstat, "UDP statistics (struct udpstat, netinet/udp_var.h)"); +#ifdef VIMAGE +VNET_PCPUSTAT_SYSUNINIT(udpstat); +#endif /* VIMAGE */ #ifdef INET static void udp_detach(struct socket *so); static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, @@ -207,7 +210,7 @@ void kmod_udpstat_inc(int statnum) { - (*((u_long *)&V_udpstat + statnum))++; + counter_u64_add(VNET(udpstat)[statnum], 1); } int |