netfilter: conntrack: use siphash_4u64
authorFlorian Westphal <fw@strlen.de>
Wed, 2 Nov 2022 12:46:33 +0000 (13:46 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 15 Nov 2022 09:53:19 +0000 (10:53 +0100)
commitd2c806abcf0b582131e1f93589d628dac0c07bf4
tree34455cfef1019bbe4192ab62e02518aae7b9b91f
parent971095c6fa4aebc0af923c32a28124871fe35136
netfilter: conntrack: use siphash_4u64

This function is used for every packet, siphash_4u64 is noticeably faster
than using local buffer + siphash:

Before:
  1.23%  kpktgend_0       [kernel.vmlinux]     [k] __siphash_unaligned
  0.14%  kpktgend_0       [nf_conntrack]       [k] hash_conntrack_raw
After:
  0.79%  kpktgend_0       [kernel.vmlinux]     [k] siphash_4u64
  0.15%  kpktgend_0       [nf_conntrack]       [k] hash_conntrack_raw

In the pktgen test this gives about ~2.4% performance improvement.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c