Bug 200993 - iwlwifi: 9560: Very Slow Transfer Speed on Ubuntu 18.04 LTS
Summary: iwlwifi: 9560: Very Slow Transfer Speed on Ubuntu 18.04 LTS
Status: CLOSED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: Intel Linux
: P1 high
Assignee: DO NOT USE - assign "network-wireless-intel" component instead
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-02 08:40 UTC by Mister Toszter
Modified: 2018-09-04 06:35 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.15
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Kernel Log (67.23 KB, text/plain)
2018-09-02 09:32 UTC, Mister Toszter
Details

Description Mister Toszter 2018-09-02 08:40:07 UTC
Related: https://askubuntu.com/questions/1058856/slow-wifi-ubuntu-18-04-with-intel-card

CPU: i7-8750H
GPU: GTX 1070 MAX-Q+8GB
NIC: INTEL WI-FI 9560 AC+BT5 M.2
RAM: 32GB DDR4
Linux Kernel: 4.15

Many people are reporting that the adapters for Linux using Intel's M.2 Wireless Cards aren't properly routing packets at high speed anywhere near the reported capabilities. This is clearly a driver issue for Linux users such as myself and should kindly be addressed since so many of us out here want a fast laptop for research without the burden of Windows and the freedom on a *nix environment.

If you'll offer me a clear set of instructions, I can offer a debug log that suites you needs without polluting the airspace now with anything currently unsolicited.

I have read through https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/debugging.

Help me help you fix this. I get really pathetic speeds over my LAN between machines in my office laboratory and it's rather unfortunate if I may say so. I believe in your products and would like this matter resolved as soon as possible. 

I have to rely on a wired connection, which is unfavorable in general due to the nature of my work.

Sincere thanks!
Comment 2 Emmanuel Grumbach 2018-09-02 09:03:11 UTC
Please share your dmesg output.
Comment 3 Mister Toszter 2018-09-02 09:32:42 UTC
Created attachment 278239 [details]
Kernel Log

As requested, the log.
Comment 4 Mister Toszter 2018-09-02 09:34:45 UTC
firmware-version: 34.0.0
Comment 5 Emmanuel Grumbach 2018-09-02 09:35:47 UTC
In this log you didn't even initiate a connection.

What I did see is that you use a firmware that is fairly old. Unfortunately, in order to be able to use a newer firmware you will need to upgrade your driver.

This can be done by using our core releases.

https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/core_release

I suggest you take our master branch for the driver and the latest firmware.
Comment 6 Emmanuel Grumbach 2018-09-02 09:42:39 UTC
Sorry, my bad.
You did have a connection:

[   25.394348] wlo1: authenticate with b0:39:56:96:1a:90
[   25.401066] wlo1: send auth to b0:39:56:96:1a:90 (try 1/3)
[   25.440807] wlo1: authenticated
[   25.444044] wlo1: associate with b0:39:56:96:1a:90 (try 1/3)
[   25.452261] wlo1: RX AssocResp from b0:39:56:96:1a:90 (capab=0x1431 status=0 aid=4)
[   25.453911] wlo1: associated
[   25.489520] IPv6: ADDRCONF(NETDEV_CHANGE): wlo1: link becomes ready


All looks good from that perspective.

Can you please run a few pings to your AP and see what happens?
I'd like to check the latency.
Also, please try to load iwlmvm with 'power_scheme=1'. In order to do that, add:

options iwlmvm power_scheme=1

to /etc/modprobe.d/iwlwifi.conf

Reboot, and let us know whether it feels better.
Comment 7 Mister Toszter 2018-09-02 09:47:39 UTC
Speedtest.net speeds

Wired:    113.59 Mbps Down / 11.51 Mbps Up
Wireless: 2.79 Mbps Down / 7.42 Mbps Up @ 2.4 GHz
          2.79 Mbps Down / 10.86 Mbps Up @ 5.0 Ghz

:~$ sudo iwconfig
enp3s0    no wireless extensions.

wlo1      IEEE 802.11  ESSID:"_/|\_+AzatarA+_/|\_"  
          Mode:Managed  Frequency:5.805 GHz  Access Point: B0:39:56:96:1A:92   
          Bit Rate=866.7 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=70/70  Signal level=-32 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:77   Missed beacon:0

