R2 Pro RK3568 CRYPTO_DEV_ROCKCHIP2 [IPsec] Hardware Accleration

Hello all,

Got strongswan working on R2 Pro, but the performance is lackluster at best. 78 Mbps UP and DOWN best, saturating one CPU with 100% irq. Better than Mikrotik hAP ax lite [35 Mbps UP and DOWN]

Found a thread on someone is working on CRYPTO_DEV_ROCKCHIP2, https://lists.infradead.org/pipermail/linux-arm-kernel/2022-September/778238.html but I don’t know how to only port this ROCKCHIP2 folder into the source tree and test.

I suspect even if I port the folder over, it will drag bunch of dependencies and create conflicts here and there.

Easiest way is searching the patch in rockchip patchwork (state any and also history),export mbox file and apply the patch file with git am

https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

It does not look complex to add,but i guess you will need an additional dts node (compatible rockchip,rk3568-crypto) to trigger the driver.

Ah i see it is a series…and last part is the dts patch

it looks like the series depend on additional patches for rk3288-crypto,

seems to be this: https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/

and comments in coverletter there is a report that it does not work…maybe you can contact Corentin to send out a newer patchset

i tried to apply the rk3288 one to 6.1 tree and it fails in many positions…maybe author can send a new one or rebase on 6.1

I will contact the author and report back. I might need to read the datasheets and code myself as a last resort. Can’t wait to pick up C, haven’t used since high school.

Have you noticed this one?

[PATCH RFT 4/5] crypto: rockchip: support the new crypto IP for rk3568/rk3588 — ARM, OMAP, Xscale Linux Kernel (spinics.net)

it seems to be same patchset like above…

Then this must be the way to go… Perhapse it will merge better with a newer linux version?

The problem is that in any comment it is tested as non-working

https://patchwork.kernel.org/project/linux-rockchip/cover/[email protected]/#25027889

And it seems it needs some patches before i have not found yet…the other series i’ve found is newer

looks like the first patch from the series are already in (moving kconfig), as there is already a rockchip dir and the rk3288 is already there…maybe we just need to skip the first patch(es)


but this version was reported as non-working and i did not found newer version and no response yet from author

got answer from author that he will look again into these patches…

Got answer from author again and he pointed me to his actual code,but have not tested yet

Commits · montjoie/linux · GitHub

have added his patches in my 6.5-r2pro tree, but not yet tested

Thanks for all the helping. I will take a look soon. I am having some trouble with the journctl -xe on your base Ubuntu image, continuously running as a StrongSwan server for 20 days now.

Had not running the board so long…serial console should work when you reconnect and get additional output…maybe you missed the baud setting (1500000) on reconnect or use wrong serial device? In other thread you’ve wrote that ssh works well then,so board is not freezed.

But as r2pro uses onboard uart adapter,it is possible that this has freezed.

I have booted the kernel with the crypto driver enabled after fixing issue with renamed pmic driver (prevents sdcard access). See no dmesg messages for crypto and also no dma errors…need to know how to check. Maybe i enable the debugfs option then i should see these entries