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

2012-01-06 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 12/14] crypto: crc32c should use library implementation

2012-01-06 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 11/14] crc32: Bolt on crc32c

2012-01-06 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 01/14] crc32: removed two instances of trailing whitespaces

2012-01-06 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 06/14] crc32: Fix mixing of endian-specific types

2012-01-06 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 05/14] crc32: Miscellaneous cleanups

2012-01-06 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 04/14] crc32: Speed up memory table access on powerpc

2012-01-06 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 03/14] crc32: Simplify unit test code

2012-01-06 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 07/14] crc32: Make CRC_*_BITS definition correspond to actual bit counts

2012-01-06 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

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

2012-01-06 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 14/14] crc32: Select an algorithm via kconfig

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

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

2012-01-06 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 10/14] crc32: Add note about this patchset to crc32.c

2012-01-06 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 02/14] crc32: Move long comment about crc32 fundamentals to Documentation/

2012-01-06 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 v5.3 00/14] crc32c: Add faster algorithm and self-test code

2012-01-06 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

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (4rd attempt)

2012-01-06 Thread Nikos Mavrogiannopoulos
This patch is the same as the previous but without the inline function. regards, Nikos >From 1562727aab0e2fcce87e22a73abe6ea1c7c8975f Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 1 Nov 2011 13:39:56 +0100 Subject: [PATCH] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag. The added CRY

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (3rd attempt)

2012-01-06 Thread Herbert Xu
On Fri, Jan 06, 2012 at 10:29:22AM +0100, Nikos Mavrogiannopoulos wrote: > On Fri, Jan 6, 2012 at 10:12 AM, Herbert Xu > wrote: > > >> How the flag is exported by cryptodev-linux: > >> http://repo.or.cz/w/cryptodev-linux.git/blob/aead:/ioctl.c#l716 > > Actually I was looking for code that uses cr

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (3rd attempt)

2012-01-06 Thread Nikos Mavrogiannopoulos
On Fri, Jan 6, 2012 at 10:12 AM, Herbert Xu wrote: >> How the flag is exported by cryptodev-linux: >> http://repo.or.cz/w/cryptodev-linux.git/blob/aead:/ioctl.c#l716 > Actually I was looking for code that uses crypto_tfm_alg_flags > function. The code above will use it once it is accepted. Now i

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (3rd attempt)

2012-01-06 Thread Herbert Xu
On Fri, Jan 06, 2012 at 10:02:08AM +0100, Nikos Mavrogiannopoulos wrote: > > How the flag is exported by cryptodev-linux: > http://repo.or.cz/w/cryptodev-linux.git/blob/aead:/ioctl.c#l716 > > An example of using it in userspace: > http://repo.or.cz/w/cryptodev-linux.git/blob/aead:/examples/aes.c#l

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (3rd attempt)

2012-01-06 Thread Nikos Mavrogiannopoulos
On Fri, Jan 6, 2012 at 9:28 AM, Herbert Xu wrote: >> I needed this function in order to access the new flag without >> relying on the structure format. The available crypto_tfm_alg_type() >> would apply a mask and remove it, thus I added this function. > Can you show me some example code so I can

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (3rd attempt)

2012-01-06 Thread Herbert Xu
On Fri, Jan 06, 2012 at 09:19:01AM +0100, Nikos Mavrogiannopoulos wrote: > > I needed this function in order to access the new flag without > relying on the structure format. The available crypto_tfm_alg_type() > would apply a mask and remove it, thus I added this function. Can you show me some e

Re: [PATCH 1/1] Added CRYPTO_ALG_KERN_DRIVER_ONLY flag (3rd attempt)

2012-01-06 Thread Nikos Mavrogiannopoulos
On 01/06/2012 02:37 AM, Herbert Xu wrote: > Nikos Mavrogiannopoulos wrote: >> The added CRYPTO_ALG_KERN_DRIVER_ONLY indicates whether a cipher >> is only available via a kernel driver. If the cipher implementation >> might be available by using an instruction set or by porting the >> kernel code,