Whamcloud - gitweb
LU-5279 crypto: no vmalloc() for speed test buffer 82/10982/3
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 3 Jul 2014 19:25:56 +0000 (13:25 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 7 Jul 2014 15:20:00 +0000 (15:20 +0000)
commitd3e9d454964e44e9cb6e457923fa5a0cdf021094
tree59eb7a2f4c0752bf8f5b6073ca0f3f896f159be9
parent2de680e8400b662808a2a978fb1036542f2facbe
LU-5279 crypto: no vmalloc() for speed test buffer

Since the patch LU-5053 "libcfs: clean up cfs_crypto_hash code"
(commit 0723b8be34503b31dbfc6c877d7a855091c625b4) was landed the
cfs_crypto_performance_test() code can fail if CONFIG_DEBUG_VIRTUAL
is enabled.  This causes problems in SG handling because it expects
physical addresses:

    kernel BUG at arch/x86/mm/physaddr.c:20!
    RIP: 0010:[<ffffffff81050447>] __phys_addr+0x67/0x80

    sg_init_one+0x36/0x80
    cfs_crypto_hash_digest+0x94/0xf0 [libcfs]
    cfs_crypto_register+0x108/0x330 [libcfs]
    init_libcfs_module+0x0/0x3c0 [libcfs]
    sys_init_module+0xe3/0x260

Don't use vmalloc() to allocate the cfs_crypto_test_hashes()
test buffer.  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: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I27ec3cf2931b6bf385dd91191abba8955b500c1e
Reviewed-on: http://review.whamcloud.com/10982
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/libcfs_crypto.h
libcfs/libcfs/linux/linux-crypto.c
libcfs/libcfs/user-crypto.c