coolsnowwolf / lede

Lean's LEDE source
Other
29.17k stars 19.46k forks source link

mt7621 全新 hwnat 驱动测试帖 #9450

Closed aiamadeus closed 1 year ago

aiamadeus commented 2 years ago

让大家久等了,首先非常感谢 @MeIsReallyBa 大佬带我玩。想必有些人已经看到恩山上大佬发的帖子了,但要让版本号党失望的是我并没有拿大佬已经搞好的 5.10 内核+ mt7621 sdk 来做[1] 。 此套代码基于 mtk 前些天刚放出的 mtk 820/830 开源代 (kernel 5.4),并成功移植到了 mt7621 5.4 内核上。这套代码有个优点就是功能实现都集中在相关驱动里面 [2] (看注释),不需要更改内核其它地方,整体驱动部分也更为简洁。还有个考虑就是不可能所有设备都改回 switch,所以 dsa hwnat 也是要尽量实现的[3]。移植过程中看到的几个 kernel panic 无限重启问题我均已修复,所以大家不必过于担心测试的时候路由器炸了(xD

测试源码地址:https://github.com/AmadeusGhost/lede/tree/ramips

git clone -b ramips --single-branch https://github.com/AmadeusGhost/lede

测试要求:

[1] 5.10 对我这种菜鸡来说过于先进,存在一些代码无法如期工作的情况,短期内不会考虑支持。
[2] hwnat 的 pppoe 部分使用了 nf_flow_table 框架,所以 luci turboacc 插件的 flow offload 还是
    要选的,刷进去之后记得进 turboacc 插件里面将 flow offload 关闭,以防止冲突导致 hwnat 失效。
[3] mtk7621 sdk 里面只有 switch 驱动,dsa 上的 hwnat 表现目前没那么好,所以极其不建议想自行
    移植到官方主线的行为(官方的 dsa 实现更为成熟),除非你想一个个改回 switch,那当我没说。
[4] mt7621 并没有无线 hwnat 支持,但可能可以加速 wan to wifi

这是你们能做的:

  1. 我想测试某个机子但源码还没改上,提出需求
  2. 测试了某个机子 ok 没问题,留个言
  3. 暂时没想到

这是你们不能做的:

  1. 不建议水帖,此帖为测试与反馈帖
  2. 禁止讨论除了 mt7621 以外的路由器
  3. 无脑催更想上新内核(如 5.10),除非你给我打钱改变做事优先级
  4. ax6/ax3600 机油会成员与狗不得使用,因此造成全家富贵等情况与我们无关
  5. 禁止任何吵架或者骂人行为,看到了就直接 ban,为什么 issues 现在少有人管懂得都懂
wuzhuang123 commented 1 year ago

我用一根面条线,经常从1G掉到100M。但是以前用官方固件就是正常的。

3255867418 commented 1 year ago

有线生效,但是无线似乎还是走cpu,ksoftirpd会占用大量cpu,r6220 日志如下: [ 21.388119] mediatek_soc_hnat 1e100000.hnat: wan = wan [ 21.398495] mediatek_soc_hnat 1e100000.hnat: lan = lan [ 21.408879] mediatek_soc_hnat 1e100000.hnat: ppd = lan [ 21.419232] mediatek_soc_hnat 1e100000.hnat: gmac num = 1 [ 21.430044] mediatek_soc_hnat 1e100000.hnat: wan dsa port = 4 [ 21.441554] mediatek_soc_hnat 1e100000.hnat: ppe num = 1 [ 21.453030] mediatek_soc_hnat 1e100000.hnat: ext devices = ra0 [ 21.464725] mediatek_soc_hnat 1e100000.hnat: ext devices = rai0 [ 21.476605] mediatek_soc_hnat 1e100000.hnat: ext devices = rax0 [ 21.488464] mediatek_soc_hnat 1e100000.hnat: ext devices = apcli0 [ 21.500688] mediatek_soc_hnat 1e100000.hnat: ext devices = apclii0 [ 21.513095] mediatek_soc_hnat 1e100000.hnat: ext devices = apclix0 [ 21.532490] mediatek_soc_hnat 1e100000.hnat: PPE0 entry number = 16384 [ 21.574754] mediatek_soc_hnat 1e100000.hnat: PPE0 hwnat start [ 21.586475] hnat roaming work enable

maxmib commented 1 year ago

er-x刷了后eth0失效,插网线不亮灯,官版openwrt最新snapshot正常 [ 4.012347] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module [ 4.026265] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21 [ 4.042930] (unnamed net_device) (dummy): netif_napi_add() called with weight 256 [ 4.062478] NET: Registered protocol family 10 [ 4.072935] Segment Routing with IPv6 [ 4.080388] NET: Registered protocol family 17 [ 4.089362] Bridge firewalling registered [ 4.097649] 8021q: 802.1Q VLAN Support v1.8 [ 4.109767] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module [ 4.135934] mt7530 mdio-bus:1f eth0 (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY] [ 4.152452] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth0 [ 4.168476] mt7530 mdio-bus:1f eth1 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY] [ 4.186410] mt7530 mdio-bus:1f eth2 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY] [ 4.204346] mt7530 mdio-bus:1f eth3 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY] [ 4.222278] mt7530 mdio-bus:1f eth4 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY] [ 4.240282] mt7530 mdio-bus:1f: configuring for fixed/rgmii link mode [ 4.257815] DSA: tree 0 setup [ 4.264171] mt7530 mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 4.265215] UBI: auto-attach mtd5 [ 4.284876] ubi0: attaching mtd5 [ 6.805397] ubi0: scanning is finished

izeroo commented 1 year ago

红米AC2100,lede commit ddf2366cf4df1eaae0b1829c3491536e443c5ca5。 测试可以正常使用,速度很快。局域网传输文件可以到700Mbps。 但是有一个问题,开了hwnat之后所有流量统计软件都失效了(nlbwmon, luci-app-wrtbwmon),统计的值很小,不知道该如何解决。不过总体上还是很值得开启的

更新: 已找到解决方案,使用 rmmod mtkhnat 或者 modprobe mtkhnat 即可开关hwnat

sinycn commented 1 year ago

er-x刷了后eth0失效,插网线不亮灯,官版openwrt最新snapshot正常 [ 4.012347] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module [ 4.026265] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21 [ 4.042930] (unnamed net_device) (dummy): netif_napi_add() called with weight 256 [ 4.062478] NET: Registered protocol family 10 [ 4.072935] Segment Routing with IPv6 [ 4.080388] NET: Registered protocol family 17 [ 4.089362] Bridge firewalling registered [ 4.097649] 8021q: 802.1Q VLAN Support v1.8 [ 4.109767] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module [ 4.135934] mt7530 mdio-bus:1f eth0 (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY] [ 4.152452] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth0 [ 4.168476] mt7530 mdio-bus:1f eth1 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY] [ 4.186410] mt7530 mdio-bus:1f eth2 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY] [ 4.204346] mt7530 mdio-bus:1f eth3 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY] [ 4.222278] mt7530 mdio-bus:1f eth4 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY] [ 4.240282] mt7530 mdio-bus:1f: configuring for fixed/rgmii link mode [ 4.257815] DSA: tree 0 setup [ 4.264171] mt7530 mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 4.265215] UBI: auto-attach mtd5 [ 4.284876] ubi0: attaching mtd5 [ 6.805397] ubi0: scanning is finished

我也遇到了百思不得其解

maxmib commented 1 year ago

er-x刷了后eth0失效,插网线不亮灯,官版openwrt最新snapshot正常 [ 4.012347] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module [ 4.026265] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21 [ 4.042930] (unnamed net_device) (dummy): netif_napi_add() called with weight 256 [ 4.062478] NET: Registered protocol family 10 [ 4.072935] Segment Routing with IPv6 [ 4.080388] NET: Registered protocol family 17 [ 4.089362] Bridge firewalling registered [ 4.097649] 8021q: 802.1Q VLAN Support v1.8 [ 4.109767] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module [ 4.135934] mt7530 mdio-bus:1f eth0 (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY] [ 4.152452] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth0 [ 4.168476] mt7530 mdio-bus:1f eth1 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY] [ 4.186410] mt7530 mdio-bus:1f eth2 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY] [ 4.204346] mt7530 mdio-bus:1f eth3 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY] [ 4.222278] mt7530 mdio-bus:1f eth4 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY] [ 4.240282] mt7530 mdio-bus:1f: configuring for fixed/rgmii link mode [ 4.257815] DSA: tree 0 setup [ 4.264171] mt7530 mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 4.265215] UBI: auto-attach mtd5 [ 4.284876] ubi0: attaching mtd5 [ 6.805397] ubi0: scanning is finished

我也遇到了百思不得其解

换官方版本openwrt吧,正常使用

lynn5713 commented 1 year ago

GL.inet1300 有线没有问题,无线速度很慢,基本都打不开网页,关闭hwnat后正常。

qwerttvv commented 1 year ago

换官方版本openwrt吧,正常使用

官方版本去哪里下ssr+用啊,有新版的ipk吗

Destroy-God commented 1 year ago

R3G配合HWNAT似乎有问题,每次开机后Wan状态都是未连接,需要等上5到10分钟才能连接,连接成功后再无问题 syslog.txt 系统日志在这里

gsmantenna commented 1 year ago

如何让hwnat 支持 移远的(高通)的RM500Q 5Gnr QMI 吗?