Re: [PATCH v2] crypto: crc32c-pclmul - Shrink K_table to 32-bit words
From: Tim Chen
Date: Wed May 28 2014 - 19:02:41 EST
On Wed, 2014-05-28 at 18:15 -0400, George Spelvin wrote:
> crypto: crc32c-pclmul - Shrink K_table to 32-bit words
>
> There's no need for the K_table to be made of 64-bit words. For some
> reason, the original authors didn't fully reduce the values modulo the
> CRC32C polynomial, and so had some 33-bit number in there. They
> can all be reduced to 32 bits.
>
> Doing that cuts the table size in half. Since the code depends on both
> pclmulq and crc32, SSE 4.1 is obviously present, so we can use pmovzxdq
> to fetch it in the correct format.
>
> Two other related fixes:
> * K_table is read-only, so belongs in .text, not .data, and
> * There's no need for more than 8-byte alignment
George,
Can you do a tcrypt speed measurement with and without your changes?
Check to see if there's any slowdown. Please make sure you pin
the frequency of your cpu when running the test.
e.g.
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Thanks.
Tim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/