mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Linux 2.6 crypto API and HW accelerators
@ 2004-05-04 13:39 remy.gauguey
  2004-05-04 16:17 ` Eugene Surovegin
  2004-05-04 19:40 ` James Morris
  0 siblings, 2 replies; 4+ messages in thread
From: remy.gauguey @ 2004-05-04 13:39 UTC (permalink / raw)
  To: linux-crypto; +Cc: linux-kernel

Hi,

I'm currently working on a ARM920T based network processor with arm-linux
kernel 2.6.5.
This device has a crypto hardware accelerator dedicated to IPsec.
In ESP mode the device can do authentication (SHA-1, MD5) as well as
encryption (AES, TDES in CBC or ECB mode) in one pass.
Unfortunately current Linux 2.6 crypto API doesn't support this kind of
hardware accelerator. Current crypto module relies on crypto algorithms
which are called for a single operation and for each block.

Then, I would like to know if other people are working on the hardware
crypto support in kernel 2.6.x.
If so, what would be the plan ? crypto api improvement or new IPsec
specific hardware support ?

Thanks for any feedback or info.

Remy Gauguey





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 2.6 crypto API and HW accelerators
  2004-05-04 13:39 Linux 2.6 crypto API and HW accelerators remy.gauguey
@ 2004-05-04 16:17 ` Eugene Surovegin
  2004-05-04 19:53   ` James Morris
  2004-05-04 19:40 ` James Morris
  1 sibling, 1 reply; 4+ messages in thread
From: Eugene Surovegin @ 2004-05-04 16:17 UTC (permalink / raw)
  To: remy.gauguey; +Cc: linux-crypto, linux-kernel

On Tue, May 04, 2004 at 03:39:35PM +0200, remy.gauguey@mindspeed.com wrote:
> I'm currently working on a ARM920T based network processor with arm-linux
> kernel 2.6.5.
> This device has a crypto hardware accelerator dedicated to IPsec.
> In ESP mode the device can do authentication (SHA-1, MD5) as well as
> encryption (AES, TDES in CBC or ECB mode) in one pass.
> Unfortunately current Linux 2.6 crypto API doesn't support this kind of
> hardware accelerator. Current crypto module relies on crypto algorithms
> which are called for a single operation and for each block.
> 
> Then, I would like to know if other people are working on the hardware
> crypto support in kernel 2.6.x.
> If so, what would be the plan ? crypto api improvement or new IPsec
> specific hardware support ?
> 

I wrote a driver recently for Hifn 7955 crypto processor for use in low-end PPC 
box (PPC 440, 500Mhz).

I added simple extension for current Crypto API, basically a pass-through path.

Patches can be found and http://kernel.ebshome.net (patches are of alpha 
quality, and were never tested on x86 :)

In short, my experience showed that without significant changes in current 
implementation, e.g. adding async crypto, adding hardware crypto is worth only 
for relatively slow CPUs, e.g. less than 1Ghz, and even with slow processor 
overhead can be so big, that short packets are better processed by software 
path.

As a side note, in addition to the limitation you noticed (sw crypto is called 
for one block), there are another one, currently Linux IPSec implementation 
always calls Crypto layer holding BH lock, so hw crypto driver have to busy wait 
even when called from process context. Maybe this can be easily changed.

Feel free to contact me privately if you need more information :)

Eugene


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 2.6 crypto API and HW accelerators
  2004-05-04 13:39 Linux 2.6 crypto API and HW accelerators remy.gauguey
  2004-05-04 16:17 ` Eugene Surovegin
@ 2004-05-04 19:40 ` James Morris
  1 sibling, 0 replies; 4+ messages in thread
From: James Morris @ 2004-05-04 19:40 UTC (permalink / raw)
  To: remy.gauguey; +Cc: linux-crypto, linux-kernel

On Tue, 4 May 2004 remy.gauguey@mindspeed.com wrote:

> Then, I would like to know if other people are working on the hardware
> crypto support in kernel 2.6.x.

I've heard of about 30 people saying they intend to work on it.

> If so, what would be the plan ? crypto api improvement or new IPsec
> specific hardware support ?

Here are some requirements and discussion summary:
http://samba.org/~jamesm/crypto/hardware_notes.txt


- James
-- 
James Morris
<jmorris@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 2.6 crypto API and HW accelerators
  2004-05-04 16:17 ` Eugene Surovegin
@ 2004-05-04 19:53   ` James Morris
  0 siblings, 0 replies; 4+ messages in thread
From: James Morris @ 2004-05-04 19:53 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: remy.gauguey, linux-crypto, linux-kernel

On Tue, 4 May 2004, Eugene Surovegin wrote:

> In short, my experience showed that without significant changes in current 
> implementation, e.g. adding async crypto, adding hardware crypto is worth only 
> for relatively slow CPUs, e.g. less than 1Ghz, and even with slow processor 
> overhead can be so big, that short packets are better processed by software 
> path.

Yes, have a look at the OpenBSD paper at 
http://www.openbsd.org/papers/ocf.pdf

Their results show marked performance improvements for larger packets
(even though the packets are making multiple trips across the PCI bus),
and they suggest batching smaller packets.


- James
-- 
James Morris
<jmorris@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-04 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-04 13:39 Linux 2.6 crypto API and HW accelerators remy.gauguey
2004-05-04 16:17 ` Eugene Surovegin
2004-05-04 19:53   ` James Morris
2004-05-04 19:40 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®