diff options
author | Richard Scheffenegger <rscheff@FreeBSD.org> | 2021-03-31 17:30:20 +0000 |
---|---|---|
committer | Richard Scheffenegger <rscheff@FreeBSD.org> | 2021-04-16 19:43:14 +0000 |
commit | 632e3363087cb6ef2a7b26a291a044b97afabea7 (patch) | |
tree | 4ddd6737162aba7c377f2dbcf1b49fa30976e796 /sys/netinet/tcp_hostcache.h | |
parent | e610ebe5d351c0570101ec58f1642904a30051ae (diff) |
tcp: Make hostcache.cache_count MPSAFE by using a counter_u64_t
Addressing the underlying root cause for cache_count to
show unexpectedly high values, by protecting all arithmetic on
that global variable by using counter(9).
PR: 254333
Reviewed By: tuexen, #transport
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29510
(cherry picked from commit 95e56d31e348594973affd0ea81d8f8383bc3031)
Diffstat (limited to 'sys/netinet/tcp_hostcache.h')
-rw-r--r-- | sys/netinet/tcp_hostcache.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/netinet/tcp_hostcache.h b/sys/netinet/tcp_hostcache.h index f4e1013aac60..b5237392acc2 100644 --- a/sys/netinet/tcp_hostcache.h +++ b/sys/netinet/tcp_hostcache.h @@ -69,16 +69,16 @@ struct hc_metrics { }; struct tcp_hostcache { - struct hc_head *hashbase; - uma_zone_t zone; - u_int hashsize; - u_int hashmask; - u_int bucket_limit; - u_int cache_count; - u_int cache_limit; - int expire; - int prune; - int purgeall; + struct hc_head *hashbase; + uma_zone_t zone; + u_int hashsize; + u_int hashmask; + u_int bucket_limit; + counter_u64_t cache_count; + u_int cache_limit; + int expire; + int prune; + int purgeall; }; #endif /* !_NETINET_TCP_HOSTCACHE_H_*/ |