From a0602d99d3b542db1ae0dd1566e014f6d19d1fb1 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Thu, 13 Apr 2017 16:15:01 +0800 Subject: [PATCH] inpcb/localgroup: Use LSB of the hash to find inpcb. This matches hash usage of the network stack. --- sys/netinet/in_pcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 24a194b3cc..9c42d3f41b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1528,7 +1528,7 @@ inp_localgroup_lookup(const struct inpcbinfo *pcbinfo, * completion queue token contention, thus more * cpu time is saved. */ - idx = pkt_hash % grp->il_inpcnt; + idx = netisr_hashlsb(pkt_hash) % grp->il_inpcnt; if (grp->il_laddr.s_addr == laddr.s_addr) return grp->il_inp[idx]; else if (grp->il_laddr.s_addr == INADDR_ANY) -- 2.11.4.GIT