From: Phil Sutter <phil@nwl.cc>
To: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Cc: cryptodev-linux-devel@gna.org,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [Cryptodev-linux-devel] comparison of the AF_ALG interface with the /dev/crypto
Date: Tue, 30 Aug 2011 18:33:42 +0200 [thread overview]
Message-ID: <20110830163342.GC2615@orbit.nwl.cc> (raw)
In-Reply-To: <4E5A3FCC.2030504@gnutls.org>
Hi,
On Sun, Aug 28, 2011 at 03:17:00PM +0200, Nikos Mavrogiannopoulos wrote:
> I've compared the cryptodev [0] and AF_ALG interfaces in terms of
> performance [1]. I've put the results, as well as the benchmarks used
> in: http://home.gna.org/cryptodev-linux/comparison.html
Well done, Nikos!
I did a short verification of your results on a (bit older) Via Eden
running at 1GHz (with padlock enabled, of course). I just ran the
cryptodev "fulltest" and af_alg "aes", so this should relate to the
overall-test using splice. Here are the numbers:
chunksize cryptodev af_alg
-------------------------------------------
512 15.34 MB/s 12.32 MB/s
1024 30.01 MB/s 24.22 MB/s
2048 57.29 MB/s 46.85 MB/s
4096 103.13 MB/s 87.29 MB/s
8192 174.08 MB/s 150.04 MB/s
16384 0.27 GB/s 0.23 GB/s
32768 0.35 GB/s 0.32 GB/s
65536 0.42 GB/s 0.38 GB/s
So at it's best (512byte chunks), cryptodev is about 25% faster. The
worst case is with 32kbyte chunks, then cryptodev is only 9% faster.
> The AF_ALG appears to have poor performance comparing to cryptodev. Note
> that the test with software AES is not really indicative because the
> cost of software encryption masks the overhead of the framework. The
> difference is clearly seen in the NULL cipher that has no cost (as one
> would expect from a hardware cipher accelerator).
Not really. Indeed, a crypto engine accelerates the actual encryption.
But another important benefit of CPU-separate (unlike padlock) engines
is the offloading of that work, so the CPU can do other things in the
mean time. E.g. handling the less efficient userspace interface. ;)
OK, just kidding - in reality you always need to do init and fini stuff
before and after the actual crypto operation to get any result at all.
Skipping the middle should allow for measuring the rest.
> Given my benchmarks have no issues, it is not apparent to me why one
> should use AF_ALG instead of cryptodev. I do not know though why AF_ALG
> performs so poor. I'd speculate by blaming it on the usage of the socket
> API and the number of system calls required.
Interestingly, the splice variant is outrun by regular AF_ALG on small
buffers. I don't know if there is something wrong with the code, but
according to some old benchmarks I found, cryptodev with zero-copy
enabled got faster in every situation (even with 16byte buffers).
Greetings, Phil
next prev parent reply other threads:[~2011-08-30 16:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-28 13:17 comparison of the AF_ALG interface with the /dev/crypto Nikos Mavrogiannopoulos
2011-08-28 20:35 ` David Miller
2011-08-29 7:32 ` Nikos Mavrogiannopoulos
2011-08-29 16:09 ` David Miller
2011-08-30 16:33 ` Phil Sutter [this message]
2011-09-01 2:15 ` Herbert Xu
2011-09-01 6:26 ` Nikos Mavrogiannopoulos
2011-09-01 6:43 ` Herbert Xu
2011-09-01 6:54 ` Nikos Mavrogiannopoulos
2011-09-01 6:56 ` Herbert Xu
2011-09-01 13:39 ` Phil Sutter
2011-09-01 14:14 ` Herbert Xu
2011-09-01 14:56 ` Nikos Mavrogiannopoulos
2011-09-01 14:59 ` Herbert Xu
2011-09-01 15:06 ` Nikos Mavrogiannopoulos
2011-09-01 15:08 ` Herbert Xu
2011-09-01 15:32 ` David Miller
2011-09-01 16:19 ` Nikos Mavrogiannopoulos
2011-09-01 15:09 ` Phil Sutter
2011-09-01 15:13 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110830163342.GC2615@orbit.nwl.cc \
--to=phil@nwl.cc \
--cc=cryptodev-linux-devel@gna.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nmav@gnutls.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox