mt76: remove retry_q from struct mt76_txq and related code
Since the switch to using AQL by default, mtxq->retry_q is never filled anymore Remove it to get rid of a few more unnecessary cycles in the tx path Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
dd57a95cfd
commit
2bffddedfc
|
@ -879,7 +879,6 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
|
|||
struct ieee80211_hw *hw;
|
||||
struct mt76_wcid *wcid = status->wcid;
|
||||
bool ps;
|
||||
int i;
|
||||
|
||||
hw = mt76_phy_hw(dev, status->ext_phy);
|
||||
if (ieee80211_is_pspoll(hdr->frame_control) && !wcid) {
|
||||
|
@ -929,20 +928,6 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
|
|||
|
||||
dev->drv->sta_ps(dev, sta, ps);
|
||||
ieee80211_sta_ps_transition(sta, ps);
|
||||
|
||||
if (ps)
|
||||
return;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(sta->txq); i++) {
|
||||
struct mt76_txq *mtxq;
|
||||
|
||||
if (!sta->txq[i])
|
||||
continue;
|
||||
|
||||
mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv;
|
||||
if (!skb_queue_empty(&mtxq->retry_q))
|
||||
ieee80211_schedule_txq(hw, sta->txq[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
|
||||
|
@ -1004,8 +989,6 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
|||
|
||||
mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv;
|
||||
mtxq->wcid = wcid;
|
||||
|
||||
mt76_txq_init(dev, sta->txq[i]);
|
||||
}
|
||||
|
||||
ewma_signal_init(&wcid->rssi);
|
||||
|
@ -1033,8 +1016,6 @@ void __mt76_sta_remove(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
|||
dev->drv->sta_remove(dev, vif, sta);
|
||||
|
||||
mt76_tx_status_check(dev, wcid, true);
|
||||
for (i = 0; i < ARRAY_SIZE(sta->txq); i++)
|
||||
mt76_txq_remove(dev, sta->txq[i]);
|
||||
mt76_wcid_mask_clear(dev->wcid_mask, idx);
|
||||
mt76_wcid_mask_clear(dev->wcid_phy_mask, idx);
|
||||
}
|
||||
|
|
|
@ -226,11 +226,8 @@ struct mt76_wcid {
|
|||
};
|
||||
|
||||
struct mt76_txq {
|
||||
struct mt76_queue *q;
|
||||
struct mt76_wcid *wcid;
|
||||
|
||||
struct sk_buff_head retry_q;
|
||||
|
||||
u16 agg_ssn;
|
||||
bool send_bar;
|
||||
bool aggr;
|
||||
|
@ -900,8 +897,6 @@ static inline bool mt76_testmode_enabled(struct mt76_dev *dev)
|
|||
void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb);
|
||||
void mt76_tx(struct mt76_phy *dev, struct ieee80211_sta *sta,
|
||||
struct mt76_wcid *wcid, struct sk_buff *skb);
|
||||
void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq);
|
||||
void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq);
|
||||
void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
|
||||
void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
|
||||
bool send_bar);
|
||||
|
|
|
@ -75,7 +75,6 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|||
|
||||
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
|
||||
mtxq->wcid = &mvif->sta.wcid;
|
||||
mt76_txq_init(&dev->mt76, vif->txq);
|
||||
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
|
||||
|
||||
out:
|
||||
|
@ -99,7 +98,6 @@ mt7603_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|||
mt7603_beacon_set_timer(dev, mvif->idx, 0);
|
||||
|
||||
rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
|
||||
mt76_txq_remove(&dev->mt76, vif->txq);
|
||||
|
||||
spin_lock_bh(&dev->sta_poll_lock);
|
||||
if (!list_empty(&msta->poll_list))
|
||||
|
|
|
@ -205,7 +205,6 @@ static int mt7615_add_interface(struct ieee80211_hw *hw,
|
|||
if (vif->txq) {
|
||||
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
|
||||
mtxq->wcid = &mvif->sta.wcid;
|
||||
mt76_txq_init(&dev->mt76, vif->txq);
|
||||
}
|
||||
|
||||
ret = mt7615_mcu_add_dev_info(dev, vif, true);
|
||||
|
@ -256,8 +255,6 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,
|
|||
mt7615_mcu_add_dev_info(dev, vif, false);
|
||||
|
||||
rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
|
||||
if (vif->txq)
|
||||
mt76_txq_remove(&dev->mt76, vif->txq);
|
||||
|
||||
dev->mphy.vif_mask &= ~BIT(mvif->idx);
|
||||
dev->omac_mask &= ~BIT(mvif->omac_idx);
|
||||
|
|
|
@ -294,8 +294,6 @@ mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
|
|||
mvif->group_wcid.hw_key_idx = -1;
|
||||
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
|
||||
mtxq->wcid = &mvif->group_wcid;
|
||||
|
||||
mt76_txq_init(&dev->mt76, vif->txq);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -347,7 +345,6 @@ void mt76x02_remove_interface(struct ieee80211_hw *hw,
|
|||
struct mt76x02_dev *dev = hw->priv;
|
||||
struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
|
||||
|
||||
mt76_txq_remove(&dev->mt76, vif->txq);
|
||||
dev->mphy.vif_mask &= ~BIT(mvif->idx);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76x02_remove_interface);
|
||||
|
|
|
@ -169,7 +169,6 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
|
|||
if (vif->txq) {
|
||||
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
|
||||
mtxq->wcid = &mvif->sta.wcid;
|
||||
mt76_txq_init(&dev->mt76, vif->txq);
|
||||
}
|
||||
|
||||
out:
|
||||
|
@ -192,8 +191,6 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw,
|
|||
mt7915_mcu_add_dev_info(dev, vif, false);
|
||||
|
||||
rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
|
||||
if (vif->txq)
|
||||
mt76_txq_remove(&dev->mt76, vif->txq);
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
phy->mt76->vif_mask &= ~BIT(mvif->idx);
|
||||
|
|
|
@ -301,23 +301,13 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
|
|||
EXPORT_SYMBOL_GPL(mt76_tx);
|
||||
|
||||
static struct sk_buff *
|
||||
mt76_txq_dequeue(struct mt76_phy *phy, struct mt76_txq *mtxq, bool ps)
|
||||
mt76_txq_dequeue(struct mt76_phy *phy, struct mt76_txq *mtxq)
|
||||
{
|
||||
struct ieee80211_txq *txq = mtxq_to_txq(mtxq);
|
||||
struct ieee80211_tx_info *info;
|
||||
bool ext_phy = phy != &phy->dev->phy;
|
||||
struct sk_buff *skb;
|
||||
|
||||
skb = skb_dequeue(&mtxq->retry_q);
|
||||
if (skb) {
|
||||
u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
|
||||
|
||||
if (ps && skb_queue_empty(&mtxq->retry_q))
|
||||
ieee80211_sta_set_buffered(txq->sta, tid, false);
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
skb = ieee80211_tx_dequeue(phy->hw, txq);
|
||||
if (!skb)
|
||||
return NULL;
|
||||
|
@ -367,7 +357,7 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
|
|||
continue;
|
||||
|
||||
do {
|
||||
skb = mt76_txq_dequeue(phy, mtxq, true);
|
||||
skb = mt76_txq_dequeue(phy, mtxq);
|
||||
if (!skb)
|
||||
break;
|
||||
|
||||
|
@ -410,7 +400,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
|
|||
if (atomic_read(&wcid->non_aql_packets) >= MT_MAX_NON_AQL_PKT)
|
||||
return 0;
|
||||
|
||||
skb = mt76_txq_dequeue(phy, mtxq, false);
|
||||
skb = mt76_txq_dequeue(phy, mtxq);
|
||||
if (!skb)
|
||||
return 0;
|
||||
|
||||
|
@ -434,7 +424,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
|
|||
if (q->queued + MT_TXQ_FREE_THR >= q->ndesc)
|
||||
break;
|
||||
|
||||
skb = mt76_txq_dequeue(phy, mtxq, false);
|
||||
skb = mt76_txq_dequeue(phy, mtxq);
|
||||
if (!skb)
|
||||
break;
|
||||
|
||||
|
@ -499,8 +489,7 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
|
|||
}
|
||||
|
||||
ret += mt76_txq_send_burst(phy, q, mtxq);
|
||||
ieee80211_return_txq(phy->hw, txq,
|
||||
!skb_queue_empty(&mtxq->retry_q));
|
||||
ieee80211_return_txq(phy->hw, txq, false);
|
||||
}
|
||||
spin_unlock_bh(&q->lock);
|
||||
|
||||
|
@ -562,8 +551,8 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
|
|||
if (!txq)
|
||||
continue;
|
||||
|
||||
hwq = dev->q_tx[mt76_txq_get_qid(txq)];
|
||||
mtxq = (struct mt76_txq *)txq->drv_priv;
|
||||
hwq = mtxq->q;
|
||||
|
||||
spin_lock_bh(&hwq->lock);
|
||||
mtxq->send_bar = mtxq->aggr && send_bar;
|
||||
|
@ -584,34 +573,6 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_wake_tx_queue);
|
||||
|
||||
void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq)
|
||||
{
|
||||
struct ieee80211_hw *hw;
|
||||
struct mt76_txq *mtxq;
|
||||
struct sk_buff *skb;
|
||||
|
||||
if (!txq)
|
||||
return;
|
||||
|
||||
mtxq = (struct mt76_txq *)txq->drv_priv;
|
||||
|
||||
while ((skb = skb_dequeue(&mtxq->retry_q)) != NULL) {
|
||||
hw = mt76_tx_status_get_hw(dev, skb);
|
||||
ieee80211_free_txskb(hw, skb);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_txq_remove);
|
||||
|
||||
void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq)
|
||||
{
|
||||
struct mt76_txq *mtxq = (struct mt76_txq *)txq->drv_priv;
|
||||
|
||||
skb_queue_head_init(&mtxq->retry_q);
|
||||
|
||||
mtxq->q = dev->q_tx[mt76_txq_get_qid(txq)];
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_txq_init);
|
||||
|
||||
u8 mt76_ac_to_hwq(u8 ac)
|
||||
{
|
||||
static const u8 wmm_queue_map[] = {
|
||||
|
|
Loading…
Reference in New Issue