Commit 2b4a6698 authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg

mac80211: make ieee80211_schedule_txq schedule empty TXQs

Currently there is no way for the driver to signal to mac80211 that it should
schedule a TXQ even if there are no packets on the mac80211 part of that queue.
This is problematic if the driver has an internal retry queue to deal with
software A-MPDU retry.

This patch changes the behavior of ieee80211_schedule_txq to always schedule
the queue, as its only user (ath9k) seems to expect such behavior already:
it calls this function on tx status and on powersave wakeup whenever its
internal retry queue is not empty.

Also add an extra argument to ieee80211_return_txq to get the same behavior.

This fixes an issue on ath9k where tx queues with packets to retry (and no
new packets in mac80211) would not get serviced.

Fixes: 89cea749 ("ath9k: Switch to mac80211 TXQ scheduling and airtime APIs")
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 45fcef8b
...@@ -2728,7 +2728,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb) ...@@ -2728,7 +2728,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb)
num_msdus++; num_msdus++;
num_bytes += ret; num_bytes += ret;
} }
ieee80211_return_txq(hw, txq); ieee80211_return_txq(hw, txq, false);
ieee80211_txq_schedule_end(hw, txq->ac); ieee80211_txq_schedule_end(hw, txq->ac);
record->num_msdus = cpu_to_le16(num_msdus); record->num_msdus = cpu_to_le16(num_msdus);
......
...@@ -4089,7 +4089,7 @@ static int ath10k_mac_schedule_txq(struct ieee80211_hw *hw, u32 ac) ...@@ -4089,7 +4089,7 @@ static int ath10k_mac_schedule_txq(struct ieee80211_hw *hw, u32 ac)
if (ret < 0) if (ret < 0)
break; break;
} }
ieee80211_return_txq(hw, txq); ieee80211_return_txq(hw, txq, false);
ath10k_htt_tx_txq_update(hw, txq); ath10k_htt_tx_txq_update(hw, txq);
if (ret == -EBUSY) if (ret == -EBUSY)
break; break;
...@@ -4374,7 +4374,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, ...@@ -4374,7 +4374,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw,
if (ret < 0) if (ret < 0)
break; break;
} }
ieee80211_return_txq(hw, txq); ieee80211_return_txq(hw, txq, false);
ath10k_htt_tx_txq_update(hw, txq); ath10k_htt_tx_txq_update(hw, txq);
out: out:
ieee80211_txq_schedule_end(hw, ac); ieee80211_txq_schedule_end(hw, ac);
......
...@@ -1938,12 +1938,15 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) ...@@ -1938,12 +1938,15 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
goto out; goto out;
while ((queue = ieee80211_next_txq(hw, txq->mac80211_qnum))) { while ((queue = ieee80211_next_txq(hw, txq->mac80211_qnum))) {
bool force;
tid = (struct ath_atx_tid *)queue->drv_priv; tid = (struct ath_atx_tid *)queue->drv_priv;
ret = ath_tx_sched_aggr(sc, txq, tid); ret = ath_tx_sched_aggr(sc, txq, tid);
ath_dbg(common, QUEUE, "ath_tx_sched_aggr returned %d\n", ret); ath_dbg(common, QUEUE, "ath_tx_sched_aggr returned %d\n", ret);
ieee80211_return_txq(hw, queue); force = !skb_queue_empty(&tid->retry_q);
ieee80211_return_txq(hw, queue, force);
} }
out: out:
......
...@@ -6253,26 +6253,42 @@ static inline void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac) ...@@ -6253,26 +6253,42 @@ static inline void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
{ {
} }
void __ieee80211_schedule_txq(struct ieee80211_hw *hw,
struct ieee80211_txq *txq, bool force);
/** /**
* ieee80211_schedule_txq - schedule a TXQ for transmission * ieee80211_schedule_txq - schedule a TXQ for transmission
* *
* @hw: pointer as obtained from ieee80211_alloc_hw() * @hw: pointer as obtained from ieee80211_alloc_hw()
* @txq: pointer obtained from station or virtual interface * @txq: pointer obtained from station or virtual interface
* *
* Schedules a TXQ for transmission if it is not already scheduled. * Schedules a TXQ for transmission if it is not already scheduled,
* even if mac80211 does not have any packets buffered.
*
* The driver may call this function if it has buffered packets for
* this TXQ internally.
*/ */
void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq); static inline void
ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
{
__ieee80211_schedule_txq(hw, txq, true);
}
/** /**
* ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq() * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
* *
* @hw: pointer as obtained from ieee80211_alloc_hw() * @hw: pointer as obtained from ieee80211_alloc_hw()
* @txq: pointer obtained from station or virtual interface * @txq: pointer obtained from station or virtual interface
* @force: schedule txq even if mac80211 does not have any buffered packets.
*
* The driver may set force=true if it has buffered packets for this TXQ
* internally.
*/ */
static inline void static inline void
ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq) ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq,
bool force)
{ {
ieee80211_schedule_txq(hw, txq); __ieee80211_schedule_txq(hw, txq, force);
} }
/** /**
......
...@@ -3688,8 +3688,9 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac) ...@@ -3688,8 +3688,9 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)
} }
EXPORT_SYMBOL(ieee80211_next_txq); EXPORT_SYMBOL(ieee80211_next_txq);
void ieee80211_schedule_txq(struct ieee80211_hw *hw, void __ieee80211_schedule_txq(struct ieee80211_hw *hw,
struct ieee80211_txq *txq) struct ieee80211_txq *txq,
bool force)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
struct txq_info *txqi = to_txq_info(txq); struct txq_info *txqi = to_txq_info(txq);
...@@ -3697,7 +3698,8 @@ void ieee80211_schedule_txq(struct ieee80211_hw *hw, ...@@ -3697,7 +3698,8 @@ void ieee80211_schedule_txq(struct ieee80211_hw *hw,
spin_lock_bh(&local->active_txq_lock[txq->ac]); spin_lock_bh(&local->active_txq_lock[txq->ac]);
if (list_empty(&txqi->schedule_order) && if (list_empty(&txqi->schedule_order) &&
(!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets)) { (force || !skb_queue_empty(&txqi->frags) ||
txqi->tin.backlog_packets)) {
/* If airtime accounting is active, always enqueue STAs at the /* If airtime accounting is active, always enqueue STAs at the
* head of the list to ensure that they only get moved to the * head of the list to ensure that they only get moved to the
* back by the airtime DRR scheduler once they have a negative * back by the airtime DRR scheduler once they have a negative
...@@ -3717,7 +3719,7 @@ void ieee80211_schedule_txq(struct ieee80211_hw *hw, ...@@ -3717,7 +3719,7 @@ void ieee80211_schedule_txq(struct ieee80211_hw *hw,
spin_unlock_bh(&local->active_txq_lock[txq->ac]); spin_unlock_bh(&local->active_txq_lock[txq->ac]);
} }
EXPORT_SYMBOL(ieee80211_schedule_txq); EXPORT_SYMBOL(__ieee80211_schedule_txq);
bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw, bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
struct ieee80211_txq *txq) struct ieee80211_txq *txq)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment