summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.h
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2021-07-27 17:13:04 +0000
committermvs <mvs@cvs.openbsd.org>2021-07-27 17:13:04 +0000
commitc4833eae4681572e524deced2ab408c37395ba96 (patch)
treef81ad87853effe969e2f61ef3081418a58ef7ef6 /sys/netinet/ip_ipsp.h
parentd7737ec330a4c4f14111a59fc8ca7aadfc1d5de2 (diff)
Revert "Use per-CPU counters for tunnel descriptor block" diff.
Panic reported by Hrvoje Popovski.
Diffstat (limited to 'sys/netinet/ip_ipsp.h')
-rw-r--r--sys/netinet/ip_ipsp.h54
1 files changed, 21 insertions, 33 deletions
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index 4453d410292..5fc42aacc93 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.204 2021/07/26 23:17:07 mvs Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.205 2021/07/27 17:13:03 mvs Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -135,6 +135,17 @@ struct ipsecstat {
uint64_t ipsec_noxform; /* Crypto error */
};
+struct tdb_data {
+ uint64_t tdd_ipackets; /* Input IPsec packets */
+ uint64_t tdd_opackets; /* Output IPsec packets */
+ uint64_t tdd_ibytes; /* Input bytes */
+ uint64_t tdd_obytes; /* Output bytes */
+ uint64_t tdd_idrops; /* Dropped on input */
+ uint64_t tdd_odrops; /* Dropped on output */
+ uint64_t tdd_idecompbytes; /* Input bytes, decompressed */
+ uint64_t tdd_ouncompbytes; /* Output bytes, uncompressed */
+};
+
#ifdef _KERNEL
#include <sys/timeout.h>
@@ -358,8 +369,7 @@ struct tdb { /* tunnel descriptor block */
u_int64_t tdb_last_used; /* When was this SA last used */
u_int64_t tdb_last_marked;/* Last SKIPCRYPTO status change */
- struct cpumem *tdb_counters; /* stats about this TDB */
-
+ struct tdb_data tdb_data; /* stats about this TDB */
u_int64_t tdb_cryptoid; /* Crypto session ID */
u_int32_t tdb_spi; /* SPI */
@@ -405,37 +415,15 @@ struct tdb { /* tunnel descriptor block */
TAILQ_HEAD(tdb_policy_head, ipsec_policy) tdb_policy_head;
TAILQ_ENTRY(tdb) tdb_sync_entry;
};
+#define tdb_ipackets tdb_data.tdd_ipackets
+#define tdb_opackets tdb_data.tdd_opackets
+#define tdb_ibytes tdb_data.tdd_ibytes
+#define tdb_obytes tdb_data.tdd_obytes
+#define tdb_idrops tdb_data.tdd_idrops
+#define tdb_odrops tdb_data.tdd_odrops
+#define tdb_idecompbytes tdb_data.tdd_idecompbytes
+#define tdb_ouncompbytes tdb_data.tdd_ouncompbytes
-enum tdb_counters {
- tdb_ipackets, /* Input IPsec packets */
- tdb_opackets, /* Output IPsec packets */
- tdb_ibytes, /* Input bytes */
- tdb_obytes, /* Output bytes */
- tdb_idrops, /* Dropped on input */
- tdb_odrops, /* Dropped on output */
- tdb_idecompbytes, /* Input bytes, decompressed */
- tdb_ouncompbytes, /* Output bytes, uncompressed */
- tdb_ncounters
-};
-
-static inline void
-tdbstat_inc(struct tdb *tdb, enum tdb_counters c)
-{
- counters_inc(tdb->tdb_counters, c);
-}
-
-static inline void
-tdbstat_add(struct tdb *tdb, enum tdb_counters c, uint64_t v)
-{
- counters_add(tdb->tdb_counters, c, v);
-}
-
-static inline void
-tdbstat_pkt(struct tdb *tdb, enum tdb_counters pc, enum tdb_counters bc,
- uint64_t bytes)
-{
- counters_pkt(tdb->tdb_counters, pc, bc, bytes);
-}
struct tdb_ident {
u_int32_t spi;