2015-01-19 15:25:50

by Cristian Stoica

[permalink] [raw]
Subject: [PATCH] crypto: testmgr: notify expected failures on aead tests

Some hardware drivers (e.g. caamalg) log failed operations reported by
hw to assist in debugging. However, these messages are confusing when they
are the result of a testmgr test that is expected to fail.

This patch puts the driver messages in their testing context and helps the
user classify them as harmless.

Signed-off-by: Cristian Stoica <[email protected]>
---
crypto/testmgr.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 235b1ff..ec19e98 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -573,9 +573,11 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
if (!ret)
break;
case -EBADMSG:
- if (template[i].novrfy)
- /* verification failure was expected */
+ if (template[i].novrfy) {
+ pr_info("aead%s: expected %s failure on test %d for %s: ret=-EBADMSG\n",
+ d, e, j, algo);
continue;
+ }
/* fall through */
default:
pr_err("alg: aead%s: %s failed on test %d for %s: ret=%d\n",
@@ -723,9 +725,11 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
if (!ret)
break;
case -EBADMSG:
- if (template[i].novrfy)
- /* verification failure was expected */
+ if (template[i].novrfy) {
+ pr_info("aead%s: expected %s failure on test %d for %s: ret=-EBADMSG\n",
+ d, e, j, algo);
continue;
+ }
/* fall through */
default:
pr_err("alg: aead%s: %s failed on chunk test %d for %s: ret=%d\n",
--
2.2.0


2015-01-20 03:35:53

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: testmgr: notify expected failures on aead tests

On Mon, Jan 19, 2015 at 03:54:24PM +0200, Cristian Stoica wrote:
> Some hardware drivers (e.g. caamalg) log failed operations reported by
> hw to assist in debugging. However, these messages are confusing when they
> are the result of a testmgr test that is expected to fail.
>
> This patch puts the driver messages in their testing context and helps the
> user classify them as harmless.
>
> Signed-off-by: Cristian Stoica <[email protected]>

No, I'm not going to create spam in everybody's dmesg just so that
you can make sense of the spam coming from one driver.

If it doesn't make sense on its own then it probably shouldn't be
emitting them. Verification failures are normal events, e.g., you
can get them via packet corruption.

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

2015-01-20 07:59:05

by Cristian Stoica

[permalink] [raw]
Subject: Re: [PATCH] crypto: testmgr: notify expected failures on aead tests

On 01/20/2015 05:35 AM, Herbert Xu wrote:
> No, I'm not going to create spam in everybody's dmesg just so that
> you can make sense of the spam coming from one driver.

Indeed, I found that it makes things far worse for the rest of the
drivers and the clarity improvement is questionable.
It was a bad idea.

Cristian S.