All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CRC32C: crc32c module soft dependency
@ 2014-01-23 19:35 Tim Chen
  2014-02-09  1:16 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Chen @ 2014-01-23 19:35 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto

Herbert,

It seems like we haven't folded in changes for adding
soft dependency to crc32c to ensure that the accelerated
version is loaded when available.

I take a crack with the patch below.

Tim

---->o-----
commit 016a709ef06bce5451a4b88e49f207a838c348e5
Author: Tim Chen <tim.c.chen@linux.intel.com>
Date:   Thu Jan 23 03:25:47 2014 -0800

    CRC32C: Add soft module dependency to load other accelerated crc32c
    modules
    
    We add the soft module dependency of crc32c module alias
    to generic crc32c module so other hardware accelerated crc32c
    modules could get loaded and used before the generic version.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
diff --git a/crypto/crc32c.c b/crypto/crc32c.c
index 06f7018..d9c7beb 100644
--- a/crypto/crc32c.c
+++ b/crypto/crc32c.c
@@ -170,3 +170,5 @@ module_exit(crc32c_mod_fini);
 MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
 MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("crc32c");
+MODULE_SOFTDEP("pre: crc32c");

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] CRC32C: crc32c module soft dependency
  2014-01-23 19:35 [PATCH] CRC32C: crc32c module soft dependency Tim Chen
@ 2014-02-09  1:16 ` Herbert Xu
  2014-02-10 20:17   ` Tim Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2014-02-09  1:16 UTC (permalink / raw)
  To: Tim Chen; +Cc: linux-crypto

On Thu, Jan 23, 2014 at 11:35:20AM -0800, Tim Chen wrote:
> Herbert,
> 
> It seems like we haven't folded in changes for adding
> soft dependency to crc32c to ensure that the accelerated
> version is loaded when available.
> 
> I take a crack with the patch below.

Thanks for the patch Tim.  We should also rename it to crc32c_generic
while we're at it.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] CRC32C: crc32c module soft dependency
  2014-02-09  1:16 ` Herbert Xu
@ 2014-02-10 20:17   ` Tim Chen
  2014-02-25 12:16     ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Chen @ 2014-02-10 20:17 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto

On Sun, 2014-02-09 at 09:16 +0800, Herbert Xu wrote:
> On Thu, Jan 23, 2014 at 11:35:20AM -0800, Tim Chen wrote:
> > Herbert,
> > 
> > It seems like we haven't folded in changes for adding
> > soft dependency to crc32c to ensure that the accelerated
> > version is loaded when available.
> > 
> > I take a crack with the patch below.
> 
> Thanks for the patch Tim.  We should also rename it to crc32c_generic
> while we're at it.

How about the following version.  Thanks.

Tim

--->o---

>From 5fa1b1ae614577c6e3c1acf02447f81d2d7a66dd Mon Sep 17 00:00:00 2001
From: Tim Chen <tim.c.chen@linux.intel.com>
Date: Thu, 23 Jan 2014 03:25:47 -0800
Subject: [PATCH] CRC32C: Add soft module dependency to load other accelerated
 crc32c modules
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org

We added the soft module dependency of crc32c module alias
to generic crc32c module so other hardware accelerated crc32c
modules could get loaded and used before the generic version.
We also renamed the crypto/crc32c.c containing the generic
crc32c crypto computation to crypto/crc32c_generic.c according
to convention.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
 crypto/Makefile                       | 2 +-
 crypto/{crc32c.c => crc32c_generic.c} | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
 rename crypto/{crc32c.c => crc32c_generic.c} (98%)

diff --git a/crypto/Makefile b/crypto/Makefile
index b29402a..38e64231 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -81,7 +81,7 @@ obj-$(CONFIG_CRYPTO_SALSA20) += salsa20_generic.o
 obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
 obj-$(CONFIG_CRYPTO_ZLIB) += zlib.o
 obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
-obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
+obj-$(CONFIG_CRYPTO_CRC32C) += crc32c_generic.o
 obj-$(CONFIG_CRYPTO_CRC32) += crc32.o
 obj-$(CONFIG_CRYPTO_CRCT10DIF) += crct10dif_common.o crct10dif_generic.o
 obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o
diff --git a/crypto/crc32c.c b/crypto/crc32c_generic.c
similarity index 98%
rename from crypto/crc32c.c
rename to crypto/crc32c_generic.c
index 06f7018..d9c7beb 100644
--- a/crypto/crc32c.c
+++ b/crypto/crc32c_generic.c
@@ -170,3 +170,5 @@ module_exit(crc32c_mod_fini);
 MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
 MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("crc32c");
+MODULE_SOFTDEP("pre: crc32c");
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] CRC32C: crc32c module soft dependency
  2014-02-10 20:17   ` Tim Chen
@ 2014-02-25 12:16     ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2014-02-25 12:16 UTC (permalink / raw)
  To: Tim Chen; +Cc: linux-crypto

On Mon, Feb 10, 2014 at 12:17:12PM -0800, Tim Chen wrote:
> On Sun, 2014-02-09 at 09:16 +0800, Herbert Xu wrote:
> > On Thu, Jan 23, 2014 at 11:35:20AM -0800, Tim Chen wrote:
> > > Herbert,
> > > 
> > > It seems like we haven't folded in changes for adding
> > > soft dependency to crc32c to ensure that the accelerated
> > > version is loaded when available.
> > > 
> > > I take a crack with the patch below.
> > 
> > Thanks for the patch Tim.  We should also rename it to crc32c_generic
> > while we're at it.
> 
> How about the following version.  Thanks.

Patch applied.  Thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-25 12:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 19:35 [PATCH] CRC32C: crc32c module soft dependency Tim Chen
2014-02-09  1:16 ` Herbert Xu
2014-02-10 20:17   ` Tim Chen
2014-02-25 12:16     ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.