[Ilugc] Asynchronous Crypto suppor for MPC8360E's Security Engine

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Thu Jan 4 06:53:38 2007

On Wed, Jan 03, 2007 at 04:38:02PM +0530, n.balaji@xxxxxxxxxxxxx wrote:

Hi,
  I am working on MPC8360E Security Engine. I have ported the Openswan
2.4.5(IPSec --KLIPS) with OCF to MPC8360E's Security Engine (Talitos).
Encryption and Decryption is working. But when I check the performance of
Talitos with netio benchmark Tool, IPSec S/W Algorithms is giving more
bandwidth than Talitos.
  I do not know that why Talitos is giving less bandwidth and any probelm
in Openswan or OCF or Talitos driver or Talitos H/W. Please give your
suggestions and if you have any link related to Talitos, send to me.
If you know any benchmark tool like netio, inform to me.

  Linux kernel version is 2.6.11.

  I tested the IPSec performance by netio tool. The output is

Without IPSec :
-------------
Packet size  1k bytes:  8735 KByte/s Tx,  11242 KByte/s Rx.
Packet size  2k bytes:  8723 KByte/s Tx,  11001 KByte/s Rx.
Packet size  4k bytes:  8730 KByte/s Tx,  10159 KByte/s Rx.
Packet size  8k bytes:  8762 KByte/s Tx,  10986 KByte/s Rx.
Packet size 16k bytes:  8725 KByte/s Tx,  10997 KByte/s Rx.
Packet size 32k bytes:  8725 KByte/s Tx,  11002 KByte/s Rx.

IPSec in S/W :
------------
Packet size  1k bytes:  884 KByte/s Tx,  1120 KByte/s Rx.
Packet size  2k bytes:  1234 KByte/s Tx,  1149 KByte/s Rx.
Packet size  4k bytes:  1209 KByte/s Tx,  1178 KByte/s Rx.
Packet size  8k bytes:  885 KByte/s Tx,  1155 KByte/s Rx.
Packet size 16k bytes:  1184 KByte/s Tx,  1197 KByte/s Rx.
Packet size 32k bytes:  1194 KByte/s Tx,  1206 KByte/s Rx.

IPSec in H/W :
-------------
Packet size  1k bytes:  55978 Byte/s Tx,  484 KByte/s Rx.
Packet size  2k bytes:  57685 Byte/s Tx,  577 KByte/s Rx.
Packet size  4k bytes:  57344 Byte/s Tx,  812 KByte/s Rx.
Packet size  8k bytes:  58709 Byte/s Tx,  438 KByte/s Rx.
Packet size 16k bytes:  60074 Byte/s Tx,  627 KByte/s Rx.
Packet size 32k bytes:  60072 Byte/s Tx,  575 KByte/s Rx.

 I sholud get more bandwidth when I test through IPSec H/W. But I am
getting less bandwidth compare to IPSec S/W.

 But When I transmit 32 MB size file through tftp, it is transmitted in
139.0 seconds in IPSec S/W. When we transmit the same file, it is
transmitted in 136.2 seconds in IPSec H/W.

 When I ping the system, I got the reply in 2ms in IPSec S/W and 1ms in
IPSec H/W.


Okay, performance measurement and improvement is always a tricky affair. You 
have to be prepared for surprises and shocks. :)

I am not  sure what the issue is here but your numbers  are definitely screwed  
up. You should get close to the same throughput you would get without IPsec if 
you have hardware acceleration.

I used to measure with the Openssl speed command and it used to give pretty 
good results with crypto acceleration.

In your case also the underlying acceleration mechanism will be quite similar, 
but you are using IPsec instead of SSL.

Can you use other tools for measuring? And do all kind of sanity checks? I had 
a severe performance issue when  I was not using the right optimization flags 
to the compiler.

In your case you have to check for the DMA throughput. Is the crypto 
acceleration getting all the resources it needs to do  a good job?

And you have to take multiple samples. And figure out the standard deviation or 
something. Just a one off test will not be accurate.

Can you do more testing please and if possible share the documentation on how 
the crypto chip interacts with your processor?

Does it use the PCKS#11 interface thro' a shared library? Does it get the 
microcode from somewhere?

More details will certainly help us conclude.

Best of luck!

regards,
Girish

Other related posts: