diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-10-25 12:15:25 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-10-25 12:15:25 +0000 |
commit | ffc146fdfc4c358e3dc4114be8120f945c21b019 (patch) | |
tree | e241e9be8f8cf0c5a99606f1db517ae19708c646 /sys/netinet/in_pcb.h | |
parent | ff56bfd07066744cd6f138a406d594c03e923f89 (diff) |
additional hash for local port; improves speed of implicit bind
from >1000K cpu cycles to 20-30K for 18000 sockets on i386;
test+feedback by Claudio Jeker; ok itojun@;
[make sure you rebuild netstat/systat, too]
Diffstat (limited to 'sys/netinet/in_pcb.h')
-rw-r--r-- | sys/netinet/in_pcb.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 015668a0b9e..684c941b634 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.45 2003/06/02 23:28:14 millert Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.46 2003/10/25 12:15:24 markus Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -87,6 +87,7 @@ union inpaddru { */ struct inpcb { LIST_ENTRY(inpcb) inp_hash; + LIST_ENTRY(inpcb) inp_lhash; /* extra hash for lport */ CIRCLEQ_ENTRY(inpcb) inp_queue; struct inpcbtable *inp_table; union inpaddru inp_faddru; /* Foreign address. */ @@ -147,8 +148,8 @@ struct inpcb { struct inpcbtable { CIRCLEQ_HEAD(, inpcb) inpt_queue; - LIST_HEAD(inpcbhead, inpcb) *inpt_hashtbl; - u_long inpt_hash; + LIST_HEAD(inpcbhead, inpcb) *inpt_hashtbl, *inpt_lhashtbl; + u_long inpt_hash, inpt_lhash; u_int16_t inpt_lastport; }; |