crypto: crypto4xx - increase context and scatter ring buffer elements
authorChristian Lamparter <chunkeey@gmail.com>
Tue, 3 Oct 2017 23:00:08 +0000 (01:00 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 12 Oct 2017 14:55:11 +0000 (22:55 +0800)
commit778f81d6cdb7d25360f082ac0384d5103f04eca5
tree706ec3b3c29012fc0feb687a1074888498a1ecd6
parent333eb3edda3842f3e5dbd723cb18bbe47eb0508b
crypto: crypto4xx - increase context and scatter ring buffer elements

If crypto4xx is used in conjunction with dm-crypt, the available
ring buffer elements are not enough to handle the load properly.

On an aes-cbc-essiv:sha256 encrypted swap partition the read
performance is abyssal: (tested with hdparm -t)

/dev/mapper/swap_crypt:
 Timing buffered disk reads:  14 MB in  3.68 seconds =   3.81 MB/sec

The patch increases both PPC4XX_NUM_SD and PPC4XX_NUM_PD to 256.
This improves the performance considerably:

/dev/mapper/swap_crypt:
 Timing buffered disk reads: 104 MB in  3.03 seconds =  34.31 MB/sec

Furthermore, PPC4XX_LAST_SD, PPC4XX_LAST_GD and PPC4XX_LAST_PD
can be easily calculated from their respective PPC4XX_NUM_*
constant.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/amcc/crypto4xx_core.h