]> git.baikalelectronics.ru Git - kernel.git/commit
s390/checksum: make ip_fast_csum() faster
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 11 Aug 2020 14:36:26 +0000 (16:36 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 26 Aug 2020 16:47:20 +0000 (18:47 +0200)
commit0ec2ba64cd45f49dfa417fca92210ad0069ec672
treeea7c6e546dfd8d226bce2ba053f521b0fc9101e3
parentb8bc861e33eb92fa9a5d2ed4fd0d5f876186069e
s390/checksum: make ip_fast_csum() faster

Convert ip_fast_csum() so it doesn't call csum_partial(), but instead
open code the checksum calculation. The problem with csum_partial() is
that it makes use of the cksm instruction, which has high startup
costs and therefore is only very fast if used on larger memory
regions.

IPv4 headers however are small in size (5-16 32-bit words). The open
coded variant calculates the checksum in ~30% of the time compared to
the old variant (z14, march=z196).

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/checksum.h