]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ipvs: avoid indirect calls when calculating checksums
authorMatteo Croce <mcroce@redhat.com>
Sat, 19 Jan 2019 14:22:38 +0000 (15:22 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 28 Jan 2019 10:15:58 +0000 (11:15 +0100)
commitfe19a8fea7cb59f202ddd30ec2fa9f5bd907b3d2
tree3eeeb70baea31ee0abcff675afd7b9f25b8c4978
parente2f7cc72cbf42e037229d8bd998966569662442f
ipvs: avoid indirect calls when calculating checksums

The function pointer ip_vs_protocol->csum_check is only used in protocol
specific code, and never in the generic one.
Remove the function pointer from struct ip_vs_protocol and call the
checksum functions directly.
This reduces the performance impact of the Spectre mitigation, and
should give a small improvement even with RETPOLINES disabled.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_proto_ah_esp.c
net/netfilter/ipvs/ip_vs_proto_sctp.c
net/netfilter/ipvs/ip_vs_proto_tcp.c
net/netfilter/ipvs/ip_vs_proto_udp.c