In order to avoid keeping work like tx scheduling pinned to the CPU it was
scheduled from, it makes sense to switch from tasklets to kernel threads.
Signed-off-by: Felix Fietkau <[email protected]>
On 7615 and newer, DMA completion only triggers unmap, but not free of queued
skbs, since pointers to packets are queued internally.
Because of that, there is no need to process the main data queue immediately
on DMA completion.
To improve performance, mask out the DMA data queue completion interrupt and
process the queue only when we receive a txfree event.
This brings the number of interrupts under load down to a small fraction.
Signed-off-by: Felix Fietkau <[email protected]>
The previous scheduling round may have been limited by AQL.
More frames might be available after the tx free run.
Signed-off-by: Felix Fietkau <[email protected]>
With threaded NAPI support it becomes more likely that tx cleanup and tx
enqueuing will run in parallel. In order to avoid queue starvation issues
under load, update q->queued immediately.
Signed-off-by: Felix Fietkau <[email protected]>
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]>
Since DMA completion does not imply tx completion, it makes more sense to
poll for airtime from mt7915_mac_tx_free.
Reduce the runtime of the function by moving all items from dev->sta_poll_list
to a local list once and process any stations that were added afterwards
on the next run
Signed-off-by: Felix Fietkau <[email protected]>
- change the WTBL LMAC access function to set the mapping window only once
- use ac * 2 as offset, since each AC has separate words for rx and tx
Signed-off-by: Felix Fietkau <[email protected]>
Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
by accident, because a mac80211 issue breaks AQL on drivers with firmware
rate control that report the rate via ieee80211_tx_status_ext as struct
rate_info.
Signed-off-by: Felix Fietkau <[email protected]>
The implementation of embedding WTBL update inside the STA_REC update is buggy
on the MT7615 v2 firmware. This leads to connection issues after a station has
connected and disconnected again.
Switch to the v1 MCU API ops, since they have received much more testing and
should be more stable.
On MT7622 and later, the v2 API is more actively used, so we should keep using
it as well.
Fixes: 6849e29ed92e ("mt76: mt7615: add starec operating flow for firmware v2")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
Use the txwi data as primary source information to avoid touching skb data
Use bitfield instead of state variable + spinlock
Signed-off-by: Felix Fietkau <[email protected]>
mt7615 and newer drivers do not need this, since they use sequence number offload
Moving this code also reduces the number of callsites to make it easier to review
Signed-off-by: Felix Fietkau <[email protected]>
Queueing a per-sta work item from the tx free path can become very expensive
under load. This work is only supposed to pull rate control stats every
second and deal with rate control changes.
Additionally, the rate control update code was wrong, because it was
confusing bit masks and bit numbers in test_bit.
Fix this by introducing a dedicated device work item for rate control
updates, and by polling station stats from the phy mac work.
Stations requiring polling or rate control updates are added to lists
protected by dev->sta_poll_lock.
Signed-off-by: Felix Fietkau <[email protected]>
Only clear unmasked interrupts. If an interrupt is temporarily masked,
its pending events need to be processed later, even if another interrupt
happened in the mean time.
Disable interrupts in one call before scheduling
Signed-off-by: Felix Fietkau <[email protected]>
If an interrupt is temporarily masked, its pending events need to be processed
later, even if another interrupt happened in the mean time.
Signed-off-by: Felix Fietkau <[email protected]>
Only clear unmasked interrupts. If an interrupt is temporarily masked,
its pending events need to be processed later, even if another interrupt
happened in the mean time.
Signed-off-by: Felix Fietkau <[email protected]>
Remove unused state variable in mt76_sdio structure
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
In order to maximize parallelism, split status work in tx status work
and rx net work
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
As it has been done for tx and rx processing, move tx/rx status
processing into mt76s_txrx_wq workqueue
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Move rx processing to mt76s_txrx_wq in order to minimize the interval when
the sdio bus is locked during rx
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Introduce mt76s_txrx_wq workqueue and move tx processing from kthread to
a dedicated work. This is preliminary patch to improve mt7663s throughput
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Free the mcu skb in case of error in mt76s_tx_queue_skb_raw routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Reschedule runtime-pm after receiving a tx interrupt.
Update runtime-pm last activity before injecting packets
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Do not tx packets in mt76_txq_send_burst() or mt76_txq_schedule_list()
if the device is in runtime-pm
Signed-off-by: Lorenzo Bianconi <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
wq queue is always updated holding mt76 spinlock. Grab mt76 lock in
mt7615_queue_key_update() before putting a new element at the end of the
queue.
Fixes: eb99cc95c3b65 ("mt76: mt7615: introduce mt7663u support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Initialize set_drv_ctrl and set_fw_ctrl function pointers in
mt7663s_mcu_init. This is a preliminary patch to enable runtime-pm for
mt7663s chipset.
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Introduce set_drv_ctrl and set_fw_ctrl function pointers in
mt7615_mcu_ops data structure. This is a preliminary patch to enable
runtime-pm for non-pci chipsets
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
MT_EE_WIFI_CONF field can be used to detect if the chipset is MT7615D.
Thus, add support to automatically register ext_phy if DBDC is detected.
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
A small part of the first skb buffer is passed to the firmware for parsing
via DMA, while the full buffer is passed as part of the TXP.
Avoid calling DMA unmap on the first part (with a different length than map)
Signed-off-by: Felix Fietkau <[email protected]>
In the implementation of __mt76x02u_mcu_send_msg() the skb is consumed
all execution paths except one. Release skb before returning if
test_bit() fails.
Signed-off-by: Navid Emamdoost <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Free the second mcu skb if __mt76_mcu_skb_send_msg() fails to transmit
the first one in mt7615_mcu_wtbl_sta_add().
Fixes: 99c457d902cf9 ("mt76: mt7615: move mt7615_mcu_set_bmc to mt7615_mcu_ops")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
In order to avoid possible overflows, move tx queue accounting from
mt7663s_tx_run_queue() to mt76s_tx_queue_skb_raw()/mt76s_tx_queue_skb()
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>