linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
To: linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Eneas U de Queiroz <cotequeiroz@gmail.com>
Subject: [PATCH v2 0/3] crypto: qce driver fixes for gcm
Date: Wed,  5 Feb 2020 22:20:33 -0300	[thread overview]
Message-ID: <20200206012036.25614-1-cotequeiroz@gmail.com> (raw)
In-Reply-To: <20200203165334.6185-1-cotequeiroz@gmail.com>

I finally managed to get the tcrypt module working to make some
measurements straight from the kernel.  The reason the module was not
loading was that AES-XTS was hanging, so the tests never finished, and I
couldn't get any messages on /proc/kmsg.

By trial and error, I concluded that xts-aes-qce does not take requests
that are greater than 512-bytes, and not a multiple of 512.  So, when I
tried to run the tests with 768 bytes, it would just hang.

As a workaround we can use the fallback to fullfill those requests.

As part of the v2, I'm using a module paramenter to set the software
threshold, instead of fixing it at 512.

The results of the tcrypt tests confirmed my previous estimates, so I'm
leaving the default at 512 bytes.

Here's a sample run of my tests.  Just like with openssl, numbers vary
from run to run, more than I would expect.

testing speed of async cbc(aes) (cbc-aes-qce) encryption
aes_sw_max_len              32.768          512             0
------------------      ----------   ----------    ----------
128 bit   16 bytes       8.081.136    5.614.448       430.416
128 bit   64 bytes      13.152.768   13.205.952     1.745.088
128 bit  256 bytes      16.094.464   16.101.120     6.969.600
128 bit  512 bytes      16.701.440   16.705.024    12.866.048
128 bit  768 bytes      16.883.712   13.192.704    15.186.432
128 bit 1024 bytes      17.036.288   17.149.952    19.716.096
128 bit 2048 bytes      17.108.992   30.842.880    32.868.352
128 bit 4096 bytes      17.203.200   44.929.024    49.655.808
128 bit 8192 bytes      17.219.584   58.966.016    74.186.752
256 bit   16 bytes       6.962.432    1.943.616       419.088
256 bit   64 bytes      10.485.568   10.421.952     1.681.536
256 bit  256 bytes      12.211.712   12.160.000     6.701.312
256 bit  512 bytes      12.499.456   12.584.448     9.882.112
256 bit  768 bytes      12.622.080   12.550.656    14.701.824
256 bit 1024 bytes      12.750.848   16.079.872    19.585.024
256 bit 2048 bytes      12.812.288   28.293.120    27.693.056
256 bit 4096 bytes      12.939.264   34.234.368    44.142.592
256 bit 8192 bytes      12.845.056   50.274.304    63.520.768

Eneas U de Queiroz (3):
  crypto: qce - use cryptlen when adding extra sgl
  crypto: qce - use AES fallback for small requests
  crypto: qce - handle AES-XTS cases that qce fails

 drivers/crypto/Kconfig        | 23 +++++++++++++++++++++++
 drivers/crypto/qce/common.c   |  2 --
 drivers/crypto/qce/common.h   |  3 +++
 drivers/crypto/qce/dma.c      | 11 ++++++-----
 drivers/crypto/qce/dma.h      |  2 +-
 drivers/crypto/qce/skcipher.c | 28 ++++++++++++++++++----------
 6 files changed, 51 insertions(+), 18 deletions(-)


  parent reply	other threads:[~2020-02-06  1:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 19:03 [PATCH 0/2] crypto: qce driver fixes for gcm Eneas U de Queiroz
2020-02-03 19:04 ` [PATCH 1/2] crypto: qce - use cryptlen when adding extra sgl Eneas U de Queiroz
2020-02-03 19:04 ` [PATCH 2/2] crypto: qce - use AES fallback when len <= 512 Eneas U de Queiroz
2020-02-06  1:20 ` Eneas U de Queiroz [this message]
2020-02-06  1:20   ` [PATCH v2 1/3] crypto: qce - use cryptlen when adding extra sgl Eneas U de Queiroz
2020-02-06  1:20   ` [PATCH v2 2/3] crypto: qce - use AES fallback for small requests Eneas U de Queiroz
2020-02-06  1:20   ` [PATCH v2 3/3] crypto: qce - handle AES-XTS cases that qce fails Eneas U de Queiroz
2020-02-06 23:31     ` kbuild test robot
2020-02-06 11:39   ` [PATCH v3 1/3] crypto: qce - use cryptlen when adding extra sgl Eneas U de Queiroz
2020-02-06 11:39   ` [PATCH v3 2/3] crypto: qce - use AES fallback for small requests Eneas U de Queiroz
2020-02-06 11:39   ` [PATCH v3 3/3] crypto: qce - handle AES-XTS cases that qce fails Eneas U de Queiroz

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=20200206012036.25614-1-cotequeiroz@gmail.com \
    --to=cotequeiroz@gmail.com \
    --cc=ardb@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).