From: Arnd Bergmann <arnd@arndb.de>
To: James Morris <jmorris@intercode.com.au>,
Thomas Spatzier <TSPAT@de.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: crypto API and IBM z990 hardware support
Date: Thu, 03 Jul 2003 00:06:21 +0200 [thread overview]
Message-ID: <200307022206.h62M6aFB025817@post.webmailer.de> (raw)
In-Reply-To: <4T81.24d.41@gated-at.bofh.it>
James Morris wrote:
> On Wed, 2 Jul 2003, Thomas Spatzier wrote:
>
> I'd like to avoid these kind of macros, and make it a general case
> solution (e.g. which can be used for various hardware implementations).
Right.
> One possibility would be to allow registration with an alias list in
> crypto API with attributes indicating whether the module is hardware,
> arch-specific etc.
Still too complicated imho. The built-in code should not need to know
about which modules exist. For example that would prevent autoloading
of third-party hardware crypto drivers. In most cases, a
first-come-first-serve approach is sufficient and works without
changes to the current code. Modules implementing the same algorithm
can just set .cra_name to the same value.
For built-in drivers, link order decides which implementation is
preferred. Consequently, hardware crypto drivers need to come before
software implementations and must not register themselves if the
hardware is not found at initcall time.
For the module case, the aes-z990.o module could declare
'MODULE_ALIAS(aes-hw);', the simple patch below makes sure
that any aes-hw module is preferred to the software aes
module. If there is more than one hardware implementation
available for an architecture, either the autoloader can be
extended further, or modprobe has to be configured
appropriately.
Arnd <><
===== crypto/autoload.c 1.7 vs edited =====
--- 1.7/crypto/autoload.c Sat May 17 21:39:13 2003
+++ edited/crypto/autoload.c Wed Jul 2 23:48:10 2003
@@ -21,16 +21,15 @@
* A far more intelligent version of this is planned. For now, just
* try an exact match on the name of the algorithm.
*/
-void crypto_alg_autoload(const char *name)
-{
- request_module("%s", name);
-}
-
struct crypto_alg *crypto_alg_mod_lookup(const char *name)
{
struct crypto_alg *alg = crypto_alg_lookup(name);
if (alg == NULL) {
- crypto_alg_autoload(name);
+ request_module("%s-hw", name);
+ alg = crypto_alg_lookup(name);
+ }
+ if (alg == NULL) {
+ request_module("%s", name);
alg = crypto_alg_lookup(name);
}
return alg;
next parent reply other threads:[~2003-07-02 21:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4P45.5YN.11@gated-at.bofh.it>
[not found] ` <4T81.24d.41@gated-at.bofh.it>
2003-07-02 22:06 ` Arnd Bergmann [this message]
2003-07-06 14:08 ` James Morris
2003-07-06 17:46 ` Arnd Bergmann
2003-07-07 7:14 ` Christoph Hellwig
2003-07-02 20:23 Ulrich Weigand
-- strict thread matches above, loose matches on Subject: below --
2003-07-02 12:35 Thomas Spatzier
2003-07-02 16:57 ` James Morris
2003-07-07 7:11 ` Christoph Hellwig
2003-07-07 10:27 ` James Morris
2003-07-02 7:07 Thomas Spatzier
2003-07-02 9:35 ` James Morris
2003-07-07 7:09 ` Christoph Hellwig
2003-07-08 2:53 ` David S. Miller
2003-07-08 3:37 ` Roland Dreier
2003-07-08 3:35 ` David S. Miller
2003-07-10 1:08 ` Werner Almesberger
2003-07-10 1:08 ` David S. Miller
2003-07-10 2:06 ` Werner Almesberger
2003-07-10 2:06 ` David S. Miller
2003-07-10 2:37 ` Werner Almesberger
2003-07-11 0:02 ` David S. Miller
[not found] ` <mailman.1057799700.15422.linux-kernel2news@redhat.com>
2003-07-10 5:55 ` Pete Zaitcev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200307022206.h62M6aFB025817@post.webmailer.de \
--to=arnd@arndb.de \
--cc=TSPAT@de.ibm.com \
--cc=jmorris@intercode.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®