*********************************************************************
Wireless: 3.55 Mbps Down / 11.33 Mbps Up @ 5.0 Ghz

:~$ sudo iwconfig
enp3s0    no wireless extensions.

wlo1      IEEE 802.11  ESSID:"_/|\_+AzatarA+_/|\_"  
          Mode:Managed  Frequency:5.805 GHz  Access Point: B0:39:56:96:1A:92   
          Bit Rate=866.7 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-23 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:78   Missed beacon:0
Comment 8 Mister Toszter 2018-09-02 09:51:14 UTC
I see this inside iwlwifi.conf ... should I append or prepend your suggestion?

 remove iwlwifi \
 (/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
 && /sbin/modprobe -r mac80211


Also, is it wise to get the wifi driver per your earlier instructions?
Comment 9 Mister Toszter 2018-09-02 10:07:21 UTC
After the config change barely 3.80 Mbps Down and still slower down than uploading. So, no dice. This is a 1Gbit card. It should cook with gas, my friend!
:)

There has to be something more to this that needs fixing.
Comment 10 Emmanuel Grumbach 2018-09-02 10:31:48 UTC
(In reply to Mister Toszter from comment #8)
> I see this inside iwlwifi.conf ... should I append or prepend your
> suggestion?
> 
>  remove iwlwifi \
>  (/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs
> /sbin/rmmod) \
>  && /sbin/modprobe -r mac80211
> 
> 
> Also, is it wise to get the wifi driver per your earlier instructions?

Yes.
Comment 11 Mister Toszter 2018-09-02 16:49:43 UTC
(In reply to Emmanuel Grumbach from comment #5)
> What I did see is that you use a firmware that is fairly old. Unfortunately,
> in order to be able to use a newer firmware you will need to upgrade your
> driver.
> 
> This can be done by using our core releases.
> 
> https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/core_release
> 
> I suggest you take our master branch for the driver and the latest firmware.

I did these steps:

    1. Cloned https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/

    2. Cloned https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/

    3. Cloned https://w1.fi/cgit/hostap/

    4. Per the wiki, "For all the Core releases, the master branch hostap should be taken.". So I read through the README in the wpa_supplicant and looked at the examples but I am uncertain of which options to use in the config before building. https://w1.fi/cgit/hostap/tree/wpa_supplicant/README 

I attempted to compile the doxygen files in the docs folder, but a missing .png file prevented that possibility.

Can you offer a little more guidance on how to execute your suggestion to take your master branch driver and latest firmware?

I'm happy to follow along to the letter. I really want to avoid accidentally damaging my OS before I have had a chance to pull the NVMe drive and clone an image, but at the same time I have paid work that is painfully slow without a properly working wireless card.

Thank you!
Comment 12 Mister Toszter 2018-09-02 17:01:44 UTC
I see the latest firmware in the top level of the master branch is for either the 9000 [0] or 9260 [1] but not 9560... is this card not fully supported by these firmwares? 

If that is so, it's ok, though I wonder how long it will take for a proper 9560 fw release?

[0] https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/tree/iwlwifi-9000-pu-b0-jf-b0-38.ucode
[1] https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/tree/iwlwifi-9260-th-b0-jf-b0-38.ucode
Comment 13 Emmanuel Grumbach 2018-09-02 17:59:26 UTC
9560 needs 9000 I think, just drop both files and let the driver pick the right firmware file.
Comment 14 Emmanuel Grumbach 2018-09-02 18:01:06 UTC
Don't bother changing hostap, just install the new driver and the new firmware files.
Comment 15 Mister Toszter 2018-09-02 18:54:25 UTC
Sorry, need to disambiguate here -- Driver is which file? I understand firmware and will do once I have total clarity. :)
Comment 16 Emmanuel Grumbach 2018-09-02 18:56:27 UTC
The new driver is the backport tree which you compiled. It is not a file, but a tree that you compile and install.
The firmware is the .ucode that you just need to copy to /lib/firwmare.
Comment 17 Mister Toszter 2018-09-03 06:02:48 UTC
Ok, I am running `sudo make && make install` inside the backport-iwlwifi project and then copying the firmware as prescribed.
Comment 18 Mister Toszter 2018-09-03 06:11:24 UTC
All good here? Was this a successful install in your mind's eye? I'm  rebooting. If you don't get a note from me to confirm, it means my OS is hosed and I can't get back into my xcfe desktop. :P

```
:~/Engineering/wifi/backport-iwlwifi$ sudo make install
  Building modules, stage 2.
  MODPOST 6 modules
  INSTALL /home/azatar/Engineering/wifi/backport-iwlwifi/compat/compat.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  INSTALL /home/azatar/Engineering/wifi/backport-iwlwifi/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  INSTALL /home/azatar/Engineering/wifi/backport-iwlwifi/drivers/net/wireless/intel/iwlwifi/mvm/iwlmvm.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  INSTALL /home/azatar/Engineering/wifi/backport-iwlwifi/drivers/net/wireless/intel/iwlwifi/xvt/iwlxvt.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  INSTALL /home/azatar/Engineering/wifi/backport-iwlwifi/net/mac80211/mac80211.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  INSTALL /home/azatar/Engineering/wifi/backport-iwlwifi/net/wireless/cfg80211.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  4.15.0-33-generic
depmod will prefer updates/ over kernel/ -- OK!
Note:
You may or may not need to update your initramfs, you should if
any of the modules installed are part of your initramfs. To add
support for your distribution to do this automatically send a
patch against "update-initramfs.sh". If your distribution does not
require this send a patch with the '/usr/bin/lsb_release -i -s'
("Ubuntu") tag for your distribution to avoid this warning.

Your backported driver modules should be installed now.
Reboot.
```
Comment 19 Mister Toszter 2018-09-03 06:43:36 UTC
Aummmm. The balance of the Universe is again restored.

Speedtest.net speeds

Wired:    95.97 Mbps Down / 11.51 Mbps Up
Wireless: 114.53 Mbps Down / 11.44 Mbps Up @ 5.0 Ghz

Will this ticket remain as a reference that I can freely distribute to others in the same situation as well as Ubuntu maintainers for the improvement of software drivers?

Lastly, i really appreciate your support with this. Glad we got it sorted. :D
Comment 20 Emmanuel Grumbach 2018-09-03 06:56:38 UTC
I'll close this ticket, but the URL will still be valid.

Share it with whoever you want.
Comment 21 Emmanuel Grumbach 2018-09-03 06:58:15 UTC
BTW, what can help us here, is to remove the new firmware (-38.ucode) and stay with with the original firmware (-34.ucode) and the new driver.
If that still works nicely, then we know that we have a driver bug that has been fixed.
Comment 22 Mister Toszter 2018-09-03 07:15:01 UTC
Yessir, confirmed by rm'ing the *38.ucode and replacing with *34.ucode --- Speed remains >100Mbps after reboot. 

The previous driver was infallibly the culprit of the communications caper.

I'm switching back to *38.ucode just because.

Thanks again.
Comment 23 Emmanuel Grumbach 2018-09-03 09:42:02 UTC
All right. Then we should try to find the commit that fixed that and have it backported...
Comment 24 Mister Toszter 2018-09-03 15:47:04 UTC
o.O Indeed. Let me know if I can be of assistance with that process.
Comment 25 Emmanuel Grumbach 2018-09-03 16:14:43 UTC
If you could bisect the backport tree and find the commit that fixes the problem, that'd be awesome.
Comment 26 Mister Toszter 2018-09-03 22:52:35 UTC
Oh man, I'd need to continuously build, install and test a machine running 18.04 through each commit. I admit I am too sppoked of Murphy and his silly Law.

Because my lappy is working now, I'd be reluctant to do that on my machine...

Any chance of a small budget to acquire a less important (and much less expensive) machine with an M.2 slot for NIC and I could be persuaded to test the 9000 series and any other NICs on that rig to help out. 

Before you note anything absurd about that request, just know it's worth mentioning because I am willing take it even further to help out across the broader scope of boards by testing multiple NICs against the codebase and return the machine and any equipment when all is said and done. 

:)
Comment 27 Emmanuel Grumbach 2018-09-04 06:35:59 UTC
Forget it. We'll try to find the right commit.

Thanks and enjoy!

Note You need to log in before you can comment on or make changes to this bug.