mbox series

[v2,0/3] crypto: qce driver fixes for gcm

Message ID 20200206012036.25614-1-cotequeiroz@gmail.com
Headers show
Series crypto: qce driver fixes for gcm | expand

Message

Eneas U de Queiroz Feb. 6, 2020, 1:20 a.m. UTC
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(-)