Skip to content

Commit

Permalink
Revert "mt76: dma: queue more rx frames internally before passing the…
Browse files Browse the repository at this point in the history
…m to the stack"

This reverts commit 0fc3c5e.
  • Loading branch information
nbd168 committed Sep 7, 2020
1 parent 0fc3c5e commit 130e5de
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
12 changes: 5 additions & 7 deletions dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,27 +599,25 @@ static int
mt76_dma_rx_poll(struct napi_struct *napi, int budget)
{
struct mt76_dev *dev;
int qid, done = 0, cur, cur_dma;
int rxq_budget;
int qid, done = 0, cur;

dev = container_of(napi->dev, struct mt76_dev, napi_dev);
qid = napi - dev->napi;

rcu_read_lock();

do {
rxq_budget = MT_RX_QUEUE_LEN - skb_queue_len(&dev->rx_skb[qid]);
cur_dma = mt76_dma_rx_process(dev, &dev->q_rx[qid], rxq_budget);
cur = mt76_rx_poll_complete(dev, qid, napi, budget - done);
cur = mt76_dma_rx_process(dev, &dev->q_rx[qid], budget - done);
mt76_rx_poll_complete(dev, qid, napi);
done += cur;
} while ((cur || cur_dma) && done < budget);
} while (cur && done < budget);

rcu_read_unlock();

if (done < budget && napi_complete(napi))
dev->drv->rx_poll_complete(dev, qid);

return min(done, budget);
return done;
}

static int
Expand Down
11 changes: 3 additions & 8 deletions mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,25 +962,20 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
}
}

int mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
struct napi_struct *napi, int budget)
void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
struct napi_struct *napi)
{
struct sk_buff_head frames;
struct sk_buff *skb;
int nframes;

__skb_queue_head_init(&frames);

while (budget > skb_queue_len(&frames) &&
(skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) {
while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) {
mt76_check_sta(dev, skb);
mt76_rx_aggr_reorder(skb, &frames);
}

nframes = skb_queue_len(&frames);
mt76_rx_complete(dev, &frames, napi);

return nframes;
}
EXPORT_SYMBOL_GPL(mt76_rx_poll_complete);

Expand Down
6 changes: 2 additions & 4 deletions mt76.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MT_MAX_NON_AQL_PKT 16
#define MT_TXQ_FREE_THR 32

#define MT_RX_QUEUE_LEN 256

struct mt76_dev;
struct mt76_phy;
struct mt76_wcid;
Expand Down Expand Up @@ -1015,8 +1013,8 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
struct napi_struct *napi);
int mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
struct napi_struct *napi, int budget);
void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
struct napi_struct *napi);
void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames);
void mt76_testmode_tx_pending(struct mt76_dev *dev);
void mt76_queue_tx_complete(struct mt76_dev *dev, struct mt76_queue *q,
Expand Down
2 changes: 1 addition & 1 deletion sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ mt76s_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
nframes++;
}
if (qid == MT_RXQ_MAIN)
mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL, MT_RX_QUEUE_LEN);
mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL);

return nframes;
}
Expand Down
2 changes: 1 addition & 1 deletion usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
mt76u_submit_rx_buf(dev, qid, urb);
}
if (qid == MT_RXQ_MAIN)
mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL, MT_RX_QUEUE_LEN);
mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL);
}

static void mt76u_rx_tasklet(unsigned long data)
Expand Down

0 comments on commit 130e5de

Please sign in to comment.