From 7e4ccd27cfdfbceb30ea07c53ad747f6dc5095fc Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 5 Apr 2023 21:51:48 +0000 Subject: ARP has a sysctl to show the number of packets waiting for an arp response. Implement analog sysctl net.inet6.icmp6.nd6_queued for ND6 to reduce places where mbufs can hide within the kernel. Atomic operations operate on unsigned int. Make the type of total hold queue length consistent. Use atomic load to read the value for the sysctl. This clarifies why no lock around sysctl_rdint() is needed. OK mvs@ kn@ --- sys/netinet/ip_input.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/netinet/ip_input.c') diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 07dde2897c5..42c1c72d78d 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.382 2023/03/08 23:17:02 bluhm Exp $ */ +/* $OpenBSD: ip_input.c,v 1.383 2023/04/05 21:51:47 bluhm Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -1698,7 +1698,8 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (sysctl_niq(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, &arpinq)); case IPCTL_ARPQUEUED: - return (sysctl_rdint(oldp, oldlenp, newp, la_hold_total)); + return (sysctl_rdint(oldp, oldlenp, newp, + atomic_load_int(&la_hold_total))); case IPCTL_STATS: return (ip_sysctl_ipstat(oldp, oldlenp, newp)); #ifdef MROUTING -- cgit v1.2.3