diff options
author | mvs <mvs@cvs.openbsd.org> | 2021-07-26 23:17:08 +0000 |
---|---|---|
committer | mvs <mvs@cvs.openbsd.org> | 2021-07-26 23:17:08 +0000 |
commit | 992fe9af703c5564c9f83ee7e939673145a45aaa (patch) | |
tree | ef271638f1ab48a04694b8a44d2df4c9f064e8c5 /sys/net | |
parent | 4b4cf25d280a472b26e5864ff099161a4c4dc237 (diff) |
Use per-CPU counters for tunnel descriptor block (tdb) statistics.
'tdb_data' struct became unused and was removed.
ok bluhm@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pfkeyv2_convert.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c index 547f3257ba2..d0faf91f6e6 100644 --- a/sys/net/pfkeyv2_convert.c +++ b/sys/net/pfkeyv2_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_convert.c,v 1.72 2021/07/14 22:39:26 tobhe Exp $ */ +/* $OpenBSD: pfkeyv2_convert.c,v 1.73 2021/07/26 23:17:06 mvs Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@keromytis.org) * @@ -960,18 +960,21 @@ export_satype(void **p, struct tdb *tdb) void export_counter(void **p, struct tdb *tdb) { + uint64_t counters[tdb_ncounters]; struct sadb_x_counter *scnt = (struct sadb_x_counter *)*p; + counters_read(tdb->tdb_counters, counters, tdb_ncounters); + scnt->sadb_x_counter_len = sizeof(struct sadb_x_counter) / sizeof(uint64_t); scnt->sadb_x_counter_pad = 0; - scnt->sadb_x_counter_ipackets = tdb->tdb_ipackets; - scnt->sadb_x_counter_opackets = tdb->tdb_opackets; - scnt->sadb_x_counter_ibytes = tdb->tdb_ibytes; - scnt->sadb_x_counter_obytes = tdb->tdb_obytes; - scnt->sadb_x_counter_idrops = tdb->tdb_idrops; - scnt->sadb_x_counter_odrops = tdb->tdb_odrops; - scnt->sadb_x_counter_idecompbytes = tdb->tdb_idecompbytes; - scnt->sadb_x_counter_ouncompbytes = tdb->tdb_ouncompbytes; + scnt->sadb_x_counter_ipackets = counters[tdb_ipackets]; + scnt->sadb_x_counter_opackets = counters[tdb_opackets]; + scnt->sadb_x_counter_ibytes = counters[tdb_ibytes]; + scnt->sadb_x_counter_obytes = counters[tdb_obytes]; + scnt->sadb_x_counter_idrops = counters[tdb_idrops]; + scnt->sadb_x_counter_odrops = counters[tdb_odrops]; + scnt->sadb_x_counter_idecompbytes = counters[tdb_idecompbytes]; + scnt->sadb_x_counter_ouncompbytes = counters[tdb_ouncompbytes]; *p += sizeof(struct sadb_x_counter); } |