Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

iwlwifi tricks

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Re: iwlwifi tricks

#1 Post by hkoster1 »

Yes, iwlwifi can be tricky! My own Intel 7260 AC WLAN card is a case in point, for which the iwlwifi-7260-9.ucode firmware packaged with the current 3.16 kernel does not work optimally. Specifically, Power Management cannot be turned off, resulting in terrible lag when there is little network throughput (like when doing some remote system maintenance).

I solved that by using the latest iwlwifi-7260-12.ucode from kernel git sources, which requires kernel 3.17 or later. I installed kernel 3.19 from experimental, and now Power Management on the WLAN card can be switched off, resulting in snappy performance and no more lag. :D

Still, I couldn't get the adapter to honour the kernel option to switch power management off, so I did that with the following entry in /etc/rc.local

Code: Select all

sleep 5 ; /sbin/iw wlan0 set power_save off
There is a timing issue with this command, so adjust the sleep parameter to suit.

Have fun!
Real Debian users don't do chat...

v&n
Posts: 624
Joined: 2015-02-04 02:57

Re: iwlwifi tricks

#2 Post by v&n »

hkoster1 wrote:Still, I couldn't get the adapter to honour the kernel option to switch power management off, so I did that with the following entry in /etc/rc.local

Code: Select all

sleep 5 ; /sbin/iw wlan0 set power_save off
Two comments on this approach :
1) I think it is not a good practice to add any kind of delay in /etc/rc.local file, as executing this script is part of the booting process, and adding delays will also delay all those processes that take place after executing this script. Some of these processes may not tolerate the delay and may fail or otherwise cause unexpected results. A better approach would be to create an executable script containing the sleep time and the command(s), then add a line like -

Code: Select all

bash /home/user/custom_script &
..in the /etc/rc.local file. The "&" at the end of the line will cause the script to run as a background process and the rc.local script itself will quickly move on to the next line in it.

2) Turning off power management by adding a command in the rc.local file helps ONLY when you need to run it only once, which is not always the case. Sometimes some external scripts (like pm-util ones) or one of the drivers will cause the power management to turn back on.

In such cases, if you are using pm-utils, the correct approach is to add the command to turn power management off into /etc/pm/power.d/wireless file, and make it executable (sometimes just creating a blank file would be sufficient).

The iwlwifi driver in newer kernels also uses 'iwldvm' or 'iwlmvm' driver as a dependency. If it happens to be "iwlmvm" driver, it has a parameter called "power_scheme" that offers three power saving modes - 1: Always Active, 2: Balanced, 3: low-power. Default is '2' (balanced). I personally believe that the default 'balanced' mode is one of the major causes that keep turning power-management "on". A solution that I have tested successfully many times with this driver, is to set the "power_scheme" mode to '1' (Active). This can be applied permanently by creating a conf file in /etc/modprobe.d directory -

Code: Select all

sudo tee /etc/modprobe.d/iwlmvm.conf <<< "options iwlmvm power_scheme=1"
Hope it adds some value to the thread.

Koniec12
Posts: 5
Joined: 2015-06-02 10:56

Re: iwlwifi tricks

#3 Post by Koniec12 »

Great tips, thanks a lot. I new this forum would be the deal:) Cheers to everyone:)

v&n
Posts: 624
Joined: 2015-02-04 02:57

Re: iwlwifi tricks

#4 Post by v&n »

wizard10000 wrote: 1. First, I added to /etc/rc.local - disables power management on the wireless card and adds stability:

Code: Select all

ifconfig wlan0 power off
Oops! That ^^ needs correction wizard10000. It is "iwconfig", not "ifconfig" that offers the 'power off' option. So the above should be either -

Code: Select all

iwconfig wlan0 power off
(in the /etc/pm/power.d/wireless file IF using pm-utils, as recommended in my previous post)

Or,

Code: Select all

