diff options
author | gnn <gnn@FreeBSD.org> | 2014-11-13 21:58:42 +0000 |
---|---|---|
committer | gnn <gnn@FreeBSD.org> | 2014-11-13 21:58:42 +0000 |
commit | c5ebff0eaad4e5405b61d039545728ce2383545a (patch) | |
tree | 89999bf8c53cb452fe346843bd9c320e1bef08be /sys/netpfil | |
parent | 009b631cafc47b7b76be44d6c0bf6b48bdc189a3 (diff) | |
download | FreeBSD-src-c5ebff0eaad4e5405b61d039545728ce2383545a.zip FreeBSD-src-c5ebff0eaad4e5405b61d039545728ce2383545a.tar.gz |
MFC: 272906
Change the PF hash from Jenkins to Murmur3. In forwarding tests
this showed a conservative 3% incrase in PPS.
Original Differential Revision: https://reviews.freebsd.org/D461
Submitted by: des
Reviewed by: emaste
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 2123cac..d3e6598 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -373,9 +373,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); } @@ -387,12 +387,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); |