Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-05-01 Thread Tim Chen
On Tue, 2013-04-30 at 11:27 +0800, Herbert Xu wrote: > On Mon, Apr 29, 2013 at 01:40:30PM -0700, Tim Chen wrote: > > > > If I allocate the transform under the mod init instead, how can I make > > sure that the fast version is already registered if I have it compiled > > in? It is not clear to me

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-05-01 Thread Tim Chen
On Tue, 2013-04-30 at 11:27 +0800, Herbert Xu wrote: On Mon, Apr 29, 2013 at 01:40:30PM -0700, Tim Chen wrote: If I allocate the transform under the mod init instead, how can I make sure that the fast version is already registered if I have it compiled in? It is not clear to me how

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-29 Thread Herbert Xu
On Mon, Apr 29, 2013 at 01:40:30PM -0700, Tim Chen wrote: > > If I allocate the transform under the mod init instead, how can I make > sure that the fast version is already registered if I have it compiled > in? It is not clear to me how that's done looking at the libcrc32c > code. This is

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-29 Thread Tim Chen
On Sun, 2013-04-28 at 08:11 +0800, Herbert Xu wrote: > On Fri, Apr 26, 2013 at 09:44:17AM -0700, Tim Chen wrote: > > > > + old_tfm = crct10dif_tfm; > > + crc_t10dif_newalg = true; > > + /* make sure new alg flag is turned on before starting to switch tfm */ > > + mb(); > > + > > +

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-29 Thread Tim Chen
On Sun, 2013-04-28 at 08:11 +0800, Herbert Xu wrote: On Fri, Apr 26, 2013 at 09:44:17AM -0700, Tim Chen wrote: + old_tfm = crct10dif_tfm; + crc_t10dif_newalg = true; + /* make sure new alg flag is turned on before starting to switch tfm */ + mb(); + + new_tfm =

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-29 Thread Herbert Xu
On Mon, Apr 29, 2013 at 01:40:30PM -0700, Tim Chen wrote: If I allocate the transform under the mod init instead, how can I make sure that the fast version is already registered if I have it compiled in? It is not clear to me how that's done looking at the libcrc32c code. This is only an

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-27 Thread Herbert Xu
On Fri, Apr 26, 2013 at 09:44:17AM -0700, Tim Chen wrote: > > + old_tfm = crct10dif_tfm; > + crc_t10dif_newalg = true; > + /* make sure new alg flag is turned on before starting to switch tfm */ > + mb(); > + > + new_tfm = crypto_alloc_shash("crct10dif", 0, 0); > + if

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-27 Thread Herbert Xu
On Fri, Apr 26, 2013 at 09:44:17AM -0700, Tim Chen wrote: + old_tfm = crct10dif_tfm; + crc_t10dif_newalg = true; + /* make sure new alg flag is turned on before starting to switch tfm */ + mb(); + + new_tfm = crypto_alloc_shash(crct10dif, 0, 0); + if

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-26 Thread Tim Chen
On Fri, 2013-04-26 at 20:52 +0800, Herbert Xu wrote: > On Thu, Apr 25, 2013 at 10:28:30AM -0700, Tim Chen wrote: > > > > @@ -51,6 +54,98 @@ static const __u16 t10_dif_crc_table[256] = { > > 0xF0D8, 0x7B6F, 0x6C01, 0xE7B6, 0x42DD, 0xC96A, 0xDE04, 0x55B3 > > }; > > > > +#ifdef

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-26 Thread Herbert Xu
On Thu, Apr 25, 2013 at 10:28:30AM -0700, Tim Chen wrote: > > @@ -51,6 +54,98 @@ static const __u16 t10_dif_crc_table[256] = { > 0xF0D8, 0x7B6F, 0x6C01, 0xE7B6, 0x42DD, 0xC96A, 0xDE04, 0x55B3 > }; > > +#ifdef CONFIG_CRYPTO_CRCT10DIF No need for ifdefs, just make it unconditional like the

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-26 Thread Herbert Xu
On Thu, Apr 25, 2013 at 10:28:30AM -0700, Tim Chen wrote: @@ -51,6 +54,98 @@ static const __u16 t10_dif_crc_table[256] = { 0xF0D8, 0x7B6F, 0x6C01, 0xE7B6, 0x42DD, 0xC96A, 0xDE04, 0x55B3 }; +#ifdef CONFIG_CRYPTO_CRCT10DIF No need for ifdefs, just make it unconditional like the

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-26 Thread Tim Chen
On Fri, 2013-04-26 at 20:52 +0800, Herbert Xu wrote: On Thu, Apr 25, 2013 at 10:28:30AM -0700, Tim Chen wrote: @@ -51,6 +54,98 @@ static const __u16 t10_dif_crc_table[256] = { 0xF0D8, 0x7B6F, 0x6C01, 0xE7B6, 0x42DD, 0xC96A, 0xDE04, 0x55B3 }; +#ifdef CONFIG_CRYPTO_CRCT10DIF

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-25 Thread Tim Chen
On Thu, 2013-04-25 at 21:22 +0800, Herbert Xu wrote: > Please wrap the generic implementation as we do for crc32c. > Herbert, I've updated this patch to add the generic crct10dif transform (see below). Let me know if this address your comment. Thanks. Tim When CRC T10 DIF is calculated

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-25 Thread Herbert Xu
On Wed, Apr 17, 2013 at 09:12:52AM -0700, Tim Chen wrote: > When CRC T10 DIF is calculated using the crypto transform framework, we > wrap the crc_t10dif function call to utilize it. This allows us to > take advantage of any accelerated CRC T10 DIF transform that is > plugged into the crypto

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-25 Thread Herbert Xu
On Wed, Apr 17, 2013 at 09:12:52AM -0700, Tim Chen wrote: When CRC T10 DIF is calculated using the crypto transform framework, we wrap the crc_t10dif function call to utilize it. This allows us to take advantage of any accelerated CRC T10 DIF transform that is plugged into the crypto

Re: [PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-25 Thread Tim Chen
On Thu, 2013-04-25 at 21:22 +0800, Herbert Xu wrote: Please wrap the generic implementation as we do for crc32c. Herbert, I've updated this patch to add the generic crct10dif transform (see below). Let me know if this address your comment. Thanks. Tim When CRC T10 DIF is calculated using

[PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-17 Thread Tim Chen
When CRC T10 DIF is calculated using the crypto transform framework, we wrap the crc_t10dif function call to utilize it. This allows us to take advantage of any accelerated CRC T10 DIF transform that is plugged into the crypto framework. Signed-off-by: Tim Chen --- include/linux/crc-t10dif.h |

[PATCH v2 1/4] Wrap crc_t10dif function all to use crypto transform framework

2013-04-17 Thread Tim Chen
When CRC T10 DIF is calculated using the crypto transform framework, we wrap the crc_t10dif function call to utilize it. This allows us to take advantage of any accelerated CRC T10 DIF transform that is plugged into the crypto framework. Signed-off-by: Tim Chen tim.c.c...@linux.intel.com ---