Commit Graph
62 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau 66f394984d mt76: introduce tx_queue_skb function pointer in mt76_bus_ops
Add tx_queue_skb function pointer in mt76_bus_ops since mt76x2u based
devices do not map mt76x2_txwi on dma buffers and it is not possible
to reuse mt76_dma_tx_queue_skb() routine to enqueue tx frames to
hw buffers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 7ac6dac9a3 mt76: rename mt76_tx_queue_skb in mt76_dma_tx_queue_skb
Move mt76_dma_tx_queue_skb routine in dma.c.
Remove static qualifier from mt76_get_txwi definition

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 730b86c73a mt76x2: add napi struct to mt76_rx_poll_complete/mt76_rx_complete signatures
in order to reuse mt76_rx_complete routine supporting mt76x2u based
devices add napi struct to mt76_rx_poll_complete and mt76_rx_complete
routine signatures and do not fetch it according to the rx queue index

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Felix Fietkau 8ba17b1825 Revert "mt76: use a per rx queue page fragment cache"
Will be added back after merging upstream changes

Signed-off-by: Felix Fietkau <[email protected]>
2018-09-11 13:49:15 +02:00
Felix Fietkau 08719b1129 mt76: use a per rx queue page fragment cache
Using the NAPI or netdev frag cache along with other drivers can lead to
32 KiB pages being held for a long time, despite only being used for
very few page fragments.

This can happen if the driver grabs one or two fragments for rx ring
refill, while other drivers use (and free up) the remaining fragments.
The 32 KiB higher-order page can only be freed once all users have freed
their fragments.

Depending on the traffic patterns, this can waste a lot of memory and
look a lot like a memory leak.

Signed-off-by: Felix Fietkau <[email protected]>
2018-07-13 16:28:41 +02:00
Felix Fietkau 730c292a2c mt76: wait for pending tx to complete before switching channel
Reduces interruption caused by scanning

Signed-off-by: Felix Fietkau <[email protected]>
2018-05-20 07:57:25 +02:00
Felix Fietkau cf3cfc43af mt76: split mt76_rx_complete
Add a separate function for processing frames after A-MPDU reordering,
reduce code duplication

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-22 10:43:22 +01:00
Felix Fietkau 58a41f17aa mt76: get station pointer by wcid and pass it to mac80211
Avoids the rhashtable lookup based on the MAC address inside mac80211

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-22 10:14:25 +01:00
Felix Fietkau 34d612d9ed mt76: retry rx polling as long as there is budget left
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 <[email protected]>
2018-01-18 19:34:45 +01:00
Felix Fietkau b056a78fd7 dma: fix endian issue in mt76_dma_get_buf
Signed-off-by: Felix Fietkau <[email protected]>
2017-02-27 09:44:20 +01:00
Felix Fietkau b18d66f749 core: fix checkpatch errors
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-05 11:12:19 +02:00
Felix Fietkau b300bdc42e use the new bitfield accessor macros
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 17:37:26 +02:00
Felix Fietkau 53c1b7f6ac update my email address
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 17:33:28 +02:00
Felix Fietkau ced81a3458 relicense to ISC (except for util.h which is based on GPL'd kernel code
Signed-off-by: Felix Fietkau <[email protected]>
2016-07-12 08:38:46 +02:00
Felix Fietkau 6355f35431 move tx queue wake to common code outside of locked section, fixes queue wake on mt7603
Signed-off-by: Felix Fietkau <[email protected]>
2016-03-03 15:57:39 +01:00
Felix Fietkau a957f7480e dma: add function for resetting the state of an rx queue
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-28 21:14:48 +01:00
Felix Fietkau fb818ab727 dma: write cpu index after queue flush, useful for hardware resets
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-28 21:14:48 +01:00
Felix Fietkau f8b61c27d3 dma: fix tx ring flush
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-27 18:30:58 +01:00
Felix Fietkau 9779a98658 let mt76_queue_tx_cleanup take a queue id instead of a pointer
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-25 21:13:30 +01:00
Felix Fietkau 079ad90fe2 update copyright lines
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-25 18:09:13 +01:00
Felix Fietkau 2bd92acfa2 dma: optimize icache footprint of rx path, batch frames before passing them to mac80211
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-08 17:35:40 +01:00
Felix Fietkau 9abb4b1754 dma: respect buffer offset for fragments
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-08 14:10:04 +01:00
Felix Fietkau fa3ee92842 unify tx completion handling, allow a driver callback to clean up tx skbs
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-06 16:14:02 +01:00
Felix Fietkau 2dfb9faa78 add support for queueing frames spanning multiple descriptors
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-05 01:15:35 +01:00
Felix Fietkau a6d7949f67 move rx polling to core
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 15:51:17 +01:00
Felix Fietkau 6b80f6c8dd pass queue index instead of pointer to rx_skb callback
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 15:10:33 +01:00
Felix Fietkau 6678c47893 remove dequeue op
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:59:50 +01:00
Felix Fietkau 41f973373e remove rx_fill op
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:58:35 +01:00
Felix Fietkau 812bcc3a78 mt76x2: move rx queue processing to core
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:51:07 +01:00
Felix Fietkau 859aa10d4d move initial rx queue fill to a new queue init function
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:37:09 +01:00
Felix Fietkau 03ec61db8e remove rx_cleanup queue op
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:24:07 +01:00
Felix Fietkau fc646f34e0 rename mt76_dma_init to mt76_dma_attach
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:19:12 +01:00
Felix Fietkau 92367b3bb9 move dma cleanup to core
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-03 14:17:17 +01:00
Felix Fietkau 1b5492bd23 dma: tell the driver if the buffer was the last one
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-01 21:50:08 +01:00
Felix Fietkau 0bbfb5653f move dma rx cleanup to core
Signed-off-by: Felix Fietkau <[email protected]>
2016-01-28 20:35:26 +01:00
Felix Fietkau 0f896990cd core: use page fragments for rx buffers
Signed-off-by: Felix Fietkau <[email protected]>
2016-01-28 14:54:01 +01:00
Felix Fietkau 206b0dd3d8 move tx queue cleanup locking and scheduling call to core
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-17 15:57:04 +01:00
Felix Fietkau 1389db799a move txwi cache to core
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-17 15:50:01 +01:00
Felix Fietkau fdfbc8477d move remaining tx swq_queued tracking to core
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-16 20:46:19 +01:00
Felix Fietkau e7b9bd8934 move dma rx fill to common code
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-16 20:41:49 +01:00
Felix Fietkau 09b677d777 move rx dma descriptor processing logic to common code
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 23:11:58 +01:00
Felix Fietkau 52038d1690 move queue spinlock/list init to common code
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 22:59:17 +01:00
Felix Fietkau 85e4dbfa00 move more dma processing code to mt76.ko
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 22:54:47 +01:00
Felix Fietkau 66af6b3aad move low level DMA code to mt76.ko
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 21:32:43 +01:00
Felix Fietkau a0ee20716f add a mt76x2_ prefix to all files
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 16:54:53 +01:00
Felix Fietkau 31c11fdb05 replace mt76 prefix with mt76x2 in preparation for splitting the driver for more chipset support
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 16:54:53 +01:00
Felix Fietkau 0220a2ba50 dma: remove unused-but-set variable
Signed-off-by: Felix Fietkau <[email protected]>
2015-10-05 17:27:43 +02:00
Felix Fietkau f2a1c2b6a2 dma: rename dma_ops to avoid conflict with arch headers
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-27 20:45:22 +02:00
Felix Fietkau 05f85cdc88 dma: validate skb length
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-26 20:47:15 +02:00
Felix Fietkau 1cc86bafa7 dma: fix rx buffer allocation size
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-18 17:51:24 +02:00