diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2007-05-28 17:16:40 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2007-05-28 17:16:40 +0000 |
commit | f96d4bfaae8e683d6ce36140dff54c0670c826fb (patch) | |
tree | 599f5dac4bbc56331fe9f4806b73b80dabee239c /sys/kern | |
parent | 024903f229c875b3dcae393928cc28761a3c18dd (diff) |
double pf performance.
boring details:
pf used to use an mbuf tag to keep track of route-to etc, altq, tags,
routing table IDs, packets redirected to localhost etc. so each and every
packet going through pf got an mbuf tag. mbuf tags use malloc'd memory,
and that is knda slow.
instead, stuff the information into the mbuf header directly.
bridging soekris with just "pass" as ruleset went from 29 MBit/s to
58 MBit/s with that (before ryan's randomness fix, now it is even betterer)
thanks to chris for the test setup!
ok ryan ryan ckuethe reyk
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index a7786a6ec06..1e4585ea511 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.81 2007/05/27 20:54:25 claudio Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.82 2007/05/28 17:16:39 henning Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -191,6 +191,12 @@ m_gethdr(int nowait, int type) m->m_flags = M_PKTHDR; SLIST_INIT(&m->m_pkthdr.tags); m->m_pkthdr.csum_flags = 0; + m->m_pkthdr.pf.hdr = NULL; + m->m_pkthdr.pf.rtableid = 0; + m->m_pkthdr.pf.qid = 0; + m->m_pkthdr.pf.tag = 0; + m->m_pkthdr.pf.flags = 0; + m->m_pkthdr.pf.routed = 0; } splx(s); return (m); |