Repository navigation
Conversation
|
mark. |
|
Duplicate of #20130. |
|
The new driver has deadlocks and panics during unloading. It also doesn't support software fallback, which is necessary to avoid performance loss. In fact, it is also 25% slower. Not to mention a few failed self-tests. I've sent two fixes upstream, but we need more work. [1] https://patchwork.kernel.org/project/linux-crypto/patch/[email protected]/ |
|
@abajk Thank you very much for the information. I've prepared this PR to resolve a driver conflict with the upcoming 6.18 kernel, which already has eip93 integrated. I'll take a look at your changes and the previous drivers and try to optimize the code. |
c2f7dd9 to
1113361
Compare
|
These data show that the new driver is slower. Additionally, fallback should also be active for DES, 3DES, and AES-RFC3686. Hashes are also a big problem, as they are always slower than software for blocks up to 8k. Performance is easiest to compare using tcrypt: |
4e65e74 to
a73c818
Compare
|
@abajk I've created a new commit that should impact the module's performance.
Need benchmarks with old version for CONFIG_CRYPTO_DEV_EIP93_SA_RECORD_PER_KEY=y and CONFIG_CRYPTO_DEV_EIP93_SA_RECORD_PER_KEY=n (also with zeroed CONFIG_CRYPTO_DEV_EIP93_AES_128_SW_MAX_LEN and CONFIG_CRYPTO_DEV_EIP93_GENERIC_SW_MAX_LEN). |
5694ea9 to
507f3ef
Compare
P.S. hwrng is not supported on MT7621. |
10794f0 to
9618fa6
Compare
|
@Linaro1985 Try new version. |
Done. However, there is a kernel panic in the logs. Is there anything else I can do to help diagnose the issue? P.S. It looks like there are still endianness issues in the code: Airoha is big-endian, while the MT7621 is little-endian. |
Airoha is little-endian ARM. Most Econet MIPS SoCs are big-endian, but there is one generation of little-endian MIPS SoCs as well. |
Indeed. Until now, I had assumed that testing was mainly done on the big-endian version of Airoha/Econet. @Ansuel mentioned possible endianness issues, which is why I brought it up. |
|
I decided to add only the first two commits and include the rest of the code in subsequent PRs. |
42a2427 to
155bef9
Compare
c1f509e to
a5f4988
Compare
|
My main concerns are three issues:
|
Drop the downstream MTK EIP93 driver (ramips) and the partial Airoha driver (airoha) in favour of the single, upstream-quality SafeXcel EIP-93 implementation that is already queued for Linux 6.15. The new driver: - supports MT7621, EN7512, EN7581 and future Airoha SoCs - offers AES/DES/3DES (ECB/CBC/CTR) and AEAD with HMAC-MD5/SHA1/SHA256 - auto-detects available algorithms via hardware capability registers - fixes several long-standing stability and locking bugs present in the downstream code All OpenWrt boards that previously relied on the old modules now receive the same functionality through the unified crypto-hw-eip93.ko module. Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
This commit adds pending and hack patches for the EIP-93 crypto driver in OpenWrt. The pending patches address critical issues: - 880-crypto-eip93-fix-kernel-panic-in-driver-detach.patch Fixes a kernel panic triggered during driver detachment, which was caused by incorrect algorithm unregistration. - 881-crypto-eip93-unregister-only-available-algorithm.patch Ensures only hardware-supported algorithms are unregistered, preventing panics on platforms where certain crypto options are not implemented in silicon. - 88-crypto-eip93-fix-sleep-inside-atomic.patch Avoid GFP_KERNEL and usleep_range() if the flag CRYPTO_TFM_REQ_MAY_SLEEP is absent The hack patch: - 926-crypto-eip93-use-AES-fallback-for-small-requests.patch Implements a fallback to software AES for small data blocks, improving performance by bypassing hardware acceleration when software is faster. Additionally, two new kernel configuration options are introduced: - CRYPTO_DEV_EIP93_GENERIC_SW_MAX_LEN and CRYPTO_DEV_EIP93_AES_128_SW_MAX_LEN, allowing fine control over when software fallback is used for generic and AES-128 cipher requests, respectively. These changes increase stability, performance, and flexibility for systems using the EIP-93 crypto engine. Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
|
Closed to avoid duplication |



Drop the downstream MTK EIP93 driver (ramips) and the partial Airoha driver (airoha) in favour of the single, upstream-quality SafeXcel EIP-93 implementation that is already queued for Linux 6.15.
The new driver:
All OpenWrt boards that previously relied on the old modules now receive the same functionality through the unified crypto-hw-eip93.ko module.