diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-04-12 16:07:10 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-04-12 16:07:10 +0000 |
commit | f4f80f3a404fc2a8c613d7d3ad480689f4c4fbda (patch) | |
tree | cd8bd323c55e00c5d57f4ffaa021b2fe835c6e0a /sys/kern/kern_sysctl.c | |
parent | 7a12659c2971d89613b02933b7980d60d3557383 (diff) |
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@
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r-- | sys/kern/kern_sysctl.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |