Re: [Ocf-linux-users] Benchmarking issues
Brought to you by:
david-m
From: David M. <dav...@mc...> - 2011-09-01 22:58:22
|
Jivin "Adam Cécile (Le_Vert)" lays it down ... > On 01/09/2011 13:54, David McCullough wrote: > > Jivin "Adam C??cile (Le_Vert)" lays it down ... > >> Hello OCF guys, > >> > >> I'm trying to enable ocf on a Geode LX cpu wich is known to handle > >> aes-128-cbc trhough geode-aes kernel module. > >> I rebuilt linux-3.0 with OCF kernel patch and then rebuilt openssl > >> debian's package with -DHAVE_CRYPTODEV -I$(CURDIR)/debian/includes (this > >> directory contains crypto/cryptodev.h) > >> Then I loaded ocf, cryptosoft and cryptodev kernel modules... > >> > >> Here is the result of my tests using different cipher: > >> > >> # With OpenSSL 1.0.0d cryptodev enabled package > >> # openssl speed -evp<cipher> > >> aes-128-cbc 16761.07k 58822.40k 240275.91k 547942.40k > >> 3126886.40k > >> bf-cbc 13351.73k 67366.40k 191564.80k 715946.67k > >> 1298432.00k > >> des-ede3-cbc 30708.80k 88375.47k 186675.20k > >> 415846.40k infk > >> > >> #rmmod cryptodev > >> aes-128-cbc 3595.73k 3942.16k 4062.50k 8154.89k > >> 8244.06k > >> bf-cbc 8260.17k 10052.27k 10728.30k 10923.12k > >> 10929.06k > >> des-ede3-cbc 1961.65k 2046.67k 2071.55k 2076.43k > >> 2074.03k > >> > >> Results without cryptodev looks fine (slow 500Mhz CPU) but the ones with > >> cryptodev loaded doesn't make any sense ! > >> There's no reason to have such faster blowfish and des results, as the > >> hardware chip only handles aes-128-cbc. > >> Could you please tell me what I'm doing wrong ??? > > Add the "-elapsed" option to openssl speed to get real numbers. > > Otherwise it doesn't count kernel time IIRC, > > > > Cheers, > > Davidm > > > Thanks, it looks a lot better now. > > # With cryptodev loaded: > # openssl speed -elapsed -evp aes-128-cbc > aes-128-cbc 507.31k 1964.05k 7202.05k 19972.10k > 41997.65k > bf-cbc 538.20k 1801.51k 4496.98k 7171.07k > 8672.60k > des-ede3-cbc 410.43k 883.29k 1236.37k 1385.47k > 1436.33k > > # Without cryptodev loaded > aes-128-cbc 3580.90k 3929.60k 4037.89k 8096.77k > 8211.11k > bf-cbc 8249.83k 10068.86k 10702.76k 10904.58k > 10944.51k > des-ede3-cbc 1989.86k 2070.83k 2075.82k 2107.73k > 2106.51k > > Is it normal than I have lower bandwitch with cryptodev when the size is > lower than 256 bytes ? Yes, it's the overhead of copying the data into the kernel and back out. Smaller packets incurrs a higher % overhead per encrypted byte. > Btw, cryptodev seems to be slower than regular openssl on non-hardware > accelerated cipher. Anyway to enable cryptodev ONLY for aes-128-cbc ? Again, its the overhead of copying the data to the kernel. When you do blowfish or similar in user space its the same code with no copies, for cryptodev you need to copy the packet into the kernel, run the cipher, and copy it back, plus encryption setup time. The situation where cryptodev pays off is when you have real crypto hardware and a slow CPU, it frees up CPU time for other tasks and improves speed ;-) There is currently no way to only have cryptodev to AES, though all you need to do is comment out the othe ciphers in cryptosoft and it will only use cryptodev for AES then, the openssl code will automatically fall back to internal crypto if cryptodev doesn't have support for an alg. ;-) Cheers, Davidm -- David McCullough, dav...@mc..., Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org |