aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-04-12 14:19:37 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-04-12 14:19:37 +0000
commit6bf65bcf3a2675269efe132f3509e5d22fd427fd (patch)
treeeda977c8d4349ac38aff7da03ac2d3ec50cc1564 /sys/netinet/ip_carp.h
parent07cf7ab29c116fa36a27b3c3a1406e46ca5e26e3 (diff)
downloadsrc-6bf65bcf3a2675269efe132f3509e5d22fd427fd.tar.gz
src-6bf65bcf3a2675269efe132f3509e5d22fd427fd.zip
Update stats in struct carpstats using two new macros: CARPSTATS_ADD()
and CARPSTATS_INC(), rather than directly manipulating the fields of the structure. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structure. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=190968
Diffstat (limited to 'sys/netinet/ip_carp.h')
-rw-r--r--sys/netinet/ip_carp.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h
index 2dd954453e0b..47bb494fc9f1 100644
--- a/sys/netinet/ip_carp.h
+++ b/sys/netinet/ip_carp.h
@@ -117,6 +117,11 @@ struct carpstats {
uint64_t carps_preempt; /* if enabled, preemptions */
};
+#ifdef _KERNEL
+#define CARPSTATS_ADD(name, val) carpstats.name += (val)
+#define CARPSTATS_INC(name) CARPSTATS_ADD(name, 1)
+#endif
+
/*
* Configuration structure for SIOCSVH SIOCGVH
*/