2022-10-26 19:40:10

by Anirudh Venkataramanan

[permalink] [raw]
Subject: [PATCH v2 0/4] Printing improvements for tcrypt

The text tcrypt prints to dmesg is a bit inconsistent. This makes it
difficult to process tcrypt results using scripts. This little series
makes the prints more consistent.

Changes v1 -> v2: Rebase to tag v6.1-p2, resolve conflict in patch 2/4

Anirudh Venkataramanan (4):
crypto: tcrypt - Use pr_cont to print test results
crypto: tcrypt - Use pr_info/pr_err
crypto: tcrypt - Drop module name from print string
crypto: tcrypt - Drop leading newlines from prints

crypto/tcrypt.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)

--
2.37.2



2022-10-26 19:42:46

by Anirudh Venkataramanan

[permalink] [raw]
Subject: [PATCH v2 1/4] crypto: tcrypt - Use pr_cont to print test results

For some test cases, a line break gets inserted between the test banner
and the results. For example, with mode=211 this is the output:

[...]
testing speed of rfc4106(gcm(aes)) (rfc4106-gcm-aesni) encryption
[...] test 0 (160 bit key, 16 byte blocks):
[...] 1 operation in 2373 cycles (16 bytes)

--snip--

[...]
testing speed of gcm(aes) (generic-gcm-aesni) encryption
[...] test 0 (128 bit key, 16 byte blocks):
[...] 1 operation in 2338 cycles (16 bytes)

Similar behavior is seen in the following cases as well:

modprobe tcrypt mode=212
modprobe tcrypt mode=213
modprobe tcrypt mode=221
modprobe tcrypt mode=300 sec=1
modprobe tcrypt mode=400 sec=1

This doesn't happen with mode=215:

[...] tcrypt:
testing speed of multibuffer rfc4106(gcm(aes)) (rfc4106-gcm-aesni) encryption
[...] tcrypt: test 0 (160 bit key, 16 byte blocks): 1 operation in 2215 cycles (16 bytes)

--snip--

[...] tcrypt:
testing speed of multibuffer gcm(aes) (generic-gcm-aesni) encryption
[...] tcrypt: test 0 (128 bit key, 16 byte blocks): 1 operation in 2191 cycles (16 bytes)

This print inconsistency is because printk() is used instead of pr_cont()
in a few places. Change these to be pr_cont().

checkpatch warns that pr_cont() shouldn't be used. This can be ignored in
this context as tcrypt already uses pr_cont().

Signed-off-by: Anirudh Venkataramanan <[email protected]>
---
Changes v1 -> v2: Rebase to tag v6.1-p2
---
crypto/tcrypt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index a82679b..6aed45c 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -506,8 +506,8 @@ static int test_aead_cycles(struct aead_request *req, int enc, int blen)

out:
if (ret == 0)
- printk("1 operation in %lu cycles (%d bytes)\n",
- (cycles + 4) / 8, blen);
+ pr_cont("1 operation in %lu cycles (%d bytes)\n",
+ (cycles + 4) / 8, blen);

return ret;
}
@@ -727,8 +727,8 @@ static int test_ahash_jiffies_digest(struct ahash_request *req, int blen,
return ret;
}

- printk("%6u opers/sec, %9lu bytes/sec\n",
- bcount / secs, ((long)bcount * blen) / secs);
+ pr_cont("%6u opers/sec, %9lu bytes/sec\n",
+ bcount / secs, ((long)bcount * blen) / secs);

return 0;
}
--
2.37.2


2022-11-04 09:46:41

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] Printing improvements for tcrypt

On Wed, Oct 26, 2022 at 12:16:12PM -0700, Anirudh Venkataramanan wrote:
> The text tcrypt prints to dmesg is a bit inconsistent. This makes it
> difficult to process tcrypt results using scripts. This little series
> makes the prints more consistent.
>
> Changes v1 -> v2: Rebase to tag v6.1-p2, resolve conflict in patch 2/4
>
> Anirudh Venkataramanan (4):
> crypto: tcrypt - Use pr_cont to print test results
> crypto: tcrypt - Use pr_info/pr_err
> crypto: tcrypt - Drop module name from print string
> crypto: tcrypt - Drop leading newlines from prints
>
> crypto/tcrypt.c | 31 +++++++++++++++----------------
> 1 file changed, 15 insertions(+), 16 deletions(-)
>
> --
> 2.37.2

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