mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: set page_pool napi pointer for mmio devices
In order to recycle skbs in the page_pool "hot" cache in napi_pp_put_page routine, set napi pointer for MMIO devices in mt76_create_page_pool(). Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
d67da44b59
commit
ffdbdcd396
+9
-1
@@ -613,13 +613,18 @@ EXPORT_SYMBOL_GPL(mt76_unregister_phy);
|
||||
|
||||
int mt76_create_page_pool(struct mt76_dev *dev, struct mt76_queue *q)
|
||||
{
|
||||
bool is_qrx = mt76_queue_is_rx(dev, q);
|
||||
struct page_pool_params pp_params = {
|
||||
.order = 0,
|
||||
.flags = 0,
|
||||
.nid = NUMA_NO_NODE,
|
||||
.dev = dev->dma_dev,
|
||||
};
|
||||
int idx = q - dev->q_rx;
|
||||
int idx = is_qrx ? q - dev->q_rx : -1;
|
||||
|
||||
/* Allocate page_pools just for rx/wed_tx_free queues */
|
||||
if (!is_qrx && !mt76_queue_is_wed_tx_free(q))
|
||||
return 0;
|
||||
|
||||
switch (idx) {
|
||||
case MT_RXQ_MAIN:
|
||||
@@ -640,6 +645,9 @@ int mt76_create_page_pool(struct mt76_dev *dev, struct mt76_queue *q)
|
||||
pp_params.dma_dir = DMA_FROM_DEVICE;
|
||||
pp_params.max_len = PAGE_SIZE;
|
||||
pp_params.offset = 0;
|
||||
/* NAPI is available just for rx queues */
|
||||
if (idx >= 0 && idx < ARRAY_SIZE(dev->napi))
|
||||
pp_params.napi = &dev->napi[idx];
|
||||
}
|
||||
|
||||
q->page_pool = page_pool_create(&pp_params);
|
||||
|
||||
Reference in New Issue
Block a user