Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mac80211: rt2x00: experimental improvements for MT7620 wifi
Serge Vasilugin reports: To improve mt7620 built-in wifi performance some changes: 1. Correct BW20/BW40 switching (see comments with mark (1)) 2. Correct TX_SW_CFG1 MAC reg from v3 of vendor driver see https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531 3. Set bbp66 for all chains. 4. US_CYC_CNT init based on Programming guide, default value was 33 (pci), set chipset bus clock with fallback to cpu clock/3. 5. Don't overwrite default values for mt7620. 6. Correct some typos. 7. Add support for external LNA: a) RF and BBP regs never be corrected for this mode b) eLNA is driven the same way as ePA with mt7620's pin PA but vendor driver explicitly pin PA to gpio mode (for forrect calibration?) so I'm not sure that request for pa_pin in dts-file will be enough First 5 changes (really 2) improve performance for boards w/o eLNA/ePA. Changes 7 add support for eLNA Configuration w/o eLAN/ePA and with eLNA show results tx/rx (from router point of view) for each stream: 35-40/30-35 Mbps for HT20 65-70/60-65 Mbps for HT40 Yes. Max results for 2T2R client is 140-145/135-140 with peaks 160/150, It correspond to mediatek driver results. Boards with ePA untested. Reported-by: Serge Vasilugin <vasilugin@yandex.ru> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
- Loading branch information
Showing
17 changed files
with
467 additions
and
15 deletions.
There are no files selected for viewing
423 changes: 423 additions & 0 deletions
423
package/kernel/mac80211/patches/rt2x00/992-rt2x00-more-fixes.patch
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it planned to backport these changes to the 22.03 branch?
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but after some more reports about performance of users of different mt7620 boards have been received.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dangowrt Thank you, I've picked this commit from your staging branch since June, and upload and download speeds can easily reach 100+ Mbps on HiWiFi HC5661, w/o PA/LNA. Everything works fine except for some unimportant warnings under heavy load.
And one more question, youku_yk-l1 has no PA and LNA, why do we still set its PA pin? thanks again.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another serious issue of MT7620.
#10707
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not related to this commit, but mt7620's TX power is incorrect. I can set it to 30 dbm, but not much different from 17-20 dbm. It seems that all devices have this problem. If anyone interested in this question, maybe this document will be helpful. MT7620_EEPROM_Content_v1_7
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.... Thank you for pointing that out. That change to the youku_yk-l1 was committed by mistake. I used this board for testing the new pinctrl codepaths which only have effect on eLNA/ePA devices (because I don't have any other MT7620 device). Will revert that part in a later commit.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. TSSI is still missing entirely in rt2x00 and has to be implemented for power levels to be accurate. See here in the vendor driver to get an idea.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dangowrt i tested two devices (TP-Link RE210 & Netgear EX3700) but had the same throughput on 2GHz - didn't matter if the patchset was applied or not. i tested the throughput with iperf3. i'd like to help with testing as i have 2-3 more devices but i'd like to know the testing method you were using to see the performance increase.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achterin There have been some ipv6 issues related to dnsmasq (perhaps nftables). We can solve it by disabling ipv6 or upgrading dnsmasq. see #10820
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i used ipv4 addresses, so this should not be related
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My carrier also does not provide ipv6. Anyway when I disable all ipv6 options, I can really get a significant speed increase. 40-60M to 120+M with 2 * 2 mimo and force 40 mhz, tested with iperf3. Using the top command, you can see that some soft interrupts occupy a lot of CPU resource in ipv6 mode.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achterin The improvements reported by forum user 123serge123 mostly affect devices with external LNA. However, also HT40 mode was significantly improved and you should notice.
Did you set
option noscan '1'
(to force HT40 mode despite the presence of other networks in the same band)?31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, i only set
htmode
toht40
but i will try this option next time. thanks for the hint!31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achterin The name of this command is
top
😂, we can execute it in OpenWrt SSH to watch cpu status. 80 Mbit/s is already a significant improvement. Before this commit, I remember it had never been reached to 40 Mbit/s.31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, now i get it xD i know what top is for, i just misunderstood your answer. as said, both devices achieved ~80Mbit/s regardless of the patch being applied or not. but is will redo the test with the option @dangowrt suggested.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, set
option txpower '5'
or something similarly low. With full output power the chip quickly overheats which harms performance.31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this improvement apply to mt7620n as well as mt7620a? If so, I have a mt7620n router and I can test it.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should improve performance also on mt7620n, though the difference before/after is bigger on mt7620a.
31a6605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from Phicomm K2:
iwinfo
is very weak (only the value is very weak, but the actual signal strength is normal). There is another feedback: Upgrade 21.02.03 to 22.03.02: 2.4GHz incoming WiFi signal (bgn) drops by 20dBm after upgrade #11036explicitly pin PA to gpio mode
will not take effect. Referring to the mt7620 pinctrl driver, the PA pin should still be used as the PA mode.