]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
powerpc: optimise csum_partial() call when len is constant
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 7 Mar 2016 17:44:37 +0000 (18:44 +0100)
committerScott Wood <oss@buserror.net>
Wed, 9 Mar 2016 16:44:18 +0000 (10:44 -0600)
commit7e393220b6e1ecfa5520d1b2ca31150b7588f458
treedcea05372297033d1327befd4cfa60dfb24141fb
parentac6082dd32da2774241a75f1fca2de71a39ef768
powerpc: optimise csum_partial() call when len is constant

csum_partial is often called for small fixed length packets
for which it is suboptimal to use the generic csum_partial()
function.

For instance, in my configuration, I got:
* One place calling it with constant len 4
* Seven places calling it with constant len 8
* Three places calling it with constant len 14
* One place calling it with constant len 20
* One place calling it with constant len 24
* One place calling it with constant len 32

This patch renames csum_partial() to __csum_partial() and
implements csum_partial() as a wrapper inline function which
* uses csum_add() for small 16bits multiple constant length
* uses ip_fast_csum() for other 32bits multiple constant
* uses __csum_partial() in all other cases

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <oss@buserror.net>
arch/powerpc/include/asm/checksum.h
arch/powerpc/lib/checksum_32.S
arch/powerpc/lib/checksum_64.S
arch/powerpc/lib/ppc_ksyms.c