summaryrefslogtreecommitdiff
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2017-02-05 16:04:15 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2017-02-05 16:04:15 +0000
commita0fe76973a89628bbcd7a93577076e67e111a4a4 (patch)
tree627e4d024b0b67aff06231ec1d2f58ae6f4b8a80 /sys/netinet6/icmp6.c
parentdaf9ee77f00685cfb1100181f3ecec6af00c6ee1 (diff)
Use percpu counters for ip6stat
Try to follow the existing examples. Some notes: - don't implement counters_dec() yet, which could be used in two similar chunks of code. Let's see if there are more users first. - stop incrementing IPv6-specific mbuf stats, IPv4 has no equivalent. Input from mpi@, ok bluhm@ mpi@
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 5041109341c..d2e46d7c05d 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.198 2017/02/01 20:59:47 dhill Exp $ */
+/* $OpenBSD: icmp6.c,v 1.199 2017/02/05 16:04:14 jca Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1124,8 +1124,13 @@ icmp6_rip6_input(struct mbuf **mp, int off)
} else
sorwakeup(last->inp_socket);
} else {
+ struct counters_ref ref;
+ uint64_t *counters;
+
m_freem(m);
- ip6stat.ip6s_delivered--;
+ counters = counters_enter(&ref, ip6counters);
+ counters[ip6s_delivered]--;
+ counters_leave(&ref, ip6counters);
}
return IPPROTO_DONE;
}