Skip to content

airoha: an7581: enable NPU by default - #20484

Merged
openwrt-bot merged 1 commit into
openwrt:mainfrom
hzyitc:airoha-enable-npu
Nov 20, 2025
Merged

openwrt-bot merged 1 commit into
openwrt:mainfrom
hzyitc:airoha-enable-npu

Conversation

@hzyitc

@hzyitc hzyitc commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

There is no reason not to do this.

Use the following commands to enable hardware offloading:

uci set firewall.@defaults[0].flow_offloading='1'
uci set firewall.@defaults[0].flow_offloading_hw='1'
uci commit

@danpawlik

Copy link
Copy Markdown
Contributor

@hzyitc did you test that? Just asking, because #20430 people raises that there are some issues.

@hurrian

hurrian commented Oct 22, 2025 •

Copy link
Copy Markdown
Contributor

@hzyitc did you test that? Just asking, because #20430 people raises that there are some issues.

The probe errors are the driver deferring when rootfs isn't mounted; by default there's no success message but after patching one in it eventually returns 0 - so it probably loads fine?

There aren't any sysfs knobs that indicate offloading (and reading the ppe entries still crashes the kernel, same as without loading the npu firmware) so it's kind of hard to tell.

@abajk

abajk commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

I think the NPU still doesn't work. I've configured LAN2 as WAN and LAN3 as LAN. The connection is disconnected almost immediately:

$ iperf3 -c 10.1.0.1 -t 3600 -P 4
Connecting to host 10.1.0.1, port 5201
[  5] local 192.168.1.220 port 57822 connected to 10.1.0.1 port 5201
[  7] local 192.168.1.220 port 57834 connected to 10.1.0.1 port 5201
[  9] local 192.168.1.220 port 57844 connected to 10.1.0.1 port 5201
[ 11] local 192.168.1.220 port 57854 connected to 10.1.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   128 KBytes  1.05 Mbits/sec    2   1.41 KBytes       
[  7]   0.00-1.00   sec   128 KBytes  1.05 Mbits/sec    2   1.41 KBytes       
[  9]   0.00-1.00   sec   256 KBytes  2.10 Mbits/sec    2   1.41 KBytes       
[ 11]   0.00-1.00   sec   256 KBytes  2.10 Mbits/sec    2   1.41 KBytes       
[SUM]   0.00-1.00   sec   768 KBytes  6.29 Mbits/sec    8             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes       
[  7]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes       
[  9]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes       
[ 11]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec    0   1.41 KBytes       
[SUM]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec    0 
...

SW flowtable entries:

root@OpenWrt:/sys/kernel/debug/ppe# conntrack -L | grep OFF
tcp      6 src=192.168.1.220 dst=10.1.0.1 sport=57834 dport=5201 packets=22 bytes=43181 src=10.1.0.1 dst=10.1.0.2 sport=5201 dport=57834 packets=24 bytes=1256 [HW_OFFLOAD] mark=0 use=2
tcp      6 src=192.168.1.220 dst=10.1.0.1 sport=57812 dport=5201 packets=7 bytes=541 src=10.1.0.1 dst=10.1.0.2 sport=5201 dport=57812 packets=12 bytes=641 [HW_OFFLOAD] mark=0 use=2
tcp      6 src=192.168.1.220 dst=10.1.0.1 sport=57844 dport=5201 packets=18 bytes=42973 src=10.1.0.1 dst=10.1.0.2 sport=5201 dport=57844 packets=23 bytes=1204 [HW_OFFLOAD] mark=0 use=2
tcp      6 src=192.168.1.220 dst=10.1.0.1 sport=57854 dport=5201 packets=17 bytes=42921 src=10.1.0.1 dst=10.1.0.2 sport=5201 dport=57854 packets=24 bytes=1256 [HW_OFFLOAD] mark=0 use=2
tcp      6 src=192.168.1.220 dst=10.1.0.1 sport=57822 dport=5201 packets=22 bytes=41733 src=10.1.0.1 dst=10.1.0.2 sport=5201 dport=57822 packets=22 bytes=1152 [HW_OFFLOAD] mark=0 use=2
conntrack v1.4.8 (conntrack-tools): 239 flow entries have been shown.

HW:

root@OpenWrt:/sys/kernel/debug/ppe# cat entries 
000d4 BND IPv4 5T orig=192.168.1.220:57854->10.1.0.1:5201 new=10.1.0.2:57854->10.1.0.1:5201 eth=00:58:28:29:c1:b1->84:a9:38:af:ab:f8 etype=0800 data=007f0000 vlan=0,0 ib1=21000173 ib2=0003e0c5 packets=0 bytes=0
000dc BND IPv4 5T orig=192.168.1.220:57822->10.1.0.1:5201 new=10.1.0.2:57822->10.1.0.1:5201 eth=00:58:28:29:c1:b1->84:a9:38:af:ab:f8 etype=0800 data=007f0000 vlan=0,0 ib1=21000173 ib2=0003e0c5 packets=0 bytes=0
004d0 BND IPv4 5T orig=192.168.1.220:57834->10.1.0.1:5201 new=10.1.0.2:57834->10.1.0.1:5201 eth=00:58:28:29:c1:b1->84:a9:38:af:ab:f8 etype=0800 data=007f0000 vlan=0,0 ib1=21000173 ib2=0003e0c5 packets=0 bytes=0
0088c UNB IPv4 5T orig=10.1.0.1:5201->10.1.0.2:57812 new=183.3.207.148:40978->198.23.237.17:65160 eth=00:00:00:00:00:00->00:00:00:00:00:00 etype=0000 data=00000000 vlan=0,0 ib1=10000076 ib2=1451e1d4 packets=0 bytes=0
009e4 UNB IPv6 3T orig=fe80:0000:0000:0000:86a9:38ff:feaf:abf8->ff02:0000:0000:0000:0000:0000:0000:0002 eth=00:00:00:00:00:00->00:00:00:00:00:00 etype=0000 data=00000000 vlan=0,0 ib1=58000076 ib2=86a938ff packets=0 bytes=0
00ad4 BND IPv4 5T orig=192.168.1.220:57844->10.1.0.1:5201 new=10.1.0.2:57844->10.1.0.1:5201 eth=00:58:28:29:c1:b1->84:a9:38:af:ab:f8 etype=0800 data=007f0000 vlan=0,0 ib1=21000173 ib2=0003e0c5 packets=0 bytes=0
01818 UNB IPv4 5T orig=192.168.1.220:50084->10.1.0.1:5201 new=4.129.207.55:32784->76.54.126.77:63 eth=00:00:00:00:00:00->00:00:00:00:00:00 etype=0000 data=00000000 vlan=0,0 ib1=1000084a ib2=c3a41451 packets=0 bytes=0

@hzyitc

hzyitc commented Oct 25, 2025

Copy link
Copy Markdown
Contributor Author

Yes, of course.

I use lan1(2.5GbE) as WAN, lan2-4 (1GbE * 3) as LAN.

For 64B, I can reach 4.5Mpps.

image

For 1514B, I can got 5Gbps.

image

@abajk

abajk commented Oct 25, 2025

Copy link
Copy Markdown
Contributor

Yes, of course.

I use lan1(2.5GbE) as WAN, lan2-4 (1GbE * 3) as LAN.

For 64B, I can reach 4.5Mpps.

On OpenWrt or stock firmware?

@hzyitc

hzyitc commented Oct 25, 2025

Copy link
Copy Markdown
Contributor Author

openwrt. use #20486

@abajk

abajk commented Oct 25, 2025

Copy link
Copy Markdown
Contributor

How do you generate traffic?

@hzyitc

hzyitc commented Oct 25, 2025

Copy link
Copy Markdown
Contributor Author

@abajk

abajk commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

Please rebase this PR to remove the merge commit.

@abajk

abajk commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

@hzyitc ping

@hzyitc

hzyitc commented Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

Please rebase this PR to remove the merge commit.

done.

There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
@openwrt-bot
openwrt-bot merged commit a19ccd9 into openwrt:main Nov 20, 2025
codetiger666 pushed a commit to codetiger666/openwrt that referenced this pull request Nov 21, 2025
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Nov 21, 2025
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt/openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Nov 22, 2025
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
@hzyitc
hzyitc deleted the airoha-enable-npu branch November 26, 2025 13:55
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Dec 16, 2025
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt/openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
HateTM pushed a commit to HateTM/tpl_ax80_ubi that referenced this pull request Jan 6, 2026
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
LuisMitaHL pushed a commit to LuisMitaHL/LooperWrt that referenced this pull request Sep 21, 2026
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
Quarx2k pushed a commit to Quarx2k/OpenWRT-BE7000 that referenced this pull request Sep 22, 2026
There is no reason not to do this.

Use the following commands to enable hardware offloading:
    uci set firewall.@defaults[0].flow_offloading='1'
    uci set firewall.@defaults[0].flow_offloading_hw='1'
    uci commit

Signed-off-by: Ziyang Huang <[email protected]>
Link: openwrt/openwrt#20484
Signed-off-by: Christian Marangi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/airoha pull request/issue for airoha target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants