AnsweredAssumed Answered

CAAM cryptodev speed

Question asked by Yiling Xu on Dec 27, 2018

I run Linux version 4.9.11-1.0.0 on Imx6q, I want to see whether cryptodev can speed up encryption/decryption.

 

I do this test many times, only one time the test result match what  "i.mx_Linux_User's_Guide.pdf " suggests I should see(Start cryptodev will accelerate encryption/decryption).  Others show me a different story, It seems cryptodev doesn't work at all. What's wrong?

The test results as follow:

root@imx6qsabresd:~# modprobe -r cryptodev
cryptodev: driver unloaded.
root@imx6qsabresd:~# sudo openssl speed -evp aes-128-cbc -engine cryptodev
invalid engine "cryptodev"
1995609296:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:187:filename(/usr/lib/engines/libcryptodev.so): /usr/lib/engines/libcryptodev.so: cannot open shared object file: No such file or directory
1995609296:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:233:
1995609296:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:467:
1995609296:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:390:id=cryptodev
1995609296:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:187:filename(libcryptodev.so): libcryptodev.so: cannot open shared object file: No such file or directory
1995609296:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:233:
1995609296:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:467:
Doing aes-128-cbc for 3s on 16 size blocks: 5529706 aes-128-cbc's in 2.99s
Doing aes-128-cbc for 3s on 64 size blocks: 1580875 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 410234 aes-128-cbc's in 2.99s
Doing aes-128-cbc for 3s on 1024 size blocks: 103837 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 13062 aes-128-cbc's in 3.00s
OpenSSL 1.0.2j 26 Sep 2016
......


root@imx6qsabresd:~# modprobe cryptodev
cryptodev: driver 1.8 loaded.
root@imx6qsabresd:~# sudo openssl speed -evp aes-128-cbc -engine cryptodev
engine "cryptodev" set.
Doing aes-128-cbc for 3s on 16 size blocks: 5536156 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 1579256 aes-128-cbc's in 2.99s
Doing aes-128-cbc for 3s on 256 size blocks: 411891 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 103832 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 13003 aes-128-cbc's in 3.00s
OpenSSL 1.0.2j 26 Sep 2016
......

 

root@imx6qsabresd:~# lsmod
Module Size Used by
cryptodev 38503 0
ov5642_camera 78301 0
mxc_v4l2_capture 25674 0
ipu_bg_overlay_sdc 6400 1 mxc_v4l2_capture
ipu_still 2480 1 mxc_v4l2_capture
ipu_prp_enc 6956 1 mxc_v4l2_capture
ipu_csi_enc 4143 1 mxc_v4l2_capture
ipu_fg_overlay_sdc 7062 1 mxc_v4l2_capture
ov5640_camera_mipi_int 23334 0
ov5640_camera_int 20623 0
v4l2_int_device 3121 4 ov5642_camera,ov5640_camera_mipi_int,ov5640_camera_int,mxc_v4l2_capture
mxc_dcic 6640 0
galcore 353929 10

Outcomes