Commit 1bc55f79 authored by Andreas Dilger's avatar Andreas Dilger Committed by Greg Kroah-Hartman

staging: lustre: libcfs: calculate crypto performance using pages

Use alloc_page() and use cfs_crypto_hash_update_page()
to compute the hash instead of cfs_crypto_hash_digest(), since
tgt_checksum_bulk() computes the hash by page anyway.
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5279
Reviewed-on: http://review.whamcloud.com/10982Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@gmail.com>
Reviewed-by: default avatarAlexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78675cb1
...@@ -330,8 +330,23 @@ static void cfs_crypto_performance_test(enum cfs_crypto_hash_alg hash_alg) ...@@ -330,8 +330,23 @@ static void cfs_crypto_performance_test(enum cfs_crypto_hash_alg hash_alg)
for (start = jiffies, end = start + sec * HZ, bcount = 0; for (start = jiffies, end = start + sec * HZ, bcount = 0;
time_before(jiffies, end); bcount++) { time_before(jiffies, end); bcount++) {
err = cfs_crypto_hash_digest(hash_alg, buf, buf_len, NULL, 0, struct cfs_crypto_hash_desc *hdesc;
hash, &hash_len); int i;
hdesc = cfs_crypto_hash_init(hash_alg, NULL, 0);
if (IS_ERR(hdesc)) {
err = PTR_ERR(hdesc);
break;
}
for (i = 0; i < buf_len / PAGE_SIZE; i++) {
err = cfs_crypto_hash_update_page(hdesc, page, 0,
PAGE_SIZE);
if (err)
break;
}
err = cfs_crypto_hash_final(hdesc, hash, &hash_len);
if (err) if (err)
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment