Adding OpenWrt support for Xiaomi AX3600 (Part 1)

root@AX6:/# cat /sys/kernel/debug/ecm/ecm_nss_ipv4/accelerated_count
0

Well I cannot judge about it. You have to watch CPU line during the process. If its almost idle ~ 97-99 and cpu for sys/usr ~ 0-3% (if nothing else cpu consuming is running ofc) during the run everything should be fine. You can judge this better if you have a reference value with vanilla openwrt.

Beside that:

As emc is required for proper offloading I wonder what the value of this has to be. I don't know for sure. I just have a sense that zero is not the value what you want to see here. So get the value after you have ran iperf3. But others like @rmandrad know more about.

really? i don't know more about it ... both on @smaller09 and mine it is the same. note I am using a dynalink with @bitthief repo and the "non-qca" build from @robimarko with a qnap. So, far i haven't seen any improvement with QCA ecm ... maybe there is an improvement with nss crypto which I understand is @bitthief aim

with wolssl-benchmark

dynalink


------------------------------------------------------------------------------
 wolfSSL version 5.5.1
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
RNG                140 MB took 1.032 seconds,  135.690 MB/s
AES-128-CBC-enc   1045 MB took 1.004 seconds, 1041.333 MB/s
AES-128-CBC-dec    980 MB took 1.005 seconds,  975.196 MB/s
AES-192-CBC-enc    945 MB took 1.005 seconds,  939.986 MB/s
AES-192-CBC-dec    945 MB took 1.001 seconds,  944.039 MB/s
AES-256-CBC-enc    890 MB took 1.002 seconds,  888.051 MB/s
AES-256-CBC-dec    855 MB took 1.000 seconds,  854.780 MB/s
AES-128-GCM-enc    695 MB took 1.002 seconds,  693.642 MB/s
AES-128-GCM-dec    320 MB took 1.001 seconds,  319.767 MB/s
AES-192-GCM-enc    645 MB took 1.006 seconds,  641.193 MB/s
AES-192-GCM-dec    310 MB took 1.000 seconds,  309.878 MB/s
AES-256-GCM-enc    595 MB took 1.000 seconds,  594.737 MB/s
AES-256-GCM-dec    300 MB took 1.010 seconds,  296.978 MB/s
GMAC Table 4-bit   529 MB took 1.001 seconds,  528.658 MB/s
AES-128-CTR       1030 MB took 1.002 seconds, 1027.637 MB/s
AES-192-CTR        975 MB took 1.004 seconds,  970.902 MB/s
AES-256-CTR        970 MB took 1.001 seconds,  968.569 MB/s
AES-CCM-Enc        165 MB took 1.025 seconds,  161.021 MB/s
AES-CCM-Dec        165 MB took 1.026 seconds,  160.851 MB/s
ARC4               110 MB took 1.032 seconds,  106.567 MB/s
CHACHA             450 MB took 1.009 seconds,  446.122 MB/s
CHA-POLY           305 MB took 1.004 seconds,  303.827 MB/s
3DES                10 MB took 1.189 seconds,    8.410 MB/s
MD5                220 MB took 1.015 seconds,  216.810 MB/s
POLY1305           950 MB took 1.001 seconds,  949.432 MB/s
SHA                180 MB took 1.022 seconds,  176.189 MB/s
SHA-224            955 MB took 1.000 seconds,  954.724 MB/s
SHA-256            955 MB took 1.003 seconds,  951.867 MB/s
SHA-384            230 MB took 1.018 seconds,  225.956 MB/s
SHA-512            230 MB took 1.017 seconds,  226.209 MB/s
SHA3-224           115 MB took 1.024 seconds,  112.305 MB/s
SHA3-256           110 MB took 1.026 seconds,  107.211 MB/s
SHA3-384            90 MB took 1.046 seconds,   86.011 MB/s
SHA3-512            65 MB took 1.036 seconds,   62.741 MB/s
AES-128-CMAC       275 MB took 1.005 seconds,  273.606 MB/s
AES-256-CMAC       240 MB took 1.013 seconds,  236.959 MB/s
HMAC-MD5           220 MB took 1.015 seconds,  216.833 MB/s
HMAC-SHA           180 MB took 1.022 seconds,  176.181 MB/s
HMAC-SHA224        955 MB took 1.003 seconds,  952.538 MB/s
HMAC-SHA256        950 MB took 1.002 seconds,  947.765 MB/s
HMAC-SHA384        230 MB took 1.017 seconds,  226.229 MB/s
HMAC-SHA512        230 MB took 1.017 seconds,  226.095 MB/s
PBKDF2              48 KB took 1.000 seconds,   47.589 KB/s
RSA     1024 key gen         5 ops took 1.176 sec, avg 235.140 ms, 4.253 ops/sec
RSA     2048 key gen         1 ops took 1.481 sec, avg 1480.779 ms, 0.675 ops/sec
RSA     2048 public       1100 ops took 1.035 sec, avg 0.941 ms, 1062.370 ops/sec
RSA     2048 private       100 ops took 5.698 sec, avg 56.983 ms, 17.549 ops/sec
DH      2048 key gen        93 ops took 1.007 sec, avg 10.831 ms, 92.331 ops/sec
DH      2048 agree         100 ops took 2.345 sec, avg 23.454 ms, 42.637 ops/sec
ECC   [      SECP256R1]   256 key gen       200 ops took 1.052 sec, avg 5.262 ms, 190.052 ops/sec
ECDHE [      SECP256R1]   256 agree         200 ops took 1.055 sec, avg 5.277 ms, 189.506 ops/sec
ECDSA [      SECP256R1]   256 sign          200 ops took 1.076 sec, avg 5.379 ms, 185.914 ops/sec
ECDSA [      SECP256R1]   256 verify        300 ops took 1.092 sec, avg 3.640 ms, 274.707 ops/sec
CURVE  25519 key gen      4786 ops took 1.000 sec, avg 0.209 ms, 4785.359 ops/sec
CURVE  25519 agree        4800 ops took 1.004 sec, avg 0.209 ms, 4779.130 ops/sec

qnap


wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
RNG                140 MB took 1.034 seconds,  135.347 MB/s
AES-128-CBC-enc   1050 MB took 1.005 seconds, 1045.235 MB/s
AES-128-CBC-dec   1005 MB took 1.004 seconds, 1000.795 MB/s
AES-192-CBC-enc    960 MB took 1.002 seconds,  957.625 MB/s
AES-192-CBC-dec    925 MB took 1.004 seconds,  921.755 MB/s
AES-256-CBC-enc    875 MB took 1.004 seconds,  871.715 MB/s
AES-256-CBC-dec    855 MB took 1.002 seconds,  853.299 MB/s
AES-128-GCM-enc    710 MB took 1.000 seconds,  709.745 MB/s
AES-128-GCM-dec    320 MB took 1.009 seconds,  317.262 MB/s
AES-192-GCM-enc    655 MB took 1.001 seconds,  654.659 MB/s
AES-192-GCM-dec    310 MB took 1.007 seconds,  307.871 MB/s
AES-256-GCM-enc    610 MB took 1.006 seconds,  606.507 MB/s
AES-256-GCM-dec    300 MB took 1.016 seconds,  295.363 MB/s
GMAC Table 4-bit   523 MB took 1.001 seconds,  522.285 MB/s
AES-128-CTR       1055 MB took 1.002 seconds, 1053.139 MB/s
AES-192-CTR       1000 MB took 1.002 seconds,  998.147 MB/s
AES-256-CTR        945 MB took 1.003 seconds,  941.864 MB/s
AES-CCM-Enc        170 MB took 1.024 seconds,  166.000 MB/s
AES-CCM-Dec        165 MB took 1.002 seconds,  164.649 MB/s
ARC4               110 MB took 1.030 seconds,  106.751 MB/s
CHACHA             445 MB took 1.005 seconds,  442.813 MB/s
CHA-POLY           305 MB took 1.008 seconds,  302.672 MB/s
3DES                10 MB took 1.185 seconds,    8.437 MB/s
MD5                220 MB took 1.018 seconds,  216.134 MB/s
POLY1305           945 MB took 1.003 seconds,  941.937 MB/s
SHA                180 MB took 1.021 seconds,  176.251 MB/s
SHA-224            950 MB took 1.004 seconds,  946.562 MB/s
SHA-256            945 MB took 1.001 seconds,  943.892 MB/s
SHA-384            230 MB took 1.014 seconds,  226.716 MB/s
SHA-512            230 MB took 1.014 seconds,  226.782 MB/s
SHA3-224           115 MB took 1.022 seconds,  112.533 MB/s
SHA3-256           110 MB took 1.025 seconds,  107.352 MB/s
SHA3-384            85 MB took 1.021 seconds,   83.229 MB/s
SHA3-512            60 MB took 1.004 seconds,   59.772 MB/s
AES-128-CMAC       265 MB took 1.015 seconds,  261.094 MB/s
AES-256-CMAC       225 MB took 1.013 seconds,  222.024 MB/s
HMAC-MD5           205 MB took 1.012 seconds,  202.472 MB/s
HMAC-SHA           165 MB took 1.001 seconds,  164.817 MB/s
HMAC-SHA224        890 MB took 1.002 seconds,  887.967 MB/s
HMAC-SHA256        890 MB took 1.003 seconds,  887.443 MB/s
HMAC-SHA384        210 MB took 1.014 seconds,  207.072 MB/s
HMAC-SHA512        215 MB took 1.012 seconds,  212.346 MB/s
PBKDF2              46 KB took 1.000 seconds,   45.712 KB/s
RSA     1024 key gen         3 ops took 1.042 sec, avg 347.388 ms, 2.879 ops/sec
RSA     2048 key gen         1 ops took 5.253 sec, avg 5253.377 ms, 0.190 ops/sec
RSA     2048 public       1100 ops took 1.087 sec, avg 0.989 ms, 1011.521 ops/sec
RSA     2048 private       100 ops took 6.020 sec, avg 60.204 ms, 16.610 ops/sec
DH      2048 key gen        89 ops took 1.008 sec, avg 11.328 ms, 88.273 ops/sec
DH      2048 agree         100 ops took 2.395 sec, avg 23.949 ms, 41.755 ops/sec
ECC   [      SECP256R1]   256 key gen       200 ops took 1.109 sec, avg 5.545 ms, 180.328 ops/sec
ECDHE [      SECP256R1]   256 agree         200 ops took 1.113 sec, avg 5.565 ms, 179.699 ops/sec
ECDSA [      SECP256R1]   256 sign          200 ops took 1.152 sec, avg 5.759 ms, 173.651 ops/sec
ECDSA [      SECP256R1]   256 verify        300 ops took 1.185 sec, avg 3.950 ms, 253.156 ops/sec
CURVE  25519 key gen      4537 ops took 1.000 sec, avg 0.220 ms, 4536.523 ops/sec
CURVE  25519 agree        4600 ops took 1.008 sec, avg 0.219 ms, 4561.460 ops/sec

it seems the dynalink using @bitthief repo is very slightly better on some ops

again I don't think ecm is working at all using the qca repo ...apart from crypto perhaps .. so really think to drop QCA altogether

I just thought so, because you were asking for this specific value. :smiley:

From my understanding this specific value is counting something but I don't know what. So it cannot be zero if that what it is counting is working. But we need to know what it is counting to produce the counts.

EDIT: There is a discussion about ecm within this thread ~ post count 2011. I'm not in the mute to read into it. :smiley: ... and ofc this thread: Ipq806x NSS build (Netgear R7800 / TP-Link C2600 / Linksys EA8500)

I have built from @bitthief repo. ECM offloading definitely appears to be working but only when connected to a lan port. I don't see any offloading running the same test over wifi.

2 Likes

wolfssl uses ARMv8 crypto acceleration on ipq807x, but not qca-nss-crypto.

2 Likes

same here. on wifi test, I got about 60% bitrate. and the cpu usage would be aroud 27%.

When using an "increase"-firmware the advantage is to have more "disk space".

Instead of appr. 15 MB it gets increased to appr. 175 MB.

This is nice, but I can't figure out what the use case of this is. On my router the demand is just 1 - 2 MB.

Could anyone explain me for what he needs an increased disk space?

Thanks!

1 Like

Packages maybe?

Probably. But I never had the case that the packages I have installed have exceeded 15 MB.

So there might be a further use case for having more disk space which I would like to learn about.

@Ansuel, is there any problem with ipq807x-5.15-pr-wifi-offload patches? I want to combine it with bitthief offload patches. Will there be any problems? Or is it an unrealizable task for now?

Hi guys,

i'm new on this device and i just installed openwrt on my xiaomi but i don't have any funcion like WireGuard or Openvpn. When i try to install it it say "KMTUNE TAP NOT AVAILABLE" and when i try to install gives an error. can someone explain how to fix that?

Thanks

hello when i compile openwrt from bithief with shorcut-fe patch i have an error. Possible to send me your compilation that I look which patch is not correct I have the following error

thank you very much everyone

Sorry for my english

net/bridge/br_if.c:896:6: error: redefinition of 'br_dev_update_stats'

[ br_dev_update_stats(struct net_device *dev,

| ^~~~~~~~~~~~~~~~~~~

[net/bridge/br_if.c:790:6: note: previous definition of 'br_dev_update_stats' with type 'void(struct net_device *, struct rtnl_link_stats64 *)'

)make[7]: *** [scripts/Makefile.build:289: net/bridge/br_if.o] Error 1

look personally i don't think qca is the way to go ... no docs + huge effort to bring it to the latest ! .. i just found through looking their code that wifi ecm support is there however libraries are missing ! most likely because these people just not interested in documenting anything!!! so everyone just stick with @robimarko repo unless you want to have some fun fixing the spaghetti QCA mess

been having an open mind but really is overwhelming the shit they produce .... most likely as there are no docs etc!!! so keep away .. still hoping in exploiting additional nss cores and wifi acceleration though ...

Just what I said. Forget about QCA, go with Mediatek

U need to delete changes to the net/bridge/br_if.c, it was patched by another patch.

--- a/953-net-patch-linux-kernel-to-support-shortcut-fe.patch	2022-11-06 19:55:46.843435909 +0800
+++ b/953-net-patch-linux-kernel-to-support-shortcut-fe.patch	2022-11-18 22:28:46.581659095 +0800
@@ -59,37 +59,6 @@
  config ETHTOOL_NETLINK
  	bool "Netlink interface for ethtool"
  	default y
---- a/net/bridge/br_if.c
-+++ b/net/bridge/br_if.c
-@@ -777,6 +777,28 @@ void br_port_flags_change(struct net_bri
- 		br_offload_port_state(p);
- }
- 
-+void br_dev_update_stats(struct net_device *dev,
-+			 struct rtnl_link_stats64 *nlstats)
-+{
-+	
-+	struct pcpu_sw_netstats *stats;
-+
-+	/* Is this a bridge? */
-+	if (!(dev->priv_flags & IFF_EBRIDGE))
-+		return;
-+
-+	
-+	stats = this_cpu_ptr(dev->tstats);
-+
-+	u64_stats_update_begin(&stats->syncp);
-+	stats->rx_packets += nlstats->rx_packets;
-+	stats->rx_bytes += nlstats->rx_bytes;
-+	stats->tx_packets += nlstats->tx_packets;
-+	stats->tx_bytes += nlstats->tx_bytes;
-+	u64_stats_update_end(&stats->syncp);
-+}
-+EXPORT_SYMBOL_GPL(br_dev_update_stats);
-+
- bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag)
- {
- 	struct net_bridge_port *p;
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
 @@ -3584,9 +3584,17 @@ static int xmit_one(struct sk_buff *skb,

Merci beaucoup

I had try @Ansuel's wifi-offload patches ,but bitthief's repo using 6.1 backport. so serval patches fault.