mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: use threaded NAPI
With threaded NAPI, the rx handler function is no longer bound to the CPU that fired the interrupt, which significantly helps to spread the workload over multiple CPUs, especially when multiple devices are using threaded NAPI at the same time. Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -564,7 +564,6 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget)
|
||||
dev = container_of(napi->dev, struct mt76_dev, napi_dev);
|
||||
qid = napi - dev->napi;
|
||||
|
||||
local_bh_disable();
|
||||
rcu_read_lock();
|
||||
|
||||
do {
|
||||
@@ -574,7 +573,6 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget)
|
||||
} while (cur && done < budget);
|
||||
|
||||
rcu_read_unlock();
|
||||
local_bh_enable();
|
||||
|
||||
if (done < budget && napi_complete(napi))
|
||||
dev->drv->rx_poll_complete(dev, qid);
|
||||
@@ -590,8 +588,8 @@ mt76_dma_init(struct mt76_dev *dev)
|
||||
init_dummy_netdev(&dev->napi_dev);
|
||||
|
||||
mt76_for_each_q_rx(dev, i) {
|
||||
netif_napi_add(&dev->napi_dev, &dev->napi[i], mt76_dma_rx_poll,
|
||||
64);
|
||||
netif_threaded_napi_add(&dev->napi_dev, &dev->napi[i],
|
||||
mt76_dma_rx_poll, 64);
|
||||
mt76_dma_rx_fill(dev, &dev->q_rx[i]);
|
||||
napi_enable(&dev->napi[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user