mbufq-less iwn(4)

Gleb Smirnoff glebius at FreeBSD.org
Tue Sep 1 11:20:53 UTC 2015


  Hi, Adrian and Andriy!

  One of the fundamental things that me and Lawrence want to bring to
FreeBSD 12 (probably won't be in time with 11), is the NIC TX exhaustion
notification to the stack, also named as "network stack backpressure".

The problem is that when NICs TX queue is full we start to lose packets,
just as if they were lost somewhere in a wire, outside of our control.
Of course TCP engine copes with that and does necessary retransmitting.

The idea is that we can make TCP perform much better, is we report the
TX problem to it via ENOBUFS and DO NOT free the mbuf, since protocol
may have better idea on its destiny.

In the projects/ifnet branch, I already put this idea into the code.
In the branch drivers if_transmit doesn't free. I also put this idea
into the recent net80211 changes. New ic_transmit doesn't free. However,
due to most drivers have software queues as historical artifact, this
new semantic of ic_transmit is degenerated.

So, the long term plan is to slowly get rid of software mbuf queues
in drivers. The protocols should care about queueing (for example
ARP already does :)). We probably won't be able to get rid of software
queues everywhere before Lawrence does the needed work to TCP, since
now software queues are smoothing transmission for drivers that have
very small hardware queues.

Speaking particularly about iwn(4). Looks like the hardware has
enough descriptors to run w/o software queue. Right now writing
this email through WiFi connection with patched driver. Didn't
notice any issues with download/upload speed.

Any objections on checking it in?

-- 
Totus tuus, Glebius.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iwn-queueless.diff
Type: text/x-diff
Size: 4057 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20150901/b64b6866/attachment.bin>


More information about the freebsd-net mailing list