rtw88: kick off TX packets once for higher efficiency
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Thu, 12 Mar 2020 08:08:52 +0000 (16:08 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 23 Mar 2020 17:29:58 +0000 (19:29 +0200)
commitaaab5d0e673749f82ff34e5f15ea8a689789a9ce
tree3e0fda8f6817300efc3b83841c6f975b3635c378
parenta5697a65ecd109ce7f8e3661b89a5dffae73b512
rtw88: kick off TX packets once for higher efficiency

Driver used to kick off every TX packets, that will waste some
time while we can do better to kick off the TX packets once after
they are all prepared to be transmitted.

For PCI, it uses DMA engine to transfer the SKBs to the device,
and the transition of the state of the DMA engine could be a cost.
Driver can save some time to kick off multiple SKBs once so that
the DMA engine will have only one transition.

So, split rtw_hci_ops::tx() to rtw_hci_ops::tx_write() and
rtw_hci_ops::tx_kick_off() to explicitly kick the SKBs off after
they are written to the prepared buffer. For packets come from
ieee80211_ops::tx(), write one and then kick it off immediately.
For packets queued in TX queue, which come from
ieee80211_ops::wake_tx_queue(), we can dequeue them, write them
to the buffer, and then kick them off together.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200312080852.16684-6-yhchuang@realtek.com
drivers/net/wireless/realtek/rtw88/hci.h
drivers/net/wireless/realtek/rtw88/pci.c
drivers/net/wireless/realtek/rtw88/pci.h
drivers/net/wireless/realtek/rtw88/tx.c
drivers/net/wireless/realtek/rtw88/tx.h