From 888990e159d21e932a4cde91d2e073b149cd9ead Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 26 Jul 2020 13:09:51 +0200 Subject: [PATCH] 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 --- dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dma.c b/dma.c index a321f24e..894c198a 100644 --- a/dma.c +++ b/dma.c @@ -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]); }