diff options
author | Andrey V. Elsukov <ae@FreeBSD.org> | 2013-07-09 09:50:15 +0000 |
---|---|---|
committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2013-07-09 09:50:15 +0000 |
commit | 5b7cb97c2b6f73e3a9fdc9e7e3d8771e29be9889 (patch) | |
tree | ef65cdea87ebd2ddc7dce18e0f6bd4aa6c63c183 /sys/netinet/udp_var.h | |
parent | 5da0521fcea9b7bf34635529187eddf4cfca1cba (diff) | |
download | src-5b7cb97c2b6f73e3a9fdc9e7e3d8771e29be9889.tar.gz src-5b7cb97c2b6f73e3a9fdc9e7e3d8771e29be9889.zip |
Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU
counters.
Notes
Notes:
svn path=/head/; revision=253084
Diffstat (limited to 'sys/netinet/udp_var.h')
-rw-r--r-- | sys/netinet/udp_var.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index 53bbf1efa0b9..0c26b88cd436 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -94,19 +94,23 @@ struct udpstat { }; #ifdef _KERNEL +#include <sys/counter.h> + +VNET_PCPUSTAT_DECLARE(struct udpstat, udpstat); /* * In-kernel consumers can use these accessor macros directly to update * stats. */ -#define UDPSTAT_ADD(name, val) V_udpstat.name += (val) +#define UDPSTAT_ADD(name, val) \ + VNET_PCPUSTAT_ADD(struct udpstat, udpstat, name, (val)) #define UDPSTAT_INC(name) UDPSTAT_ADD(name, 1) /* * Kernel module consumers must use this accessor macro. */ void kmod_udpstat_inc(int statnum); -#define KMOD_UDPSTAT_INC(name) \ - kmod_udpstat_inc(offsetof(struct udpstat, name) / sizeof(u_long)) +#define KMOD_UDPSTAT_INC(name) \ + kmod_udpstat_inc(offsetof(struct udpstat, name) / sizeof(uint64_t)) #endif /* @@ -140,10 +144,8 @@ VNET_DECLARE(struct inpcbinfo, udbinfo); extern u_long udp_sendspace; extern u_long udp_recvspace; VNET_DECLARE(int, udp_cksum); -VNET_DECLARE(struct udpstat, udpstat); VNET_DECLARE(int, udp_blackhole); #define V_udp_cksum VNET(udp_cksum) -#define V_udpstat VNET(udpstat) #define V_udp_blackhole VNET(udp_blackhole) extern int udp_log_in_vain; |