From ff0e27878987e440bcdb0df63d843fd926384784 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Thu, 3 Jul 2008 15:46:25 +0000 Subject: 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 --- sys/netinet/tcp_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/netinet/tcp_output.c') 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"); -- cgit v1.2.3