All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] mt76: retry rx polling as long as there is budget left
@ 2018-01-24 15:19 Felix Fietkau
  2018-01-24 15:19 ` [PATCH 2/8] mt76: fix TSF value in probe responses Felix Fietkau
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Felix Fietkau @ 2018-01-24 15:19 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

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>
---
 drivers/net/wireless/mediatek/mt76/dma.c | 10 +++++++---
 1 file 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;
 }
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-01-26  9:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 15:19 [PATCH 1/8] mt76: retry rx polling as long as there is budget left Felix Fietkau
2018-01-24 15:19 ` [PATCH 2/8] mt76: fix TSF value in probe responses Felix Fietkau
2018-01-24 15:19 ` [PATCH 3/8] mt76: add an intermediate struct for rx status information Felix Fietkau
2018-01-24 15:19 ` [PATCH 4/8] mt76: get station pointer by wcid and pass it to mac80211 Felix Fietkau
2018-01-24 15:19 ` [PATCH 5/8] mt76: implement A-MPDU rx reordering in the driver code Felix Fietkau
2018-01-24 15:19 ` [PATCH 6/8] mt76: split mt76_rx_complete Felix Fietkau
2018-01-24 15:19 ` [PATCH 7/8] mt76: pass the per-vif wcid to the core for multicast rx Felix Fietkau
2018-01-24 15:19 ` [PATCH 8/8] mt76: validate rx CCMP PN Felix Fietkau
2018-01-24 15:56   ` Johannes Berg
2018-01-24 16:11     ` Felix Fietkau
2018-01-24 16:20       ` Johannes Berg
2018-01-24 16:23         ` Felix Fietkau
2018-01-25 10:44   ` [PATCH v2 " Felix Fietkau
2018-01-26  9:21     ` [v2,8/8] " Kalle Valo
2018-01-26  9:20 ` [1/8] mt76: retry rx polling as long as there is budget left Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.