2013-07-18 16:10:54

by Cristian Stoica

[permalink] [raw]
Subject: [PATCH] crypto: remove double execution of the same test suite

This patch removes redundant execution of the same test suite in cases
where alg and driver variables are the same (e.g. when alg_test is
called from tcrypt_test)

Signed-off-by: Cristian Stoica <[email protected]>
---
crypto/testmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 2f00607..e091ef6 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -3234,7 +3234,7 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
if (i >= 0)
rc |= alg_test_descs[i].test(alg_test_descs + i, driver,
type, mask);
- if (j >= 0)
+ if (j >= 0 && j != i)
rc |= alg_test_descs[j].test(alg_test_descs + j, driver,
type, mask);

--
1.8.1.5


2013-07-19 06:49:08

by Horia Geantă

[permalink] [raw]
Subject: Re: [PATCH] crypto: remove double execution of the same test suite

On 7/18/2013 6:57 PM, Cristian Stoica wrote:
> This patch removes redundant execution of the same test suite in cases
> where alg and driver variables are the same (e.g. when alg_test is
> called from tcrypt_test)
>
> Signed-off-by: Cristian Stoica <[email protected]>

Reviewed-by: Horia Geanta <[email protected]>

> ---
> crypto/testmgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index 2f00607..e091ef6 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -3234,7 +3234,7 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
> if (i >= 0)
> rc |= alg_test_descs[i].test(alg_test_descs + i, driver,
> type, mask);
> - if (j >= 0)
> + if (j >= 0 && j != i)
> rc |= alg_test_descs[j].test(alg_test_descs + j, driver,
> type, mask);
>
>


2013-07-19 06:52:50

by Gupta Ruchika-R66431

[permalink] [raw]
Subject: RE: [PATCH] crypto: remove double execution of the same test suite

Reviewed-by: Ruchika Gupta <[email protected]>

> -----Original Message-----
> From: [email protected] [mailto:linux-crypto-
> [email protected]] On Behalf Of Cristian Stoica
> Sent: Thursday, July 18, 2013 9:27 PM
> To: [email protected]
> Cc: [email protected]; [email protected]; linux-
> [email protected]; Geanta Neag Horia Ioan-B05471; Stoica Cristian-
> B18196
> Subject: [PATCH] crypto: remove double execution of the same test suite
>
> This patch removes redundant execution of the same test suite in cases where
> alg and driver variables are the same (e.g. when alg_test is called from
> tcrypt_test)
>
> Signed-off-by: Cristian Stoica <[email protected]>
> ---
> crypto/testmgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 2f00607..e091ef6
> 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -3234,7 +3234,7 @@ int alg_test(const char *driver, const char *alg, u32
> type, u32 mask)
> if (i >= 0)
> rc |= alg_test_descs[i].test(alg_test_descs + i, driver,
> type, mask);
> - if (j >= 0)
> + if (j >= 0 && j != i)
> rc |= alg_test_descs[j].test(alg_test_descs + j, driver,
> type, mask);
>
> --
> 1.8.1.5
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2013-08-01 00:48:05

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: remove double execution of the same test suite

On Thu, Jul 18, 2013 at 06:57:07PM +0300, Cristian Stoica wrote:
> This patch removes redundant execution of the same test suite in cases
> where alg and driver variables are the same (e.g. when alg_test is
> called from tcrypt_test)
>
> Signed-off-by: Cristian Stoica <[email protected]>

Which algorithm (apart from crc* which I know and will fix) uses the
same driver name as its algorithm name? Doing this will cause issues
when an alternative implementation for that algorithm gets added.

Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2013-08-01 08:11:40

by Stoica Cristian-B18196

[permalink] [raw]
Subject: RE: [PATCH] crypto: remove double execution of the same test suite

> Which algorithm (apart from crc* which I know and will fix) uses the
> same driver name as its algorithm name? Doing this will cause issues
> when an alternative implementation for that algorithm gets added.

Fixing names resolves double calls only for the thread cryptomgr_test->alg_test where the call is:
err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED);

It doesn't fix the thread tcrypt_test->alg_test where the call is:
ret = alg_test(alg, alg, 0, 0);

Cristian S.

2013-08-01 11:37:54

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: remove double execution of the same test suite

On Thu, Aug 01, 2013 at 08:11:25AM +0000, Stoica Cristian-B18196 wrote:
> > Which algorithm (apart from crc* which I know and will fix) uses the
> > same driver name as its algorithm name? Doing this will cause issues
> > when an alternative implementation for that algorithm gets added.
>
> Fixing names resolves double calls only for the thread cryptomgr_test->alg_test where the call is:
> err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED);
>
> It doesn't fix the thread tcrypt_test->alg_test where the call is:
> ret = alg_test(alg, alg, 0, 0);

Good point. I'll apply your patch.

Thanks!
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt