AnsweredAssumed Answered

CAAM performance on LTIB 3.0.35  kernel

Question asked by tera teller on Feb 9, 2014
Latest reply on Feb 12, 2014 by Yuri Muhin

Dear All,

 

I have the freescale iMX6 Sabre SD Quadcore board. I downloaded and compiled the 3.0.35 kernel using the LTIB(generated the uImage and uboot) with Ubuntu as the Rootfs.

I then made sure all the CAAM related flags are set in my kernel config. Additionally I set the following 3 flags to support AF_ALG for using the CAAM from openssl.

 

CONFIG_CRYPTO_USER_API=m

CONFIG_CRYPTO_USER_API_HASH=m

CONFIG_CRYPTO_USER_API_SKCIPHER=m


After booting, I downloaded the AF_ALG sources and built the libaf_alg.so and copied it to the "engines" folder on my openssl directory(openssl was already there in the Rootfs by default).


I then tested with & without engine af_alg and I get the same cpu cycles for both.

So now I am puzzled whether my CAAM is being used at all by the af_alg.

 

QUESTION 1: How can I check if my CAAM is being called by the af_alg?

I had set "caam" in my bootargs. If I type /proc/crypto part of the output i see is:

 

name    : sha1
driver  : sha1-caam
module  : kernel
priority: 3000
refcnt  : 1
selftest: passed
type    : ahash
async   : yes
blocksize: 64

digestsize   : 20

name    : ecb(aes)
driver  : ecb-aes-caam
module  : kernel
priority: 3000
refcnt  : 1
selftest: passed
type    : ablkcipher
async   : yes
blocksize: 16

min keysize  : 16

max keysize  : 32

ivsize  : 16
geniv   : eseqiv

 

name    : cbc(aes)
driver  : cbc-aes-caam
module  : kernel
priority: 3000
refcnt  : 1
selftest: passed
type    : ablkcipher
async   : yes
blocksize: 16

min keysize  : 16

max keysize  : 32

ivsize  : 16
geniv   : eseqiv

 

 

Speed test:

openssl speed -evp aes-128-cbc

Doing aes-128-cbc for 3s on 16 size blocks: 3004381 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 64 size blocks: 849813 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 256 size blocks: 220358 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 1024 size blocks: 55605 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 8192 size blocks: 6969 aes-128-cbc's in 3.00s

OpenSSL 1.0.0e 6 Sep 2011

built on: Tue Feb 19 00:08:00 UTC 2013

options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)

compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall

The 'numbers' are in 1000s of bytes per second processed.

type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes

aes-128-cbc      16023.37k    18129.34k    18803.88k    18979.84k    19030.02k

 

With af_alg:

openssl speed -evp aes-128-cbc -e

engine "af_alg" set.

Doing aes-128-cbc for 3s on 16 size blocks: 2998763 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 64 size blocks: 849813 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 256 size blocks: 220357 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 1024 size blocks: 55605 aes-128-cbc's in 3.00s

Doing aes-128-cbc for 3s on 8192 size blocks: 6970 aes-128-cbc's in 3.00s

OpenSSL 1.0.0e 6 Sep 2011

built on: Tue Feb 19 00:08:00 UTC 2013

options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)

compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall

The 'numbers' are in 1000s of bytes per second processed.

type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes

aes-128-cbc      15993.40k    18129.34k    18803.80k    18979.84k    19032.75k

 

 

QUESTION 2: Are there some "CAAM commands" or test program at the kernel level to run JUST CAAM and test?

Thanks in advance.

 

Tera


Outcomes