diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-07-03 15:46:25 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-07-03 15:46:25 +0000 |
commit | ff0e27878987e440bcdb0df63d843fd926384784 (patch) | |
tree | cfd8e3f0351dc0a16bb196a2476d32a2f3f37a88 /sys/netinet/tcp_output.c | |
parent | 5a0754bfe0405005d4644eea69c448e9c919787e (diff) |
link pf state keys to tcp pcbs and vice versa.
when we first do a pcb lookup and we have a pointer to a pf state key
in the mbuf header, store the state key pointer in the pcb and a pointer
to the pcb we just found in the state key. when either the state key
or the pcb is removed, clear the pointers.
on subsequent packets inbound we can skip the pcb lookup and just use the
pointer from the state key.
on subsequent packets outbound we can skip the state key lookup and use
the pointer from the pcb.
about 8% speedup with 100 concurrent tcp sessions, should help much more
with more tcp sessions.
ok markus ryan
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r-- | sys/netinet/tcp_output.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 53ec8ad07e6..bd06ea95f25 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_output.c,v 1.84 2008/06/28 13:26:38 markus Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.85 2008/07/03 15:46:24 henning Exp $ */ /* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */ /* @@ -761,6 +761,7 @@ send: } m->m_pkthdr.rcvif = (struct ifnet *)0; m->m_pkthdr.len = hdrlen + len; + m->m_pkthdr.pf.statekey = tp->t_inpcb->inp_pf_sk; if (!tp->t_template) panic("tcp_output"); |