/sbin/iw wlan0 set power_save off
(same as the 'iwconfig' command I believe, doesn't need "wireless-tools" installed first)

Noticed the 'ifconfig' error just now in another thread where this one was referred to by Head_on_a_Stick.

fmp
Posts: 40
Joined: 2017-09-09 04:01

Re: iwlwifi tricks

#5 Post by fmp »

I tweaked my wifi settings based on some suggestions here and the difference is staggering.

Thanks so much for creating this thread!!

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: iwlwifi tricks

#6 Post by wizard10000 »

My user account here vanished so am reposting stuff from the Wayback Machine :mrgreen:

Have Dell Precision M4500 running Sid with probably not the best wireless card, an Intel 6300. Did a bunch of research this evening on optimizing this particular chipset and after much testing and benchmarking moving a 2gb file over 802.11n with NFS, here's what I came up with. All are easily reversible -

1. First, I added to /etc/rc.local - disables power management on the wireless card and adds stability:

Code: Select all

iwconfig wlan0 power off

2. Created a text file called /etc/modprobe.d/iwlwifi.conf - the file contains

Code: Select all

options iwlwifi led_mode=1 # turns irritating blinking wifi led to on when wifi is on

# options iwlwifi 11n_disable=1 # disable 802.11n

options iwlwifi 11n_disable=8 # enable antenna aggregation

options iwlwifi swcrypto=1 # enable software encryption - helps performance on some intel cards
Self explanatory, and all options can be reversed by editing a text file.

Some people had better throughput disabling 802.11n altogether; that made things worse in my case.

Anyway, some stuff to play with if you feel like messing around with iwlwifi. I saw pretty solid improvement with just a little tweaking and testing.

cheers -
we see things not as they are, but as we are.
-- anais nin

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: iwlwifi tricks

#7 Post by wizard10000 »

Thanks for the info :)

My card uses iwldvm, so here's where I ended up -

Code: Select all

options iwlwifi led_mode=1 power_save=0 11n_disable=8 swcrypto=1

# parm:           swcrypto:using crypto in software (default 0 [hardware]) (int)
# parm:           11n_disable:disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX (uint)
# parm:           amsdu_size_8K:enable 8K amsdu size (default 0) (int)
# parm:           fw_restart:restart firmware in case of error (default true) (bool)
# parm:           antenna_coupling:specify antenna coupling in dB (defualt: 0 dB) (int)
# parm:           wd_disable:Disable stuck queue watchdog timer 0=system default, 1=disable (default: 1) (int)
# parm:           nvm_file:NVM file name (charp)
# parm:           uapsd_disable:disable U-APSD functionality (default: Y) (bool)
# parm:           bt_coex_active:enable wifi/bt co-exist (default: enable) (bool)
# parm:           led_mode:0=system default, 1=On(RF On)/Off(RF Off), 2=blinking, 3=Off (default: 0) (int)
# parm:           power_save:enable WiFi power management (default: disable) (bool)
# parm:           power_level:default power save level (range from 1 - 5, default: 1) (int)
# parm:           fw_monitor:firmware monitor - to debug FW (default: false - needs lots of memory) (bool)
we see things not as they are, but as we are.
-- anais nin

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: iwlwifi tricks

#8 Post by wizard10000 »

v&n wrote:1. First, I added to /etc/rc.local - disables power management on the wireless card and adds stability:

Code: Select all

ifconfig wlan0 power off
Oops! That ^^ needs correction wizard10000. It is "iwconfig", not "ifconfig" that offers the 'power off' option. So the above should be either -

Code: Select all

iwconfig wlan0 power off
(in the /etc/pm/power.d/wireless file IF using pm-utils, as recommended in my previous post)

Or,

Code: Select all

/sbin/iw wlan0 set power_save off
(same as the 'iwconfig' command I believe, doesn't need "wireless-tools" installed first)

Noticed the 'ifconfig' error just now in another thread where this one was referred to by Head_on_a_Stick.
Thanks - fixed above :D
we see things not as they are, but as we are.
-- anais nin

Post Reply