diff options
author | gnn <gnn@FreeBSD.org> | 2014-10-10 19:26:26 +0000 |
---|---|---|
committer | gnn <gnn@FreeBSD.org> | 2014-10-10 19:26:26 +0000 |
commit | 23f601a6ca01e7c80579cb2278a1d7b3e6e8d71a (patch) | |
tree | 882b23554b3fbe15cec348f633b9763a216448a1 /sys/netpfil | |
parent | 0af4e9789883c048c1bb1d7220f5acf4833f6a86 (diff) | |
download | FreeBSD-src-23f601a6ca01e7c80579cb2278a1d7b3e6e8d71a.zip FreeBSD-src-23f601a6ca01e7c80579cb2278a1d7b3e6e8d71a.tar.gz |
Change the PF hash from Jenkins to Murmur3. In forwarding tests
this showed a conservative 3% incrase in PPS.
Differential Revision: https://reviews.freebsd.org/D461
Submitted by: des
Reviewed by: emaste
MFC after: 1 month
Diffstat (limited to 'sys/netpfil')
-rw-r--r-- | sys/netpfil/pf/pf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7e90b61..ac4a154 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -374,9 +374,9 @@ pf_hashkey(struct pf_state_key *sk) { uint32_t h; - h = jenkins_hash32((uint32_t *)sk, - sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), - V_pf_hashseed); + h = murmur3_aligned_32((uint32_t *)sk, + sizeof(struct pf_state_key_cmp), + V_pf_hashseed); return (h & pf_hashmask); } @@ -388,12 +388,12 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) switch (af) { case AF_INET: - h = jenkins_hash32((uint32_t *)&addr->v4, - sizeof(addr->v4)/sizeof(uint32_t), V_pf_hashseed); + h = murmur3_aligned_32((uint32_t *)&addr->v4, + sizeof(addr->v4), V_pf_hashseed); break; case AF_INET6: - h = jenkins_hash32((uint32_t *)&addr->v6, - sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed); + h = murmur3_aligned_32((uint32_t *)&addr->v6, + sizeof(addr->v6), V_pf_hashseed); break; default: panic("%s: unknown address family %u", __func__, af); |