This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

openssl performance with HWA

Other Parts Discussed in Thread: AM3352

We are developing a AM3352 based system (600MHz AM3352, 256MB DDR3 RAM @ 400MHz) using TISDK 7.

I was looking at the openssl performance.

I have all the HW crypto devices enabled

[    1.555796] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    1.563542] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2

Without HWA, when I run the openssl speed test on my system, I got 

 /data/openssl speed aes-128-cbc
Doing aes-128 cbc for 3s on 16 size blocks: 3661531 aes-128 cbc's in 2.67s
Doing aes-128 cbc for 3s on 64 size blocks: 1053015 aes-128 cbc's in 2.72s
Doing aes-128 cbc for 3s on 256 size blocks: 271544 aes-128 cbc's in 2.72s
Doing aes-128 cbc for 3s on 1024 size blocks: 67632 aes-128 cbc's in 2.67s
Doing aes-128 cbc for 3s on 8192 size blocks: 8261 aes-128 cbc's in 2.70s
OpenSSL 1.0.1j 15 Oct 2014
built on: Wed Feb 11 08:09:42 CST 2015
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) idea(int) blowfish(ptr)
compiler: arm-linux-gnueabihf-gcc  -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN   -DTERMIO  -isystem/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/include  -fstack-protector -O2 -pipe -g -feliminate-unused-debug-types -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-128 cbc      21941.76k    24776.82k    25557.08k    25938.27k    25064.49k

I managed to get cryptodev-linux-1.8 compiled, after inserting the module, I got

root@LiteOn-SMC:/data# insmod cryptodev.ko
[249879.322715] cryptodev: driver 1.8 loaded.

And I can now see the device /dev/crypto.

However, when I run the speed test again, I got the pretty much the same result as without HWA.

/data/openssl speed aes-128-cbc -engine cryptodev
engine "cryptodev" set.
Doing aes-128 cbc for 3s on 16 size blocks: 3688771 aes-128 cbc's in 2.70s
Doing aes-128 cbc for 3s on 64 size blocks: 1037785 aes-128 cbc's in 2.69s
Doing aes-128 cbc for 3s on 256 size blocks: 271045 aes-128 cbc's in 2.70s
Doing aes-128 cbc for 3s on 1024 size blocks: 68526 aes-128 cbc's in 2.70s
Doing aes-128 cbc for 3s on 8192 size blocks: 8577 aes-128 cbc's in 2.70s
OpenSSL 1.0.1j 15 Oct 2014
built on: Wed Feb 11 08:09:42 CST 2015
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) idea(int) blowfish(ptr)
compiler: arm-linux-gnueabihf-gcc  -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN   -DTERMIO  -isystem/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/include  -fstack-protector -O2 -pipe -g -feliminate-unused-debug-types -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-128 cbc      21859.38k    24690.80k    25699.08k    25989.12k    26023.25k

I thought that HWA should give me much better performance.

There is no error message from the console, so I am not sure how to interpret the result.

Your help are greatly appreciated.

Jing