hifn(4) and openssl
Eric Auge <[email protected]>
| Newsgroups | gmane.os.netbsd.general,gmane.os.netbsd.devel.crypto |
|---|---|
| Message-ID | <[email protected]> |
Hello, I'm playing with a miniPCI hifn card on some embedded hardware (WRAP / pcengines.ch) currently running NetBSD 4.0_BETA2. [...] hifn0 at pci0 dev 13 function 0: Hifn 7955, rev. 0 hifn0: 3DES/AES, 32KB dram, interrupting at irq 12 [...] I ran openssl speed -engine cryptodev aes-256-cbc (it's just a guess i'm not sure cryptodev is the correct engine, i see ubsec but no hifn engine) here are the result : with hifn(4) : root@earthprout:~ # openssl speed -engine cryptodev aes-256-cbc engine "cryptodev" set. To get the most accurate results, try to run this program when this computer is idle. Doing aes-256 cbc for 3s on 16 size blocks: 258865 aes-256 cbc's in 3.01s Doing aes-256 cbc for 3s on 64 size blocks: 68090 aes-256 cbc's in 3.01s Doing aes-256 cbc for 3s on 256 size blocks: 17289 aes-256 cbc's in 3.01s Doing aes-256 cbc for 3s on 1024 size blocks: 4334 aes-256 cbc's in 3.00s Doing aes-256 cbc for 3s on 8192 size blocks: 538 aes-256 cbc's in 3.01s OpenSSL 0.9.8d 28 Sep 2006 built on: NetBSD 4.0_BETA2 options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) aes(partial) blowfish(ptr2) compiler: gcc version 4.1.2 20061021 (prerelease) (NetBSD nb3 20061125) available timing options: USE_TOD HZ=100 [sysconf value] timing function used: getrusage The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes aes-256 cbc 1378.20k 1449.54k 1472.44k 1477.68k 1464.71k without hifn(4) (on the same hardware configuration) : root@airprout:~ # openssl speed -engine cryptodev aes-256-cbc engine "cryptodev" set. To get the most accurate results, try to run this program when this computer is idle. Doing aes-256 cbc for 3s on 16 size blocks: 259050 aes-256 cbc's in 2.99s Doing aes-256 cbc for 3s on 64 size blocks: 68226 aes-256 cbc's in 3.00s Doing aes-256 cbc for 3s on 256 size blocks: 17312 aes-256 cbc's in 3.00s Doing aes-256 cbc for 3s on 1024 size blocks: 4343 aes-256 cbc's in 3.00s Doing aes-256 cbc for 3s on 8192 size blocks: 538 aes-256 cbc's in 3.00s OpenSSL 0.9.8d 28 Sep 2006 built on: NetBSD 4.0_BETA2 options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) aes(partial) blowfish(ptr2) compiler: gcc version 4.1.2 20061021 (prerelease) (NetBSD nb3 20061125) available timing options: USE_TOD HZ=100 [sysconf value] timing function used: getrusage The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes aes-256 cbc 1385.46k 1457.41k 1475.07k 1480.83k 1470.06k so without hifn(4) is often faster and there is no "unloading" of the CPU on the hifn(4) card, the load is identical on both. checking with ktruss and looking at crypto(4), i see no ioctl(CIOCCRYPT) during the openssl speed test, am i doing things right ? do I miss something ? Regards, Eric.
signature.asc
(application/pgp-signature, 186 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (NetBSD) iD8DBQFFylV6SdZNA80H8MYRAmp1AJsFyDwaOb3jpg7gMVnqqJZJwJzM7wCbBAsm 9QSH429d0D+vKlgALfxX3sg= =g41K -----END PGP SIGNATURE-----