]> git.baikalelectronics.ru Git - kernel.git/commit
s390/checksum: rewrite csum_tcpudp_nofold()
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 11 Aug 2020 13:30:30 +0000 (15:30 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 26 Aug 2020 16:47:20 +0000 (18:47 +0200)
commitb8bc861e33eb92fa9a5d2ed4fd0d5f876186069e
treeba7d76538d9a476b7e40f5681e3f5905802442d6
parent02941c98bd4cbbe7f77db3b83c3a8dee94eaa150
s390/checksum: rewrite csum_tcpudp_nofold()

Rewrite csum_tcpudp_nofold() so that the generated code will not
contain branches. The old implementation was also optimized for
machines which came with "add logical with carry" instructions,
however the compiler doesn't generate them anymore. This is most
likely because those instructions are slower.

However with the old code the compiler generates a lot of branches,
which isn't too helpful usually. Therefore rewrite the code.

In a tight loop this doesn't make any difference since the branch
prediction unit does its job.

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