summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2008-07-03 15:46:23 +0000
committerhenning <henning@openbsd.org>2008-07-03 15:46:23 +0000
commit954bc2dcb1e70c230b682d9ee529ca9222e97d57 (patch)
tree54eab3fdef036acb5730176ea8dcde6740ba4f3f /sys/netinet/tcp_output.c
parentAdd struct for VC_EXTENSION_UNIT and dump it in debug mode. (diff)
downloadwireguard-openbsd-954bc2dcb1e70c230b682d9ee529ca9222e97d57.tar.xz
wireguard-openbsd-954bc2dcb1e70c230b682d9ee529ca9222e97d57.zip
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.c3
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");