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/net | |
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/net')
-rw-r--r-- | sys/net/if_arp.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h index 3826d06..2dd8c32 100644 --- a/sys/net/if_arp.h +++ b/sys/net/if_arp.h @@ -127,13 +127,21 @@ struct arpstat { uint64_t dupips; /* # of duplicate IPs detected. */ }; +#ifdef _KERNEL +#include <sys/counter.h> +#include <net/vnet.h> + +VNET_PCPUSTAT_DECLARE(struct arpstat, arpstat); /* * In-kernel consumers can use these accessor macros directly to update * stats. */ -#define ARPSTAT_ADD(name, val) V_arpstat.name += (val) -#define ARPSTAT_SUB(name, val) V_arpstat.name -= (val) +#define ARPSTAT_ADD(name, val) \ + VNET_PCPUSTAT_ADD(struct arpstat, arpstat, name, (val)) +#define ARPSTAT_SUB(name, val) ARPSTAT_ADD(name, -(val)) #define ARPSTAT_INC(name) ARPSTAT_ADD(name, 1) #define ARPSTAT_DEC(name) ARPSTAT_SUB(name, 1) +#endif /* _KERNEL */ + #endif /* !_NET_IF_ARP_H_ */ |