]> git.baikalelectronics.ru Git - kernel.git/commit
lib: crc32: Greatly shrink CRC combining code
authorGeorge Spelvin <linux@horizon.com>
Mon, 23 Jun 2014 13:11:54 +0000 (15:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jun 2014 23:03:59 +0000 (16:03 -0700)
commit7acd081c93f99d1fdafff3162ec8520a0301133f
tree20edf4e5f96fbf08e9e0136fec63bf13009f026a
parentc872426a9c3cb90eeb512e9e48bf0aa15d1648a5
lib: crc32: Greatly shrink CRC combining code

There's no need for a full 32x32 matrix, when rows before the last are
just shifted copies of the rows after them.

There's still room for improvement (especially on X86 processors with
CRC32 and PCLMUL instructions), but this is a large step in the
right direction [which is in particular useful for its current user,
namely SCTP checksumming over multiple skb frags[] entries, i.e. in
IPVS balancing when other CRC32 offloads are not available].

The internal primitive is now called crc32_generic_shift and takes one
less argument; the XOR with crc2 is done in inline wrappers.

Signed-off-by: George Spelvin <linux@horizon.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/crc32.h
lib/crc32.c