Re: [PATCH 14/14] crc32: Select an algorithm via kconfig

2011-12-01 Thread Herbert Xu
On Thu, Dec 01, 2011 at 12:15:17PM -0800, Darrick J. Wong wrote: > Allow the kernel builder to choose a crc32* algorithm for the kernel. > > Signed-off-by: Darrick J. Wong I don't like this at all. How do you expect distros or indeed anyone to make this choice? For generic C implementations lik

Re: [PATCH v5.2 00/14] crc32c: Add faster algorithm and self-test code

2011-12-01 Thread Herbert Xu
On Thu, Dec 01, 2011 at 12:31:22PM -0800, Darrick J. Wong wrote: . > They seem to call crc32c(), which is in crypto/crc32c. If you're interested > in Nope, the crypto API layer will use the SSE implementation where available. Only when it isn't available will the C version in crypto/ be used.

Re: [PATCH v5.2 00/14] crc32c: Add faster algorithm and self-test code

2011-12-01 Thread Darrick J. Wong
On Thu, Dec 01, 2011 at 12:20:53PM -0800, Joel Becker wrote: > On Thu, Dec 01, 2011 at 12:13:41PM -0800, Darrick J. Wong wrote: > > Hi all, > > > > This patchset (re)uses Bob Pearson's crc32 slice-by-8 code to stamp out a > > software crc32c implementation. It removes the crc32c implementation in

Re: [PATCH v5.2 00/14] crc32c: Add faster algorithm and self-test code

2011-12-01 Thread Joel Becker
On Thu, Dec 01, 2011 at 12:13:41PM -0800, Darrick J. Wong wrote: > Hi all, > > This patchset (re)uses Bob Pearson's crc32 slice-by-8 code to stamp out a > software crc32c implementation. It removes the crc32c implementation in > crypto/ in favor of using the stamped-out one in lib/. There is als

[PATCH 01/14] crc32: removed two instances of trailing whitespaces

2011-12-01 Thread Darrick J. Wong
- remove trailing whitespace from lib/crc32.c - remove trailing whitespace from lib/crc32defs.h From: Bob Pearson Signed-off-by: Bob Pearson [djw...@us.ibm.com: changelog tweaks] Signed-off-by: Darrick J. Wong --- lib/crc32.c |2 +- lib/crc32defs.h |2 +- 2 files ch

[PATCH 03/14] crc32: Simplify unit test code

2011-12-01 Thread Darrick J. Wong
Replaced the unit test provided in crc32.c, which doesn't have a makefile and doesn't compile with current headers, with a simpler self test routine that also gives a measure of performance and runs at module init time. The self test option can be enabled through a configuration option CONFIG_CRC32

[PATCH 09/14] crc32: Optimize loop counter for x86

2011-12-01 Thread Darrick J. Wong
Add two changes that improve the performance of x86 systems 1. replace main loop with incrementing counter this change improves the performance of the selftest by about 5-6% on Nehalem CPUs. The apparent reason is that the compiler can use the loop index

[PATCH 05/14] crc32: Miscellaneous cleanups

2011-12-01 Thread Darrick J. Wong
Misc cleanup of lib/crc32.c and related files - removed unnecessary header files. - straightened out some convoluted ifdef's - rewrote some references to 2 dimensional arrays as 1 dimensional arrays to make them correct. I.e. replaced tab[i] with tab[0][i].

[PATCH 06/14] crc32: Fix mixing of endian-specific types

2011-12-01 Thread Darrick J. Wong
crc32.c in its original version freely mixed u32, __le32 and __be32 types which caused warnings from sparse with __CHECK_ENDIAN__. This patch fixes these by forcing the types to u32. From: Bob Pearson Signed-off-by: Bob Pearson [djw...@us.ibm.com: Minor changelog tweaks] Signed-off-by: Darrick J

[PATCH 08/14] crc32: Add slice-by-8 algorithm to existing code

