]> git.baikalelectronics.ru Git - kernel.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)
commit1dd479896a4b173f3d44fb4fd5d718ed918a3552
tree6f5e84f4eeb3acc32fd836899e68bb6b41f03731
parent20622c255526a9beb99383b4e2d9baa90b16c9d4
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]