# Intel WiFi card working but slow



## jbo (Aug 20, 2020)

I am running FreeBSD 12.1 on a Lenovo Thinkpad X1 carbon (3rd generation).
The laptop comes equipped with an Intel AC-7265 wireless chipset which appears to be supported by the `iwm` driver.

After loading the appropriate driver I am able to the card up and running. The driver is loaded by editing /boot/loader.conf accordingly:

```
if_iwm_load="YES"
iwm7265Dfw_load="YES"
```

My /etc/rc.conf contains the following:

```
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP powersave"
```

Everything works as expected - even in ac mode apparently!

```
jbo@x1carbon ~> sudo ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 4c:34:88:3f:47:fb
    inet 192.168.1.165 netmask 0xffffff00 broadcast 192.168.1.255
    groups: wlan
    ssid lighthouse channel 44 (5220 MHz 11a) bssid 18:e8:29:95:d6:7d
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit powersavemode CAM powersavesleep 100
    txpower 17 bmiss 10 mcastrate 6 mgmtrate 6 scanvalid 60 wme
    roaming MANUAL
    media: IEEE 802.11 Wireless Ethernet OFDM/48Mbps mode 11a
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```

However, I can't manage to get this thing to work at more than 22 Mbps

```
jbo@x1carbon ~ [127]> iperf3 -c 192.168.1.10
Connecting to host 192.168.1.10, port 5201
[  5] local 192.168.1.165 port 53352 connected to 192.168.1.10 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  2.65 MBytes  22.3 Mbits/sec    0   65.1 KBytes
[  5]   1.00-2.00   sec  2.59 MBytes  21.8 Mbits/sec    0   65.1 KBytes
[  5]   2.00-3.00   sec  2.63 MBytes  22.0 Mbits/sec    0   65.1 KBytes
[  5]   3.00-4.00   sec  2.59 MBytes  21.7 Mbits/sec    0   65.1 KBytes
[  5]   4.00-5.00   sec  2.60 MBytes  21.8 Mbits/sec    0   65.1 KBytes
[  5]   5.00-6.00   sec  2.59 MBytes  21.7 Mbits/sec    0   65.1 KBytes
[  5]   6.00-7.00   sec  2.55 MBytes  21.4 Mbits/sec    0   65.1 KBytes
[  5]   7.00-8.00   sec  2.58 MBytes  21.6 Mbits/sec    0   65.1 KBytes
[  5]   8.00-9.00   sec  2.58 MBytes  21.6 Mbits/sec    0   65.1 KBytes
[  5]   9.00-10.00  sec  2.56 MBytes  21.5 Mbits/sec    0   65.1 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  25.9 MBytes  21.7 Mbits/sec    0             sender
[  5]   0.00-10.18  sec  25.9 MBytes  21.3 Mbits/sec                  receiver

iperf Done.
```
(The machine acting as the `iperf3` server is on the same network (but connected via ethernet) and is more than capable of handling a full 1 Gbps connection.

Browsing the net it seems that 802.11ac support in the `iwm` driver has definitely recevied some work. Given that according to `ifconfig` the card is successfully using the 5GHz frequency I assume that this is sort of working - but I'm unclear on whether that is the issue or not. Could anybody lead towards a direction in either debugging or state of the iwm driver and 802.11ac support?


----------



## kpedersen (Aug 20, 2020)

```
ifconfig_wlan0="WPA SYNCDHCP powersave"
```

How is it if you remove powersave mode?


----------



## mark_j (Aug 20, 2020)

You're running 11a, so 20mbits is to be expected, unfortunately.
Work is under way for 11ac but I don't know the current status. https://wiki.freebsd.org/WiFi/80211ac

Estimate? FreeBSD 13R.


----------



## rootbert (Aug 20, 2020)

the status is sad -  that we have such a small amount of devs that we are dependent on one developer in order to get 11ac ... https://adrianchadd.blogspot.com/2020/07/im-back-into-grind-of-freebsds-wireless.html


----------



## jbo (Aug 21, 2020)

kpedersen said:


> How is it if you remove powersave mode?


Same - no real changes in throughput - just some initial latency increase with the powersave on.



mark_j said:


> You're running 11a, so 20mbits is to be expected, unfortunately.


Is there anything I can do to get more throughput? Can I force using 802.11g to get at least 54 Mbps? 802.11n should get me even more, right?



rootbert said:


> the status is sad - that we have such a small amount of devs that we are dependent on one developer in order to get 11ac ... https://adrianchadd.blogspot.com/2020/07/im-back-into-grind-of-freebsds-wireless.html


So I am far from being an old, experienced programmer. I have about 10 years of serious experience as a C/C++ dev especially on embedded systems. Would this be enough to help out or would working on the 802.11ac driver be beyond my skills & abilities to learn within a useful amount of time?
Unfortunately I never worked on any FreeBSD code before - so far I have just been a very happy user of it. But I think the bigger problem will be that I never worked directly with WiFi. My "network programming" experiences stem from embeded systems running GSM, ZigBee and LoRa - nothing close to 802.11ac.

This might sound silly but the missing 802.11ac support is basically the only thing keeping me from using FreeBSD as my daily driver.


----------



## mark_j (Aug 21, 2020)

joel.bodenmann said:


> Same - no real changes in throughput - just some initial latency increase with the powersave on.
> 
> 
> Is there anything I can do to get more throughput? Can I force using 802.11g to get at least 54 Mbps? 802.11n should get me even more, right?



In /etc/rc.conf modify:
`ifconfig_wlan0="mode 11g ..."`

Read: https://www.freebsd.org/doc/handbook/network-wireless.html




joel.bodenmann said:


> So I am far from being an old, experienced programmer. I have about 10 years of serious experience as a C/C++ dev especially on embedded systems. Would this be enough to help out or would working on the 802.11ac driver be beyond my skills & abilities to learn within a useful amount of time?
> Unfortunately I never worked on any FreeBSD code before - so far I have just been a very happy user of it.
> 
> This might sound silly but the missing 802.11ac support is basically the only thing keeping me from using FreeBSD as my daily driver.



Honestly, I don't know. Writing drivers is not an easy process. There's an introduction to it: https://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/driverbasics.html

If you're serious there's a book by Joseph Kong: FREEBSD DEVICE DRIVERS - A Guidefor the Intrepid.

As to the 802.11ac, for sure, I think this is a problem for a lot of people and has been for me. Finally, FreeBSD Foundation heard the screams of the users a few months back and anted up and funded it. *About time* was the collective sigh. Now we wait.


----------



## George (Aug 21, 2020)

So 22 mbps wifi speed is considered slow nowadays. I must be getting old. ;D


----------



## eternal_noob (Aug 21, 2020)

Elazar said:


> So 22 mbps wifi speed is considered slow nowadays. I must be getting old. ;D


Well, these 4K pron videos are huuuge nowadays.


----------



## mark_j (Aug 21, 2020)

Elazar said:


> So 22 mbps wifi speed is considered slow nowadays. I must be getting old. ;D


I know, tell me about it! That's barely fast enough to load a javascript laden web page in under a minute these days.


----------



## mark_j (Aug 21, 2020)

freebsd_noob said:


> Well, these 4K pron videos are huuuge nowadays.


It's getting off topic, but that's what torrents are for.
(Well, so I've been told.... )


----------



## jbo (Aug 21, 2020)

freebsd_noob said:


> Well, these 4K pron videos are huuuge nowadays.


I can assure you that there are plenty of every-day uses non-related to 4k porn that vastly benefit of - or may even require speeds higher than 20 Mbps 



mark_j said:


> In /etc/rc.conf modify:
> Honestly, I don't know. Writing drivers is not an easy process. There's an introduction to it: https://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/driverbasics.html


The introduction is of course just that: An introduction but there was nothing in there that would scare me, throw me off or anything else. Other than the specific kld there's nothing new for me there.
I think that the 802.11ac specific side of things will be a bigger obstacle for me than the FreeBSD / device driver side of things.



mark_j said:


> Finally, FreeBSD Foundation heard the screams of the users a few months back and anted up and funded it. *About time* was the collective sigh. Now we wait.


So basically 802.11ac support is now being funded, therefore more skilled & experienced developers will take up this task and there's little benefit that I start to dive into this, right? Do we know how long we'll (have to) wait?



mark_j said:


> If you're serious there's a book by Joseph Kong: FREEBSD DEVICE DRIVERS - A Guidefor the Intrepid.


I certainly am serious ;-)
I think I'll have a look at that book. If the community thinks that it might be beneficial for somebody new to look into this I'd certainly appreciate it if somebody could point me towards the right directions - maybe some basic mentoring?


----------



## mark_j (Aug 21, 2020)

joel.bodenmann said:


> I can assure you that there are plenty of every-day uses non-related to 4k porn that vastly benefit of - or may even require speeds higher than 20 Mbps
> 
> 
> The introduction is of course just that: An introduction but there was nothing in there that would scare me, throw me off or anything else. Other than the specific kld there's nothing new for me there.
> ...


How long to wait? I'm not privy to the schedule, if there is one.
You should join freebsd-drivers and freebsd-arch for some assistance. See https://docs.freebsd.org/mail/


----------



## kpedersen (Aug 21, 2020)

joel.bodenmann said:


> This might sound silly but the missing 802.11ac support is basically the only thing keeping me from using FreeBSD as my daily driver.



I guess I am lucky in England. Most of our internet infrastructure is so obsolete (and artificially crippled) that many bottlenecks exist before I would even need to consider wifi improvements.


----------

