Skip to contentSkip to conversation

Possible regression after Linux 4.7

crypto radioconfusion at gmail.com 2 participants 3 messages Oct 31, 2016 – Dec 5, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

Quoted 21 lines · radioconfusion at gmail.com
Quoted 9 lines · Romain Perier
Quoted 9 lines

Hello,

I'm testing the marvell-cesa -driver on Armada 385 board and I think I've found a regression between Linux 4.7 and 4.8-rc4.
I want to accelerate my curl connections. So I compiled the 4.8-rc4 with marvell-cesa enabled and HEAD revision of cryptodev-linux.

Here is my output:

Quoted 11 lines
Quoted 11 lines

~# uname -r
4.8.0-rc4
~# modprobe cryptodev
~# modprobe marvell-cesa
~# curl -k --ciphers AES256-SHA256 https://myserver/myfile >/dev/null

   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed

19 200M 19 39.7M 0 0 16.2M 0 0:00:12 0:00:02 0:00:10 16.2M
curl: (56) SSL read: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac, errno 0

Quoted 4 lines

--- snip ---

Quoted 3 lines

Thank you for your feedbacks.
I can reproduce the issue with and without multiple engines.

I can still reproduce the issue with Linux 4.9-rc3 (2a26d99b251b8625d27aed14e97fc10707a3a81f)

Quoted 11 lines
Quoted 2 lines

However, I have found an interesting thing, If I use only --ciphers AES256, it works perfectly fine, could you confirm this ?

Yes, I can confirm. And I have found the reason too. Most of available ciphers will not be accelerated at all. Only these ones I have verified to be accelerated by cesa:
AES256-SHA256
AES256-SHA
AES128-SHA256
AES128-SHA

Quoted 3 lines

When cesa is working, I can see "irq/42-f1090000" on process list of top(1) and curl doesn't take all of available cpu.

--- snip ---

Quoted 1 line
Quoted 1 line

In any case, I will investigate.

Do you have any improvement for the issue? Please let me know if you need any help to resolve it.

Best Regards,
Jussi

#1 lore raw

Hello,

Le 31/10/2016 ? 14:59, radioconfusion at gmail.com a ?crit :

Quoted 6 lines

Do you have any improvement for the issue? Please let me know if you need any help to resolve it.

Best Regards,
Jussi

Sorry for the delay.
Could you try to revert locally commit 2786cee8e50bb4b4303dc22665f391b72318fa84 (crypto: marvell - Move SRAM I/O operations to step functions) ?

It seems to fix most of the issues I had with curl.
I will continue to investigate, that's just to confirm if it fixes the issues for you.

Thanks,
Romain

Signature · 3 lines
Romain Perier, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

Hello,

The issue is reproducible in STD mode too. We have found fixes. Could you test these patches in STD mode please ?

cover letter:
https://www.mail-archive.com/linux-crypto at vger.kernel.org/msg22143.html 1/2: https://www.mail-archive.com/linux-crypto at vger.kernel.org/msg22142.html 2/2: https://www.mail-archive.com/linux-crypto at vger.kernel.org/msg22141.html

If you want to turn off DMA, open drivers/crypto/marvell/cesa.c and in armada_xp_caps, change .has_tdma to false. (assuming that you test on a armada 38x).

We're still investigating for regressions in DMA mode.

Have a nice day,
Romain

Signature · 3 lines
Romain Perier, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com