]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
crypto: vmx - Increase priority of aes-cbc cipher
authorAnton Blanchard <anton@samba.org>
Fri, 10 Jun 2016 06:47:03 +0000 (16:47 +1000)
committerKamal Mostafa <kamal@canonical.com>
Mon, 27 Jun 2016 21:34:54 +0000 (14:34 -0700)
BugLink: http://bugs.launchpad.net/bugs/1592481
All of the VMX AES ciphers (AES, AES-CBC and AES-CTR) are set at
priority 1000. Unfortunately this means we never use AES-CBC and
AES-CTR, because the base AES-CBC cipher that is implemented on
top of AES inherits its priority.

To fix this, AES-CBC and AES-CTR have to be a higher priority. Set
them to 2000.

Testing on a POWER8 with:

cryptsetup benchmark --cipher aes --key-size 256

Shows decryption speed increase from 402.4 MB/s to 3069.2 MB/s,
over 7x faster. Thanks to Mike Strosaker for helping me debug
this issue.

Fixes: 8c755ace357c ("crypto: vmx - Adding CBC routines for VMX module")
Cc: stable@vger.kernel.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 12d3f49e1ffbbf8cbbb60acae5a21103c5c841ac git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
drivers/crypto/vmx/aes_cbc.c
drivers/crypto/vmx/aes_ctr.c

index 0b8fe2ec5315fc8253431ca533d953b9c72d7243..f3801b983f4222fb874fbb2771967fa62debd525 100644 (file)
@@ -182,7 +182,7 @@ struct crypto_alg p8_aes_cbc_alg = {
        .cra_name = "cbc(aes)",
        .cra_driver_name = "p8_aes_cbc",
        .cra_module = THIS_MODULE,
-       .cra_priority = 1000,
+       .cra_priority = 2000,
        .cra_type = &crypto_blkcipher_type,
        .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER | CRYPTO_ALG_NEED_FALLBACK,
        .cra_alignmask = 0,
index ee1306cd8f59bc5fd2d1f8b286ff5f553d53cc85..404a1b69a3ab90511fbdee5cdd1994004c71e762 100644 (file)
@@ -166,7 +166,7 @@ struct crypto_alg p8_aes_ctr_alg = {
        .cra_name = "ctr(aes)",
        .cra_driver_name = "p8_aes_ctr",
        .cra_module = THIS_MODULE,
-       .cra_priority = 1000,
+       .cra_priority = 2000,
        .cra_type = &crypto_blkcipher_type,
        .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER | CRYPTO_ALG_NEED_FALLBACK,
        .cra_alignmask = 0,