Configure RPI3 ARM 19.06 image headless?

OpenWRT is running in aarch64 on Raspi3 - I get even faster:

root@OpenWrt:~# openssl speed -evp aes-128-cbc
Doing aes-128-cbc for 3s on 16 size blocks: 7707919 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 2638935 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 730839 aes-128-cbc's in 2.99s
Doing aes-128-cbc for 3s on 1024 size blocks: 187466 aes-128-cbc's in 2.97s
Doing aes-128-cbc for 3s on 8192 size blocks: 23641 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 16384 size blocks: 11846 aes-128-cbc's in 3.00s
OpenSSL 1.1.1c  28 May 2019
built on: Thu Jun 13 22:24:56 2019 UTC
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr)
compiler: aarch64-openwrt-linux-musl-gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -W
no-error=unused-but-set-variable -Wno-error=unused-result -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -f
pic -ffunction-sections -fdata-sections -znow -zrelro -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_AS
M -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -DOPENSSL_SMALL_FOOTPRINT
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
aes-128-cbc      41108.90k    56297.28k    62573.51k    64634.74k    64555.69k  64694.95k

I think because they are tuning the whole build for cortex-a53 and using -O3

But it is also using a heavily patched Kernel. Adding ~700 Patches for 4.19 is far away form a mainline Kernel, like Arch or Manjaro are using.

Just building openssl with more optimizations does not change anything. I tried it with -march=native -mtune=native -O3 and something that is close to the one you posted form openwrt with -O3 -Os -mcpu=cortex-a53

I tried the same with Raspbian and didn't end up with any gain. I imagine having all its dependencies tuned for cortex-a53 and -O3 is most of the secret sauce.

I guess whats important though for this thread - is that there is something wrong with the 5.x kernel on Rpi3. My power and temperature readings show that the processor is not breaking a sweat. There is no way I know of in 5.x kernel to check what frequency it is ramping up to - but it seems from the power draw and temperature that it is not leaving idle / baseline 700MHz.

Okay apparently this is a known issue by the kernel devs:

https://github.com/raspberrypi/linux/issues/2881#issuecomment-511705330

There is no frequency scaling until the 5.3 releases of the kernel.

I guess I'll stick with 4.19 until then.

@Strit

There should be a notice in the docs to anyone running Manjaro on Raspberry Pi with a 5.x kernel that their board will not increase from base clock frequency and to expect a substandard experience.

Let me know if you need me to open a pull request on some document for the website.

I updated the release post about it, in the Known Issues section. Thanks.

1 Like

@xabbu wanted to share that I recompiled glibc along with openssl (openssl alone didn't make it much faster) with -O3 -mcpu=cortex-a53. I'm now close to OpenWRT in aarch64. I gained about 18% performance.

pi@raspberrypi:~/Downloads/silesia $ openssl speed -evp aes-128-cbc
Doing aes-128-cbc for 3s on 16 size blocks: 6170033 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 2276635 aes-128-cbc's in 2.99s
Doing aes-128-cbc for 3s on 256 size blocks: 658511 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 171155 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 21648 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 16384 size blocks: 10833 aes-128-cbc's in 3.00s
OpenSSL 1.1.1c  28 May 2019
built on: Thu May 30 15:27:48 2019 UTC
options:bn(64,32) rc4(char) des(long) aes(partial) blowfish(ptr)
compiler: arm-linux-gnueabihf-gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -mcpu=cortex-a53 -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
aes-128-cbc      32906.84k    48730.65k    56192.94k    58420.91k    59113.47k    59162.62k

This is Raspbian Buster 32bit armv7l.

I'm guessing the remainder is the kernel needs to be a tuned compile as well.

Forum kindly sponsored by Bytemark