* [PATCH] crypto: tcrypt speed: fix filter for aead algorithms
@ 2015-02-03 13:59 Cristian Stoica
2015-02-27 9:25 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: Cristian Stoica @ 2015-02-03 13:59 UTC (permalink / raw)
To: herbert, linux-crypto; +Cc: davem, Cristian Stoica
test_aead_speed is written for sync algorithms without specifically
requiring them. The effect is that an async algorithm may be used without
setting up the request callback, this leading to a kernel panic.
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
---
crypto/tcrypt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 4b9e23f..5dc5a25 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -314,7 +314,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
asg = &sg[8];
sgout = &asg[8];
- tfm = crypto_alloc_aead(algo, 0, 0);
+ /* This test is not for ASYNC algorithms */
+ tfm = crypto_alloc_aead(algo, 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(tfm)) {
pr_err("alg: aead: Failed to load transform for %s: %ld\n", algo,
--
2.0.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: tcrypt speed: fix filter for aead algorithms
2015-02-03 13:59 [PATCH] crypto: tcrypt speed: fix filter for aead algorithms Cristian Stoica
@ 2015-02-27 9:25 ` Herbert Xu
2015-02-27 11:14 ` Cristian Stoica
0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2015-02-27 9:25 UTC (permalink / raw)
To: Cristian Stoica; +Cc: linux-crypto, davem
On Tue, Feb 03, 2015 at 03:59:48PM +0200, Cristian Stoica wrote:
> test_aead_speed is written for sync algorithms without specifically
> requiring them. The effect is that an async algorithm may be used without
> setting up the request callback, this leading to a kernel panic.
>
> Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Please fix it to test asynchronously instead.
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
* Re: [PATCH] crypto: tcrypt speed: fix filter for aead algorithms
2015-02-27 9:25 ` Herbert Xu
@ 2015-02-27 11:14 ` Cristian Stoica
2015-02-28 9:13 ` Herbert Xu
0 siblings, 1 reply; 4+ messages in thread
From: Cristian Stoica @ 2015-02-27 11:14 UTC (permalink / raw)
To: Herbert Xu; +Cc: linux-crypto, davem
Hi Herbert,
On 02/27/2015 11:25 AM, Herbert Xu wrote:
> On Tue, Feb 03, 2015 at 03:59:48PM +0200, Cristian Stoica wrote:
>> test_aead_speed is written for sync algorithms without specifically
[...]
> Please fix it to test asynchronously instead.
Thanks for review.
I think that a fix for async aead requires a different test function as
is the case with test_cipher_speed/test_acipher_speed and also with
test_hash_speed/test_ahash_speed.
But I see a issue here with the current async tests:
int test_acipher_cycles(...)
{
for (i = 0; i < 8; i++) {
[...]
ret = do_one_acipher_op(req, crypto_ablkcipher_encrypt(req));
[...]
}
}
and in do_one_acipher_op we wait for completion of
crypto_ablkcipher_encrypt:
if (ret == -EINPROGRESS || ret == -EBUSY) {
struct tcrypt_result *tr = req->base.data;
ret = wait_for_completion_interruptible(&tr->completion);
}
Doesn't this defeat the purpose of async execution?
Cristian S.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: tcrypt speed: fix filter for aead algorithms
2015-02-27 11:14 ` Cristian Stoica
@ 2015-02-28 9:13 ` Herbert Xu
0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2015-02-28 9:13 UTC (permalink / raw)
To: Cristian Stoica; +Cc: linux-crypto, davem
On Fri, Feb 27, 2015 at 01:14:20PM +0200, Cristian Stoica wrote:
> Hi Herbert,
>
> On 02/27/2015 11:25 AM, Herbert Xu wrote:
> > On Tue, Feb 03, 2015 at 03:59:48PM +0200, Cristian Stoica wrote:
> >> test_aead_speed is written for sync algorithms without specifically
> [...]
> > Please fix it to test asynchronously instead.
>
> Thanks for review.
>
> I think that a fix for async aead requires a different test function as
> is the case with test_cipher_speed/test_acipher_speed and also with
> test_hash_speed/test_ahash_speed.
>
> But I see a issue here with the current async tests:
>
> int test_acipher_cycles(...)
> {
> for (i = 0; i < 8; i++) {
> [...]
> ret = do_one_acipher_op(req, crypto_ablkcipher_encrypt(req));
> [...]
> }
> }
>
> and in do_one_acipher_op we wait for completion of
> crypto_ablkcipher_encrypt:
>
> if (ret == -EINPROGRESS || ret == -EBUSY) {
> struct tcrypt_result *tr = req->base.data;
> ret = wait_for_completion_interruptible(&tr->completion);
> }
>
> Doesn't this defeat the purpose of async execution?
We're trying to measure the minimum amount of time it takes
for the implementation to handle one request so waiting for
completion makes sense.
Cheers,
--
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:[~2015-02-28 9:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-03 13:59 [PATCH] crypto: tcrypt speed: fix filter for aead algorithms Cristian Stoica
2015-02-27 9:25 ` Herbert Xu
2015-02-27 11:14 ` Cristian Stoica
2015-02-28 9:13 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).