On Sun, Oct 11, 2015 at 12:11:22PM -0400, Ted Unangst wrote: > oh, ok. it look like the short command path wasn't using an mbuf, but i got > that impression only from looking at the diff. maybe wrong.
No, it's as bad as you think it is. Short commands stick payload data into the Tx descriptor, which is mapped via a different DMA map. So during transmit of normal packets, we always have a descriptor, which points at an mbuf (mapped elsewhere) with a packet in it. Note that the transmit operation is also a firmware command (IWM_TX_CMD). For firmware commands not dealing with packets, there's always a descriptor which either inlines the command payload (up to 320 bytes) or points at other storage (currently an mbuf) for payload. Perhaps this can be made simpler. However, the firmware expects commands on Tx queue 9, so it invites drivers to treat the command queue in the same way as other queues. What I'm doing right now is fixing the code as it ought to be written if an mbuf is used for large command payloads. Perhaps not perfect, but better than broken.