2011-12-01 Thread Darrick J. Wong
add slicing-by-8 algorithm to the existing slicing-by-4 algorithm. This consists of: - extend largest BITS size from 32 to 64 - extend tables from tab[4][256] to up to tab[8][256] - Add code for inner loop. From: Bob Pearson Signed-off-by: Bob Pearson [djw...@us.ibm.com:

[PATCH v5.2 00/14] crc32c: Add faster algorithm and self-test code

2011-12-01 Thread Darrick J. Wong
Hi all, This patchset (re)uses Bob Pearson's crc32 slice-by-8 code to stamp out a software crc32c implementation. It removes the crc32c implementation in crypto/ in favor of using the stamped-out one in lib/. There is also a change to Kconfig so that the kernel builder can pick an implementation

[PATCH 04/14] crc32: Speed up memory table access on powerpc

2011-12-01 Thread Darrick J. Wong
Replace 2D array references by pointer references in loops. This change has no effect on X86 code but improves PPC performance. From: Bob Pearson Signed-off-by: Bob Pearson [djw...@us.ibm.com: Minor changelog tweaks] Signed-off-by: Darrick J. Wong --- lib/crc32.c | 21 +++--

[PATCH 02/14] crc32: Move long comment about crc32 fundamentals to Documentation/

2011-12-01 Thread Darrick J. Wong
Moved a long comment from lib/crc32.c to Documentation/crc32.txt where it will more likely get read. - Edited the resulting document to add an explanation of the slicing-by-n algorithm. From: Bob Pearson Signed-off-by: George Spelvin Signed-off-by: Bob Pearson [djw...@us.ibm.

[PATCH 11/14] crc32: Bolt on crc32c

2011-12-01 Thread Darrick J. Wong
Reuse the existing crc32 code to stamp out a crc32c implementation. Signed-off-by: Darrick J. Wong --- include/linux/crc32.h |2 ++ lib/Kconfig |8 +++--- lib/crc32.c | 62 +++-- lib/crc32defs.h |7 ++ lib/ge

[PATCH 14/14] crc32: Select an algorithm via kconfig

2011-12-01 Thread Darrick J. Wong
Allow the kernel builder to choose a crc32* algorithm for the kernel. Signed-off-by: Darrick J. Wong --- lib/Kconfig | 36 lib/crc32defs.h | 18 ++ 2 files changed, 54 insertions(+), 0 deletions(-) diff --git a/lib/Kconfig b/lib/Kcon

[PATCH 13/14] crc32: Add self-test code for crc32c

2011-12-01 Thread Darrick J. Wong
Add self-test code for crc32c. Signed-off-by: Darrick J. Wong --- lib/crc32.c | 363 ++- 1 files changed, 261 insertions(+), 102 deletions(-) diff --git a/lib/crc32.c b/lib/crc32.c index 8df9561..382fa76 100644 --- a/lib/crc32.c +++ b/li

[PATCH 10/14] crc32: Add note about this patchset to crc32.c

2011-12-01 Thread Darrick J. Wong
Some final changes - added a comment at the top of crc32.c From: Bob Pearson Signed-off-by: Bob Pearson [djw...@us.ibm.com: Minor changelog tweaks] Signed-off-by: Darrick J. Wong --- lib/crc32.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/lib/crc32.c b/

[PATCH 12/14] crypto: crc32c should use library implementation

2011-12-01 Thread Darrick J. Wong
Since lib/crc32.c now provides crc32c, remove the software implementation here and call the library function instead. Signed-off-by: Darrick J. Wong --- crypto/Kconfig |1 + crypto/crc32c.c | 94 ++- 2 files changed, 4 insertions(+), 91

[PATCH 07/14] crc32: Make CRC_*_BITS definition correspond to actual bit counts

2011-12-01 Thread Darrick J. Wong
crc32.c provides a choice of one of several algorithms for computing the LSB and LSB versions of the CRC32 checksum based on the parameters CRC_LE_BITS and CRC_BE_BITS. In the original version the values 1, 2, 4 and 8 respectively selected versions of the alrogithm that computed the crc 1, 2, 4 and

Re: [PATCH v5.1 00/14] crc32c: Add faster algorithm and self-test code

2011-12-01 Thread Darrick J. Wong
On Wed, Nov 30, 2011 at 02:29:11PM -0800, Andrew Morton wrote: > On Mon, 28 Nov 2011 14:36:59 -0800 > "Darrick J. Wong" wrote: > > > This patchset (re)uses Bob Pearson's crc32 slice-by-8 code to stamp out a > > software crc32c implementation. > > I think the attributions here are all messed up.

Per-cpu tfm allocation/free functions

2011-12-01 Thread Seth Jennings
linux-crypto, I am currently working on the zcache RAM compression driver (in the staging tree) and have a question. I am looking to use the crypto compression API instead of the hardcoded LZO calls that are in there right now, but I need to allocate a tfm per cpu per compression algorithm being