Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-crypto <linux-crypto@vger.kernel.org>,
	James Bottomley <James.Bottomley@suse.de>,
	Christoph Hellwig <hch@lst.de>,
	Randy Dunlap <rdunlap@xenotime.net>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 0/2] Add struct crypto_alg->cra_check_optimized for crc32c_intel
Date: Thu, 10 Mar 2011 02:05:17 -0800	[thread overview]
Message-ID: <1299751517.5263.60.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <1299748387.5263.45.camel@haakon2.linux-iscsi.org>

On Thu, 2011-03-10 at 01:13 -0800, Nicholas A. Bellinger wrote:
> On Thu, 2011-03-10 at 17:09 +0800, Herbert Xu wrote:
> > On Thu, Mar 10, 2011 at 12:54:24AM -0800, Nicholas A. Bellinger wrote:
> > >
> > > OK, so you mean each struct crypto_alg should define something like a
> > > 'cra_optimized_name' for which request_module(alg->cra_optimized_name)
> > > is called somewhere in libcrypto code..?
> > 
> > No, what I mean is that whenever we look up an algorithm through
> > crypto_alg_mod_lookup, we should conditionally call modprobe if
> > we havn't done so already.
> > 
> > So you just need to record one bit of info in each crypto_alg
> > object to indicate whether we have invoked modprobe.  I suggest
> > adding a CRYPTO_ALG_* bit.
> > 
> 
> Mmmm, now I am really confused, and please let me apologize in advance
> for my lack of experience with libcrypto internals..  ;)
> 
> I thought the problem was that CONFIG_CRYPTO_ALGFOO=y and
> CONFIG_CRYPTO_ALGFOO_ARCH_HW_OFFLOAD=m would cause the latter to not
> explictly call request_module() for this HW offload case..
> 
> So what I don't understand how adding a request_module() call to a list
> of known modules works when crc32c_intel.ko has not been loaded yet..?
> 
> Am I missing something obvious wrt to how crc32c.ko can tell libcrypto
> about which architecture dependent optimized modules it should load..?
> 

Just to clarify a bit on my previous comments..

We are still expecting the libcrypto consumer (iscsi_target_mod.ko) to
call the arch independent crypto_alloc_hash("crc32c", ...) in order to
have libcrypto backend logic perform a request_module() upon
architecture dependent offload modules (like crc32c_intel.ko) that
libcrypto consumers are not (and should not) be calling directly via
crypto_alloc_host("crc32c_intel", ...), correct..?

Where I am getting confused is wrt to a new crypto_alg_mod_lookup() ->
request_module() call for a struct shash_alg that has not yet be loaded
via arch/x86/crypto/crc32c-intel.c:crc32c_intel_mod_init() ->
crypto_register_shash().

Thanks,

--nab

  reply	other threads:[~2011-03-10 10:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10  8:21 [PATCH 0/2] Add struct crypto_alg->cra_check_optimized for crc32c_intel Nicholas A. Bellinger
2011-03-10  8:21 ` [PATCH 1/2] crypto: Add struct crypto_alg->cra_check_optimized Nicholas A. Bellinger
2011-03-10  8:21 ` [PATCH 2/2] crypto/crc32c: Add crc32c_cra_check_optimized for crc32c_intel Nicholas A. Bellinger
2011-03-10  8:43 ` [PATCH 0/2] Add struct crypto_alg->cra_check_optimized " Herbert Xu
2011-03-10  8:54   ` Nicholas A. Bellinger
2011-03-10  9:09     ` Herbert Xu
2011-03-10  9:13       ` Nicholas A. Bellinger
2011-03-10 10:05         ` Nicholas A. Bellinger [this message]
2011-03-13  9:01           ` Herbert Xu
2011-03-14 12:14             ` Nicholas A. Bellinger

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=1299751517.5263.60.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=James.Bottomley@suse.de \
    --cc=hch@lst.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /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