From f4f80f3a404fc2a8c613d7d3ad480689f4c4fbda Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Fri, 12 Apr 2024 16:07:10 +0000 Subject: Split single TCP inpcb table into IPv4 and IPv6 parts. With two separate TCP hash tables, each one becomes smaller. When we remove the exclusive net lock from TCP, contention on internet PCB table mutex will be reduced. UDP has been split earlier into IPv4 and IPv6. Replace branch conditions based on INP_IPV6 with assertions. OK mvs@ --- sys/kern/kern_sysctl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_sysctl.c') diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 9ff340ca2ea..5d0d1a8a851 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.426 2024/03/29 06:50:06 miod Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.427 2024/04/12 16:07:09 bluhm Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1482,6 +1482,12 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, TAILQ_FOREACH(inp, &tcbtable.inpt_queue, inp_queue) FILLSO(inp->inp_socket); mtx_leave(&tcbtable.inpt_mtx); +#ifdef INET6 + mtx_enter(&tcb6table.inpt_mtx); + TAILQ_FOREACH(inp, &tcb6table.inpt_queue, inp_queue) + FILLSO(inp->inp_socket); + mtx_leave(&tcb6table.inpt_mtx); +#endif mtx_enter(&udbtable.inpt_mtx); TAILQ_FOREACH(inp, &udbtable.inpt_queue, inp_queue) FILLSO(inp->inp_socket); -- cgit v1.2.3