diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-01-24 16:19:10 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-01-26 11:18:31 +0200 |
commit | 2b4307f538ab31954e9b6d4ff64b6cf5b33196e1 (patch) | |
tree | 3e90a85a9631296b3cba32ecb9add6f36477fa7c /drivers/net | |
parent | f7a611707b2755e2658a80c96e276e9506e674c4 (diff) | |
download | linux-stable-2b4307f538ab31954e9b6d4ff64b6cf5b33196e1.tar.gz linux-stable-2b4307f538ab31954e9b6d4ff64b6cf5b33196e1.tar.bz2 linux-stable-2b4307f538ab31954e9b6d4ff64b6cf5b33196e1.zip |
mt76: retry rx polling as long as there is budget left
Sending frames to mac80211 needs time, which could allow for more rx
packets to end up in the DMA ring. Retry polling until there are no more
frames left. Improves rx latency under load.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/dma.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index ecd409a4a89b..e539b3838b94 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -387,17 +387,21 @@ static int mt76_dma_rx_poll(struct napi_struct *napi, int budget) { struct mt76_dev *dev; - int qid, done; + int qid, done = 0, cur; dev = container_of(napi->dev, struct mt76_dev, napi_dev); qid = napi - dev->napi; - done = mt76_dma_rx_process(dev, &dev->q_rx[qid], budget); + do { + cur = mt76_dma_rx_process(dev, &dev->q_rx[qid], budget - done); + mt76_rx_complete(dev, qid); + done += cur; + } while (cur && done < budget); + if (done < budget) { napi_complete(napi); dev->drv->rx_poll_complete(dev, qid); } - mt76_rx_complete(dev, qid); return done; } |