]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
arm64: Implement optimised IP checksum helpers
authorRobin Murphy <robin.murphy@arm.com>
Tue, 31 May 2016 17:04:40 +0000 (18:04 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 21 Jun 2016 14:09:11 +0000 (15:09 +0100)
commit0e455d8e80aa22d7ed42c9f5e4e3a75c558aa543
tree6f5e84f4eeb3acc32fd836899e68bb6b41f03731
parent33688abb2802ff3a230bd2441f765477b94cc89e
arm64: Implement optimised IP checksum helpers

AArch64 is capable of 128-bit memory accesses without alignment
restrictions, which makes it both possible and highly practical to slurp
up a typical 20-byte IP header in just 2 loads. Implement our own
version of ip_fast_checksum() to take advantage of that, resulting in
considerably fewer instructions and memory accesses than the generic
version. We can also get more optimal code generation for csum_fold() by
defining it a slightly different way round from the generic version, so
throw that into the mix too.

Suggested-by: Luke Starrett <luke.starrett@broadcom.com>
Acked-by: Luke Starrett <luke.starrett@broadcom.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/Kbuild
arch/arm64/include/asm/checksum.h [new file with mode: 0644]