public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: remove double execution of the same test suite
@ 2013-07-18 15:57 Cristian Stoica
  2013-07-19  6:48 ` Horia Geantă
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cristian Stoica @ 2013-07-18 15:57 UTC (permalink / raw)
  To: herbert; +Cc: davem, linux-crypto, linux-kernel, horia.geanta, Cristian Stoica

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 <cristian.stoica@freescale.com>
---
 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



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

* Re: [PATCH] crypto: remove double execution of the same test suite
  2013-07-18 15:57 [PATCH] crypto: remove double execution of the same test suite Cristian Stoica
@ 2013-07-19  6:48 ` Horia Geantă
  2013-07-19  6:52 ` Gupta Ruchika-R66431
  2013-08-01  0:47 ` Herbert Xu
  2 siblings, 0 replies; 6+ messages in thread
From: Horia Geantă @ 2013-07-19  6:48 UTC (permalink / raw)
  To: Cristian Stoica; +Cc: herbert, davem, linux-crypto, linux-kernel

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 <cristian.stoica@freescale.com>

Reviewed-by: Horia Geanta <horia.geanta@freescale.com>

> ---
>   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);
>
>




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

* RE: [PATCH] crypto: remove double execution of the same test suite
  2013-07-18 15:57 [PATCH] crypto: remove double execution of the same test suite Cristian Stoica
  2013-07-19  6:48 ` Horia Geantă
@ 2013-07-19  6:52 ` Gupta Ruchika-R66431
  2013-08-01  0:47 ` Herbert Xu
  2 siblings, 0 replies; 6+ messages in thread
From: Gupta Ruchika-R66431 @ 2013-07-19  6:52 UTC (permalink / raw)
  To: Stoica Cristian-B18196, herbert@gondor.hengli.com.au
  Cc: davem@davemloft.net, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, Geanta Neag Horia Ioan-B05471,
	Stoica Cristian-B18196

Reviewed-by: Ruchika Gupta <ruchika.gupta@freescale.com>

> -----Original Message-----
> From: linux-crypto-owner@vger.kernel.org [mailto:linux-crypto-
> owner@vger.kernel.org] On Behalf Of Cristian Stoica
> Sent: Thursday, July 18, 2013 9:27 PM
> To: herbert@gondor.hengli.com.au
> Cc: davem@davemloft.net; linux-crypto@vger.kernel.org; linux-
> kernel@vger.kernel.org; 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 <cristian.stoica@freescale.com>
> ---
>  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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

* Re: [PATCH] crypto: remove double execution of the same test suite
  2013-07-18 15:57 [PATCH] crypto: remove double execution of the same test suite Cristian Stoica
  2013-07-19  6:48 ` Horia Geantă
  2013-07-19  6:52 ` Gupta Ruchika-R66431
@ 2013-08-01  0:47 ` Herbert Xu
  2013-08-01  8:11   ` Stoica Cristian-B18196
  2 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2013-08-01  0:47 UTC (permalink / raw)
  To: Cristian Stoica; +Cc: davem, linux-crypto, linux-kernel, horia.geanta

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 <cristian.stoica@freescale.com>

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 <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] 6+ messages in thread

* RE: [PATCH] crypto: remove double execution of the same test suite
  2013-08-01  0:47 ` Herbert Xu
@ 2013-08-01  8:11   ` Stoica Cristian-B18196
  2013-08-01 11:37     ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Stoica Cristian-B18196 @ 2013-08-01  8:11 UTC (permalink / raw)
  To: Herbert Xu
  Cc: davem@davemloft.net, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, Geanta Neag Horia Ioan-B05471

> 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.


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

* Re: [PATCH] crypto: remove double execution of the same test suite
  2013-08-01  8:11   ` Stoica Cristian-B18196
@ 2013-08-01 11:37     ` Herbert Xu
  0 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2013-08-01 11:37 UTC (permalink / raw)
  To: Stoica Cristian-B18196
  Cc: davem@davemloft.net, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, Geanta Neag Horia Ioan-B05471

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 <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] 6+ messages in thread

end of thread, other threads:[~2013-08-01 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18 15:57 [PATCH] crypto: remove double execution of the same test suite Cristian Stoica
2013-07-19  6:48 ` Horia Geantă
2013-07-19  6:52 ` Gupta Ruchika-R66431
2013-08-01  0:47 ` Herbert Xu
2013-08-01  8:11   ` Stoica Cristian-B18196
2013-08-01 11:37     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox