2012-03-28 11:53:41

by Sebastien Agnolini

[permalink] [raw]
Subject: Old PADATA patch vs crypto-2.6 tree

Hey,

How activate the IPsec parallelization ?
I compiled the crypto-2.6 kernel with this param :
CONFIG_CRYPTO_... = y
CONFIG_PADATA = y
CONFIG_SMP=y
After installation on 2 servers (IPSEC tunnel), i don't detect the IPsec
parallelization.
The algorithm is loaded (present in /proc/crypto), but only one core works.

So, What are the other parameters that I forgot for the compilation of the
kernel? IRQ, IO, Scheduler parameters... Am i missing something ?
I thought that the parallelization was automatically started. True ?
What are the conditions to observe a parallel work ?
A "little" documentation will be Welcome.

I'd like compare the bandwidth of my test platform using the ? old ? PADATA
patch.

Sebastien


2012-03-29 18:48:59

by Hamid Nassiby

[permalink] [raw]
Subject: Re: Old PADATA patch vs crypto-2.6 tree

You must instantiate pcrypt using crconf app or tcrypt module;

On Wed, Mar 28, 2012 at 4:23 PM, Sebastien Agnolini
<[email protected]> wrote:
>
> Hey,
>
> How activate the IPsec parallelization ?
> I compiled the crypto-2.6 kernel with this param :
> CONFIG_CRYPTO_... = y
> CONFIG_PADATA = y
> CONFIG_SMP=y
> After installation on 2 servers (IPSEC tunnel), i don't detect the IPsec
> parallelization.
> The algorithm is loaded (present in /proc/crypto), but only one core works.
>
> So, What are the other parameters that I forgot for the compilation of the
> kernel? IRQ, IO, Scheduler parameters... Am i missing something ?
> I thought that the parallelization was automatically started. True ?
> What are the conditions to observe a parallel work ?
> A "little" documentation will be Welcome.
>
> I'd like compare the bandwidth of my test platform using the ? old ? PADATA
> patch.
>
> Sebastien
> --
> To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html

2012-03-30 09:30:16

by Steffen Klassert

[permalink] [raw]
Subject: Re: Old PADATA patch vs crypto-2.6 tree

On Wed, Mar 28, 2012 at 01:53:41PM +0200, Sebastien Agnolini wrote:
> Hey,
>
> How activate the IPsec parallelization ?

You need to instantiate pcrypt.

You need either crconf (linux-3.2 or newer with the crypto userconfig
api enabled) or the tcrypt module to instantiate pcrypt.

With crconf:

You can get crconf from https://sourceforge.net/projects/crconf/
Use the git tree for the newest version. After installing crconf
do e.g.

crconf add driver "pcrypt(authenc(hmac(sha1-generic),cbc(aes-asm)))" type 3


With tcrypt:

modprobe tcrypt alg="pcrypt(authenc(hmac(sha1-generic),cbc(aes-asm)))" type=3

The modprobe will return with an error, don't worry about it, thats ok.



Once you've did one of the above, your /proc/crypto should show
something like:

name : authenc(hmac(sha1),cbc(aes))
driver : pcrypt(authenc(hmac(sha1-generic),cbc(aes-asm)))
module : pcrypt
priority : 2100
refcnt : 1
selftest : passed
type : aead
async : yes
blocksize : 16
ivsize : 16
maxauthsize : 20
geniv : <built-in>


Now pcrypt is instantiated, e.g. all new IPsec states (that do
hmac-sha1, cbc-aes) will use it.


> I compiled the crypto-2.6 kernel with this param :
> CONFIG_CRYPTO_... = y
> CONFIG_PADATA = y
> CONFIG_SMP=y
> After installation on 2 servers (IPSEC tunnel), i don't detect the IPsec
> parallelization.
> The algorithm is loaded (present in /proc/crypto), but only one core works.
>
> So, What are the other parameters that I forgot for the compilation of the
> kernel? IRQ, IO, Scheduler parameters... Am i missing something ?
> I thought that the parallelization was automatically started. True ?

No, see above.

> What are the conditions to observe a parallel work ?

padata/pcrypt uses workqueues for parallelization, so you should see a
lot of busy kworkers when you put your IPsec network under load.
Also the refcnt (/proc/crypto) of the pcrypt algorithm should increase
when you add IPsec states.