Talk: "Reducing Latency in Linux Wireless Network Drivers" (Tim Shepard)


Qdiscs such as fq_codel can be used to reduce latency in the Linux network queues. But a network device driver that has (perhaps good) reason to pull packets out of the Linux qdisc before it is actually time to transmit them can reintroduce queuing latency (in some cases much more than we would like) and result in head-of-line blocking for traffic for which the qdisc configuration is supposed to provide prioritized low-latency service.

Good reasons for a network device driver to pull packets early out of the qdisc include: (1) it needs to schedule transmissions to different destinations subject to constraints that vary per destination, (2) it needs to aggregate packets together for transmission in lower-layer bundles (to better amortize per-transmission overhead and achieve good throughput), and (3) it needs to make sure it has chained enough packets up for device DMA ahead of time so that it doesn't risk leaving the channel idle while there are more packets queued for transmission. Wireless network device drivers have all three of these, and another wrinkle: the transmission rates vary.

Byte Queue Limits (BQL) already provides a good auto-tuning solution for device drivers which only have reason (3) and whose transmission rates are not varying. Many wired network device drivers have already been enhanced with BQL to automatically figure out just the right amount of bytes to commit to the DMA queues to achieve high throughput without adding unnecessary latency. But adapting Byte Queue Limits for wireless network device drivers is not so straightforward. Besides (1) through (3) above and the extra wrinkle of varying transmission rates, wireless devices (in hardware, below the device driver) can also take varying lengths of time per transmitted packet at a given rate because of hardware retransmissions and unpredictable channel access times (e.g. on a busy channel).

We review some work towards solving this problem (e.g. mac80211 intermediate software queues), explain what is still missing, and discuss our work underway to deveop a BQL-like solution appropriate for mac80211 wireless drivers and demonstate its operation.